how to convert real type to std_logic_vector ?

J

jing

i'm a beginner in vhdl. please tell me how to convert real type to
std_logic_vector ?
i wrote as:

process
variable input_line : line;
variable input_data : real;
begin
i <= 0;
xn_re <= "0000000000000000";

while not endfile(DATA_FILE) loop
readline(DATA_FILE, input_line);
read(input_line, input_data);

xn_re <= std_logic_vector(to_signed(integer(input_data),
16));-----here is the problem,but if i use xn_re <=
conv_std_logic_vector(input_data, 16); the input_data should not be a
real type....., then i don't know how to solve it.....

thank you in advace!
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top