VHDL newbie

Jan 24, 2004 2 Replies

Hello,



I started now with VHDL....so maybe it´s a stupid Question.... but is there an easy way to increment a bitvector? For example something like this:



SIGNAL nano_bin : std_ulogic_vector(31 downto 0); IF....THEN nano_bin


you can add X"00000001" to the result.. or if you include the right file.... 'use ieee.std_logic_signed.all' (I think) then the conversion from 1 to X"00000001" is done automatically.

but you might want to try

library ieee; use ieee.std_logic_signed.all;

...

if (...) then if (nano_bit /= X"FFFFFFFF") then -- I think you can use (others =>

'1') instead of X"FFFFFFFF" here nano_bit

Use package numeric_std from IEEE and the type unsigned.

library ieee ; use ieee.numeric_std.all ;

. . .

SIGNAL nano_bin : unsigned(31 downto 0); IF....THEN nano_bin

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required