Apr 17, 2001 #1 ladybug Technical User Joined May 1, 2001 Messages 6 Location US hello everyone i haev this problem, i need to convert real signal to std_logic_vector, can i do that, and how? thanks for advance
hello everyone i haev this problem, i need to convert real signal to std_logic_vector, can i do that, and how? thanks for advance
Apr 19, 2001 #2 ahedin Programmer Joined Apr 20, 2001 Messages 16 Location US --doesn't deal with sign library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; entity conversion is end conversion; architecture test of conversion is signal one : std_logic_vector(3 downto 0); signal two : real; signal three : integer; begin main : process begin two <= -10.1; for i in 1 to 200 loop wait for 100 ns; two <= two + 0.1; end loop; wait; end process; three <= integer(two); one <= conv_std_logic_vector(three,4); end test; Upvote 0 Downvote
--doesn't deal with sign library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; entity conversion is end conversion; architecture test of conversion is signal one : std_logic_vector(3 downto 0); signal two : real; signal three : integer; begin main : process begin two <= -10.1; for i in 1 to 200 loop wait for 100 ns; two <= two + 0.1; end loop; wait; end process; three <= integer(two); one <= conv_std_logic_vector(three,4); end test;