what's the max value for a real ?? 
Author Message
 what's the max value for a real ??

I am writing a filter in Verilog with real variables.

In Verilog, aren't real variables 64 bits, giving them
a range of like +/- 1.0E32 or something ??

A few of my filter coefficients have values like 1.8E+22.

Thanks very much.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sat, 01 Mar 2003 05:20:28 GMT  
 what's the max value for a real ??

Quote:

> I am writing a filter in Verilog with real variables.

> In Verilog, aren't real variables 64 bits, giving them
> a range of like +/- 1.0E32 or something ??

> A few of my filter coefficients have values like 1.8E+22.

> Thanks very much.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Real numbers in Verilog are exactly the IEEE 754 (I think) standard,
and hence are the same things you get in fortran or C for double
precision or double, respectively; and hence your range is from
1.7976E+308 to 2.2250E-308, assuming you stick with normaized numbers.

Check out various web references, by typing "IEEE 754 real numbers"
into your favorite search engine; I got interesting ones, including
http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html

--

  _    //     Sr VP Technology             650-934-6888
   \  //      Verisity Design              650-934-6801 FAX
    \//       <http://www.verisity.com>    408-202-1137 Cell
--------------------------------------------------------------
Get my verilog emacs mode from        <http://www.verilog.com>



Wed, 02 Apr 2003 09:17:38 GMT  
 what's the max value for a real ??


Quote:

>> I am writing a filter in Verilog with real variables.

>> In Verilog, aren't real variables 64 bits, giving them
>> a range of like +/- 1.0E32 or something ??

>> A few of my filter coefficients have values like 1.8E+22.

>> Thanks very much.

>> Sent via Deja.com http://www.deja.com/
>> Before you buy.

>Real numbers in Verilog are exactly the IEEE 754 (I think) standard,
>and hence are the same things you get in FORTRAN or C for double
>precision or double, respectively; and hence your range is from
>1.7976E+308 to 2.2250E-308, assuming you stick with normaized numbers.

Correct me if I'm wrong, but I don't think the LRM has anything to say
about real numbers. The closest it gets is specifying that arithmetic
operators should treat reals as "signed, floating point", which
doesn't mean much. I can't see anywhere where the minimum range of a
real is given. The bibliography references 754, but I don't know why.

In practice, the compiler vendor will code up reals in the format used
by the processor, which will be IEEE754 in all the cases I know of, so
you can probably assume you've got single-precision 754 if nothing
else.

Evan



Sun, 06 Apr 2003 03:00:00 GMT  
 what's the max value for a real ??


Quote:



>>> I am writing a filter in Verilog with real variables.

>>> In Verilog, aren't real variables 64 bits, giving them
>>> a range of like +/- 1.0E32 or something ??

>>> A few of my filter coefficients have values like 1.8E+22.

>>> Thanks very much.

>>> Sent via Deja.com http://www.deja.com/
>>> Before you buy.

>>Real numbers in Verilog are exactly the IEEE 754 (I think) standard,
>>and hence are the same things you get in FORTRAN or C for double
>>precision or double, respectively; and hence your range is from
>>1.7976E+308 to 2.2250E-308, assuming you stick with normaized numbers.

>Correct me if I'm wrong, but I don't think the LRM has anything to say
>about real numbers.

I stand corrected - I had an email (which doesn't seem to have been
copied here) pointing out that the $realtobits and $bitstoreal
conversion functions, on p204, do expect and produce 64-bit IEEE754.

Evan



Mon, 07 Apr 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Min and Max values?

2. secect max(value) from rbdatabase

3. Finding max and min values in a queue

4. How to get Max value from Queue

5. Max value dilemma

6. Max-PlusII problem: Different value causing output error.

7. question to max value sintax

8. Max value for bytes in mmx register

9. ==-- min/max values --== HELP PLEASE!!!!

10. finding max value in a vektor

11. Max value possible in COMP field ??

12. max integer value

 

 
Powered by phpBB® Forum Software