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.

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
 

nand_gates

Advanced Member level 3
Joined
Jul 19, 2004
Messages
892
Helped
175
Reputation
350
Reaction score
51
Trophy points
1,308
Activity points
6,838
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top