declaring real numbers (2^15-1) and (-2^15) in vhdl

H

hari

Guest
hi
i would like to know how to declare the numbers in vhdl.the numbers
are
(2^15-1) and (-2^15).

when i declare it using the REAL modelsim returns a error saying it is
out of range.how to overcome it
thanks
hari
 
Here an example (no problem for Modelsim)
constant rl : real := 2.0**15;

(remember the right operand of the power function should be an integer; so
do not write 15.0. When you use the IEEE package math_real you have more
functions)

Egbert Molenkamp

"hari" <hari_pro@yahoo.com> wrote in message
news:a4a587f1.0404211903.7b799a11@posting.google.com...
hi
i would like to know how to declare the numbers in vhdl.the numbers
are
(2^15-1) and (-2^15).

when i declare it using the REAL modelsim returns a error saying it is
out of range.how to overcome it
thanks
hari
 
constant i : integer:=2**15;
works also.

"Egbert Molenkamp" <remove_funny_molenkam@cs.utwente.nl> wrote in
message news:c67sd7$7gn$1@ares.cs.utwente.nl...
Here an example (no problem for Modelsim)
constant rl : real := 2.0**15;

(remember the right operand of the power function should be an
integer; so
do not write 15.0. When you use the IEEE package math_real you have
more
functions)
 

Welcome to EDABoard.com

Sponsor

Back
Top