Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

How to initialize a n dimension array in VHDL?

Status
Not open for further replies.

tapa

Super Member
Joined
Feb 17, 2002
Messages
134
Helped
8
Reputation
16
Reaction score
5
Trophy points
1,298
Location
spain
Activity points
1,094
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
 

rol73

Junior Member level 3
Joined
Jan 15, 2003
Messages
28
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
260
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) );
 

tapa

Super Member
Joined
Feb 17, 2002
Messages
134
Helped
8
Reputation
16
Reaction score
5
Trophy points
1,298
Location
spain
Activity points
1,094
Thak you very much!!!

More easy I think.


Tapa
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top