开发者

wire equation in verilog [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 开发者_StackOverflow社区years ago.

If say I have the following wire set-ups, is the wire assignment all valid?

wire[3:1] w;
wire w1;
wire [1:0] w2;

A) w1 = w[2];    
B) w2 = w[1:0];  
C) w2 = w[1:2];

I am guessing that everything is valid....


Don't guess. Try to compile the code for yourself. A and B are legal syntax. C is illegal syntax, according to the simulators I tried (VCS and NC-Verilog), assuming you mean:

assign w2 = w[1:2];

The compile error message will be something like "Illegal part select range".

In the IEEE Standard for Verilog (Std 1364-2005), section 5.2.1 "Vector bit-select and part-select addressing", it is stated that the 1st number must address a more significant bit than the 2nd number.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜