How to initialize a n dimension array in VHDL?

Status
Not open for further replies.

tapa

Super Member
Joined
Feb 17, 2002
Messages
133
Helped
8
Reputation
16
Reaction score
5
Trophy points
1,298
Location
spain
Activity points
1,096
simple VHDL question

Hello,

I am new on vhdl, and I have a simple question how to initialize a n dimension array, for example:

type matriz is array (1 to 4, 1 to 2) of integer;
signal una: matriz := (1,2,3,4;2,3,5,6); -- This is wrong, but how must be done?

Thank you for all

Tapa
 

How to initialize a n-dimensional array

You should treat your n-dimensional array as though it were an array of arrays, writing un array aggregate for each of leftmost index values first.

Example:

( 1 2 )
( 3 4 )
( 5 6 )
( 7 8 )

Code:

type matriz is array (1 to 4, 1 to 2) of integer;

signal una: matriz := ( (1,2), (3,4), (5,6), (7,8) );
 

Thak you very much!!!

More easy I think.


Tapa
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…