What's the meaning of wire [a:b] c
? Is it different from wire [b:a] c
? or verilog considers them equal? Is there any syntax to convert different arrays to each other?
Electrical – Confusion over wire\array notatin in verilog
verilog
Related Topic
- Electrical – system verilog 3d array ,cant insert data , what am I doing wrong
- Electronic – Declaring vector variable in the Verilog not starting with the MSB(e.g,. reg var[0][20])
- Electronic – the difference between scalar array and vector array
- Electronic – How to calculate constant values across several modules at compile time in Verilog
- Electronic – Apostrophe in Verilog array assignment
Best Answer
Verilog does not assume the Endianness of buses.
For example
In order to select the Most significant bit of C, you need to reference C[7]. While in order to to this for D, you need to reference D[0]
If you are trying to connect two busses together in Verilog they are connected MSB to MSB and LSB to LSB
So in the above example if we are trying to connect C and D together the LSB of C which is C[0] will be connected to the LSB of D which is D[7]
If C and D are not the same length
When you try to connect them together in Verilog they are connected starting from the LSB
In this case;
C : [7] [6] [5] [4] [3] [2] [1] [0]
...........................|....|....|....|
D : ....................[0] [1] [2] [3]
C[0] => D[3]
C[1] => D[2]
C[2] => D[1]
C[3] => D[0]
Well they are both multi-bit wires there is no difference between them
Just don't connect big-endian to little-endian unless you really mean to do this. Otherwise this might not give you the results you expect