Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > declaring real numbers (2^15-1) and (-2^15) in vhdl

Reply
Thread Tools

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

 
 
hari
Guest
Posts: n/a
 
      04-22-2004
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
 
Reply With Quote
 
 
 
 
Egbert Molenkamp
Guest
Posts: n/a
 
      04-22-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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



 
Reply With Quote
 
 
 
 
Charles Bailey
Guest
Posts: n/a
 
      05-12-2004
constant i : integer:=2**15;
works also.

"Egbert Molenkamp" <(E-Mail Removed)> wrote in
message news:c67sd7$7gn$(E-Mail Removed)...
> 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)



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL switch in real numbers canadianJaouk VHDL 9 10-29-2006 09:38 PM
Detailsview shows real numbers with commata: Error converting data type nvarchar to real! Curious Trigger ASP .Net 2 09-09-2006 10:59 PM
real numbers or integer to binary in vhdl hari VHDL 2 04-23-2004 06:23 PM
declaring real values in vhdl hari VHDL 0 04-22-2004 02:33 AM
product of real and (integer)(after converted to real one) value - vhdl found fatal error senthil VHDL 5 01-24-2004 04:37 AM



Advertisments