CONV_INTEGER problems

G

Giox

Hello everybody, I have the followin code:

LIBRARY ieee;

USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all

......SNIP.....
signal high_registered : std_logic_vector(1 downto 0);
signal high_current : std_logic_vector(1 downto 0);

......SNIP.....

busy_condition <= '1' WHEN CONV_INTEGER(high_registered) >
CONV_INTEGER(high_current)
ELSE '0';
......SNIP.....

During simulation:
high_registered "10";
high_current "00";

The resulting busy_condition is Z.... what's wrong?
Any help will be appreciated
Gio
 
A

Arnaud

I suggest that you simply used a conversion to unsigned instead of the
non standard function conv_integer:

busy_condition <= '1' WHEN unsigned(high_registered) >
unsigned(high_current)
ELSE '0';

I also suggest that you used library ieee.numeric_std.all; instead of
ieee.std_logic_arith.all;

Regards,

Arnaud
 
A

anupam

hi,
The library arith has both signed and unsigned defined in it so while
converting to interger ,you need to specify that your std_logic is
signed or unsigned ....

Just include "use ieee.std_logic_unsigned.all" or "use
ieee.std_signed.all" to make it happen

regards,
Anupam Jain
 

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