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 2D array in VHDL?

Status
Not open for further replies.

alexz

Full Member level 5
Joined
Nov 19, 2004
Messages
283
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Location
UK
Activity points
2,246
vhdl initialize array

How to Initialize 2D array in VHDL?


Code:
subtype	latchType   is std_logic_vector(15 downto 0) ;
type 	latchesType  is array (9 downto 0) of latchType ;
signal	mylatches	:	latchesType := ((others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'));

Is there any more clever form of doing this?
 

vhdl array initialization

alexz said:
How to Initialize 2D array in VHDL?


Code:
subtype	latchType   is std_logic_vector(15 downto 0) ;
type 	latchesType  is array (9 downto 0) of latchType ;
signal	mylatches	:	latchesType := ((others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'),(others=>'0'));

Is there any more clever form of doing this?

Try this:

Code:
signal	mylatches	:	latchesType := ((others=> (others=>'0')));

Can't get smaller than that :)

Ajeetha. CVC
www.noveldv.com
 
  • Like
Reactions: verylsi

    verylsi

    Points: 2
    Helpful Answer Positive Rating
initialize array vhdl

Excellent !
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top