几天后我的第一个 Verilog 任务到期,无论出于何种原因,这些概念都在逃避我。我不认为我在考虑并行性和硬件或其他方面。
我的问题是我必须使用 sand
一起使用几个开关和按钮wire
并打开 7 个阵列中的 3 个 LED。我很确定我知道如何进行计算逻辑,但我不知道如何使用assign
和wire
正确打开所有 3 个 LED,而无需写入 3 个单独的行。这样做感觉不对:
assign Led[0] = output;
assign Led[1] = output;
assign Led[2] = output;
此外,这很奇怪,因为板上有 7 个 LED,而我选择的是 LED 0、2、4。
有人可以告诉我这应该如何以正确的方式工作吗?我们没有教科书,我一直在网上阅读基础知识,但我似乎无法弄清楚这应该如何工作。谢谢!
编辑:这是我当前的代码,但我收到的错误表明没有什么是“驱动的”。是什么赋予了?
module Lab2_1(input [5:0] sw, input btns, output [7:0] Led );
wire [2:0] leds;
wand out;
assign leds = {Led[0], Led[2], Led[4]};
and U1 (out, sw[0], sw[1]);
and U2 (out,~sw[2],~sw[3]);
xor U3 (out,sw[4],sw[5]);
assign out = btns;
assign leds[2:0] = {3{out}};
endmodule
错误:
ERROR:PhysDesignRules:368 - The signal <Led<3>_OBUF> is incomplete. The signal
is not driven by any source pin in the design.
ERROR:PhysDesignRules:368 - The signal <Led<4>_OBUF> is incomplete. The signal
is not driven by any source pin in the design.
ERROR:PhysDesignRules:368 - The signal <Led<5>_OBUF> is incomplete. The signal
is not driven by any source pin in the design.
ERROR:PhysDesignRules:368 - The signal <Led<6>_OBUF> is incomplete. The signal
is not driven by any source pin in the design.
ERROR:PhysDesignRules:368 - The signal <Led<7>_OBUF> is incomplete. The signal
is not driven by any source pin in the design.
ERROR:PhysDesignRules:368 - The signal <Led<0>_OBUF> is incomplete. The signal
is not driven by any source pin in the design.
ERROR:PhysDesignRules:368 - The signal <Led<1>_OBUF> is incomplete. The signal
is not driven by any source pin in the design.
ERROR:PhysDesignRules:368 - The signal <Led<2>_OBUF> is incomplete. The signal
is not driven by any source pin in the design.
ERROR:PhysDesignRules:10 - The network <Led<3>_OBUF> is completely unrouted.
ERROR:PhysDesignRules:10 - The network <Led<4>_OBUF> is completely unrouted.
ERROR:PhysDesignRules:10 - The network <Led<5>_OBUF> is completely unrouted.
ERROR:PhysDesignRules:10 - The network <Led<6>_OBUF> is completely unrouted.
ERROR:PhysDesignRules:10 - The network <Led<7>_OBUF> is completely unrouted.
ERROR:PhysDesignRules:10 - The network <Led<0>_OBUF> is completely unrouted.
ERROR:PhysDesignRules:10 - The network <Led<1>_OBUF> is completely unrouted.
ERROR:PhysDesignRules:10 - The network <Led<2>_OBUF> is completely unrouted.
ERROR:Bitgen:25 - DRC detected 16 errors and 0 warnings. Please see the
previously displayed individual error or warning messages for more details.