Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
type UNSIGNED is array (NATURAL range <>) of STD_LOGIC;Is there a width limit for the width of an "unsigned" vector type in VHDL ?
Is there a width limit for the width of an "unsigned" vector type in VHDL ?
BTW ,
If you set it to single bit length ,
Will it have all the properties of an "std logic"?
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 signal xyz_vec: std_logic_vector(0 downto 0); signal xyz_bit: std_logic; begin xyz_vec <= xyz_bit; -- This is an error becuase the left hand side is a different type than the right xyz_vec(0) <= xyz_bit; -- OK xyz_vec <= (others => xyz_bit); -- OK xyz_vec(0 downto 0) <= '1'; -- This is an error becuase the left hand side is a different type than the right xyz_vec(0 downto 0) <= "1"; -- OK if (xyz_vec = '1') then -- This is an error also, comparing different types if (xyz_vec = "1") then -- OK
I think, you can go upto a maximum of 2³²
That is the range.....
I wonder if numbers above available logic cell count are of practical interest
The limit was established back when VHDL was first defined and standardized in 1987. Why the language hasn't evolved to include larger integers I don't know (but it has been asked many times in several forums). But a more practical question might be, what are you planning on doing that can't be done with signed/unsigned which have the much larger numerical limit of 2^( 2^31 - 1 )? The initial drawbacks I see are:No...just for general knowledge.
The limit for integers ( 2^31 - 1 ), is however of a practical interest.
I don't see any good reasons for inffering such a limit - especially with 64 bit systems becoming more common.
But a more practical question might be, what are you planning on doing that can't be done with signed/unsigned
Why integers for counters?I have a rule - to use only integers for counters.
Somtimes 2^32 - just isn't enough.