View Single Post
  #4 (permalink)  
Old 05-18-2006, 03:03 PM
visiblepulse
Guest
 
Posts: n/a
Default Re: how i declare array for input port

input [15:0] in;

wire [1:0] in_A[0:7];
assign in_A[0] = in[1:0];
assign in_A[1] = in[3:2];
assign in_A[2] = in[5:4];
assign in_A[3] = in[7:6];
assign in_A[4] = in[9:8];
assign in_A[5] = in[11:10];
assign in_A[6] = in[13:12];
assign in_A[7] = in[15:14];

to access...
foo[1:0] <= in_A[4];
bar[1:0] <= in_A[1];

Reply With Quote