How can I access a 2d array completely.

B

bharat1986

I have used a 2d array

type CRC is array(3 downto 0) of std_logic_vector(7 downto 0);
signal Frame_CRC : CRC;

now I want to access all the 32 bits in the Frame_CRC...

to assign a 32bit signal to that Frame_CRC..

How can I do it???
 
Joined
Jan 29, 2009
Messages
152
Reaction score
0
You could always make it a loop:
Code:
for i in CRC'range loop
  Frame_CRC(i) <= value(8 * (i + 1) - 1 downto 8 * i);
end loop;

or a generate statement:
Code:
gen: for i in CRC'range generate
  Frame_CRC(i) <= value(8 * (i + 1) - 1 downto 8 * i);
end generate gen;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top