error in the following vhdl prog????

Status
Not open for further replies.

velu.plg

Member level 5
Joined
Jul 30, 2013
Messages
93
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
chennai
Visit site
Activity points
1,974
k thanks ....

i do what u say...

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_bit.all;
use ieee.numeric_std;
--use ieee.std_logic_arith.all;

entity adc is
port(clk:in std_logic;a:in std_logic_vector(15 downto 0);voutut real);
end adc;

architecture a_body of adc is

begin

process(clk)
begin
if(clk='1')then
Vout <= (3.3 * ((real((to_integer(unsigned(a)))) / 65535.0)));
end if;
end process;

end a_body;

but still i have one problem......

** Error: D:/project files/wsn and prng/foldedtree.vhd(19): Illegal type conversion from ieee.std_logic_1164.std_logic_vector to ieee.numeric_bit.unsigned (array element type difference).
** Error: D:/project files/wsn and prng/foldedtree.vhd(23): VHDL Compiler exiting
 


put in comment :

--use ieee.numeric_bit.all;
 

Looks like you are choosing libaries by try and error.

After commenting ieee.numeric_bit there are still incompatible libraries. You should use true IEEE libraries only:
Code:
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

The code can be only used for simulation purposes, e.g. a hardware model in a testbench, because the real type isn't synthesizable.

Did you mean to make a latch here
Code:
if(clk='1')then
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…