D
Deepu
Guest
Hi All,
How can i access a bit in a dynamic array which is 16bit wide and
500000 depth
I tried as below:
reg [15:0] dynamic_array[];
// set the size
dynamic_array = new[500000];
// accessing a bit
num = 100000;
case(bit)
0: begin set = 1; dynamic_array[num][0] = 1; end
1: begin set = 1; dynamic_array[num][1] = 1; end
2: begin set = 1; dynamic_array[num][2] = 1; end
and so on till 15
14: begin set = 1; dynamic_array[num][3] = 1; end
15: begin set = 1; dynamic_array[num][4] = 1; end
endcase
But when i try to display it always gives 'x'. Is this a wrong way of
using? Is there any other better method if i have 'num' which is from
0 to 500000 and each num can have 16 bit value?
Thanks for the help!
How can i access a bit in a dynamic array which is 16bit wide and
500000 depth
I tried as below:
reg [15:0] dynamic_array[];
// set the size
dynamic_array = new[500000];
// accessing a bit
num = 100000;
case(bit)
0: begin set = 1; dynamic_array[num][0] = 1; end
1: begin set = 1; dynamic_array[num][1] = 1; end
2: begin set = 1; dynamic_array[num][2] = 1; end
and so on till 15
14: begin set = 1; dynamic_array[num][3] = 1; end
15: begin set = 1; dynamic_array[num][4] = 1; end
endcase
But when i try to display it always gives 'x'. Is this a wrong way of
using? Is there any other better method if i have 'num' which is from
0 to 500000 and each num can have 16 bit value?
Thanks for the help!