Vector assignment in Verilog?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
verilog vector assignment

Hi all,

Is there Vector assignment in Verilog like C show below:
reg [31:0] vectors [2:0] = {5, 6, 7};
Or I have to assign vectors one by one?

Best regards,
Davy
 

verilog vector assignment module

At the best you can do this...
Code:
module vec_assign();
   reg [31:0] vectors [2:0];

initial 
  {vectors[2], vectors[1], vectors[0]} = {32'd5, 32'd6, 32'd7}; 

endmodule // vec_assign
 

    davyzhu

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…