Define Unsigned Type

A

a_Conan

Hi,
Can I define Unsigned Type in vhdl as:

package MyTypes is
Type UNS16 is array(15 downto 0) of unsigned;
end MyTypes;

Thanks
 
N

Nicolas Matringe

Can I define Unsigned Type in vhdl as:
package MyTypes is
Type UNS16 is array(15 downto 0) of unsigned;
end MyTypes;

No, you must use a fixed length unsigned.

Nicolas
 
A

a_Conan

Thank you Nicolas, but what do you meen by I must use a fixed length
unsigned?
Can you give example?

Thank you
 
N

Nicolas Matringe

You have to constrain your unsigned:
type uns16 is array(15 downto 0) of unsigned(7 downto 0);

Unless your unsigned type is not the one defined in numeric_std...

You can also define a 2D array of std_logic elements if you want your
type to be scalable but it has many drawbacks.

Nicolas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top