Array initialisation - general questions

Joined
Feb 10, 2009
Messages
2
Reaction score
0
Hi,

I was wondering if anyone could help as i'm new to VHDL.

I would like to create an array of size (256 * 24)
That is 256 row elements, with each element 24 bits wide.

0. [<-24 bits ->]
1. [<-24 bits ->]
.....
255. [<-24 bits ->]

Is an array of this size possible?

I'm assuming this syntax would create the array called 'x'???:

TYPE array1 IS ARRAY (0 TO 255) OF STD_LOGIC_VECTOR (23 DOWNTO 0);
SIGNAL x: array1;

Now how would I go about assigning 24 bit values to individual elements?
Is there a function I could use? Or would I have to declare each elements' value explicitly - like x(0) = "111111111111111111111111" ?

Also, how could I assign a 24 bit element of the array to a vector?

Would this do it?:

signal y: std_logic_vector (23 DOWNTO 0);
y <= x(0);

Regards,

AM
 

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
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top