Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

How to initialize a n dimension array in VHDL?

Status
Not open for further replies.

tapa

Super Member
Full Member level 2
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top