real to integer conversion

J

Jan

Hi,

I have real variable r for <-1.0 to 1.0> and I need N bit 2'complent representation.

How could I convert this in VHDL?
How can I muliplicate variables?
r1 := CONSTANT*r doesn't work

I need somethig as
r_fixed_int <= std_logic_vector(to_signed(integer(r1),16));

Thanks

Jan
 
N

Neo

You will have to write your own conversion functions for that. But
checkout the vhdl 200x fixed and floating point packages if they can be
of any help.
 
J

Jan

Problem is solved...

the CONSTANT have to be real, it means 65535.0 for example.

Jan
 

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,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top