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.

type declarations in vhdl

Status
Not open for further replies.

Bustigo

Member level 2
Joined
May 7, 2011
Messages
53
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,588
How differ in use , in synthesize in debugging or in anything

type matrix IS array (0 to 3) of std_logic_vector (7 downto 0);

&

type row is array (7 downto 0) of std_logic;
type matrix is array (0 to 3) of row;
 

The big problem is everything that works with std_logic_vector now will not work with row. Difining your own array type of std_logic is generally a bad idea. But from a logic point of view there is no difference.
 

but thats the point. Std_logic_vector already exists, so why re-declare it. It makes your new type incompatible with other std_logic_vectors.
 
vhdl is a strongly-typed language and the point of that is to reduce errors. In this case, it stops you connecting your signals of different types together.

There's nothing bad about using your own type of std logic array. It''s good if you want an error indicated if you accidentally connect it to a std logic vector. That's the protection what strong typing gives you.

But if you want a design you can connect to other blocks and easy for others to work on, stay std_logic_vector.
 
You're welcome, glad to help :)
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top