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

H

hari

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
 
E

Egbert Molenkamp

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
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top