Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Verilog - array and vector access

Status
Not open for further replies.

pbernardi

Full Member level 3
Joined
Nov 21, 2013
Messages
151
Helped
30
Reputation
60
Reaction score
31
Trophy points
1,308
Activity points
2,927
Hello all,

I would like to access part of a vector, in a wire that is also an array. Is it possible somehow?

For example, the example below is not valid (I just make the code now by head, so sorry for any possible inconsistence):

Code:
wire [15:0] a[2:0];

genvar i;

for (i=0;i<8;i=i+1)
always @*
begin
  case (a[15:14][i])
  ...
  ...
  endcase
end

while this is valid

Code:
wire [15:0] a;

always @*
begin
  case (a[15:14])
  ...
  ...
  endcase
end

is there a way to address this? I know that I cannot access a slice of an array, but I want to access a slice of a vector that is also an array.
 

The slice of the vector is last.
Code:
case (a[i][15:14])
 
Great, just a syntax problem. Thank you.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top