开发者

wire equation in verilog [closed]

开发者 https://www.devze.com 2022-12-17 19:18 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
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

精彩评论

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

关注公众号