real to integer conversion

J

Jan

Guest
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
 
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.
 
Problem is solved...

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

Jan
 

Welcome to EDABoard.com

Sponsor

Back
Top