Simulation problem using CONV_INTEGER

Feb 11, 2006 2 Replies

I have the following code:



signal busy_condition : std_logic; signal high_registered : std_logic_vector(1 downto 0); signal high_current : std_logic_vector(1 downto 0);


busy_condition CONV_INTEGER(high_registered)) ELSE '0';



During simulation high_registered become "10" and high_current = "00". However busy_condition is high impedence. Is there someone that can explain me what is my error? Thanks a lo Gio



"Giox" a écrit dans le message de news:

Which library do you use? Signed or unsigned? If you use ieee.std_logic_signed.all, the CONV_INTEGER ("10") is a negative number.

Change your library or add a sign bit like this:

busy_condition CONV_INTEGER('0'&high_registered)) ELSE '0';

Dan.

The basic problem is that you are using non-standard libraries to make your code ambiguous. Is "10" a positive number or a negative one?

Using "ieee.numeric_std" you would make the signals in question either signed or unsigned, according to what your code is meant to do, and simplify the expression to

busy_condition high_registered ELSE '0';

- Brian

Join the Discussion

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

Didn't find your answer?

Ask the community — no account required