-1

I am using Indexed Vector Part Select in a Verilog test case and i am very confused with this.

when we have described

input [415:0] PQR_A;
output [63:0] ABC;

then is it valid

assign PLA=PQR_A[44*8 +: 64]

because i think in this way the bits will be from 352 to (352+ 64) i.e. 416, which is not valid

I know this is quite silly to ask that what is [0:7], it means 0,1,2,3,4,5,6,7 i.e. 8 bits.

shailendra
  • 591
  • 5
  • 16
  • 29

3 Answers3

2

Indexed vector select w[x +: y] has width y. The equivalent regular select is w[x : (x+y-1)] .

shuckc
  • 3,012
  • 14
  • 19
1

one line explanation of that is :

w[x +: y] == w[(x+y-1) : x ]

robert
  • 11
  • 1
0

I think it should be like this: w[x +: y] == w[(x+y-1) : x ]

For example:

a_vect[ 0 +: 8] == a_vect[ 7 : 0]

Ricardo
  • 6,134
  • 19
  • 52
  • 85