Re: Confused about Floating Point format
From: Scott Moore (spamtrap_at_crayne.org)
Date: 09/08/04
- Next message: KVP: "Re: piplining principles (and confusion!)"
- Previous message: Clax86 : "Having trouble posting?"
- In reply to: encryption_x: "Confused about Floating Point format"
- Next in thread: Robert Wessel: "Re: Confused about Floating Point format"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 8 Sep 2004 07:19:07 +0000 (UTC)
encryption_x wrote:
> The "Art of Assembly" book (sec. 4.2) describes that binary strings
> that represent floating point numbers practically always have a
> mantisa that has a H.O. bit of "1" and thus normalized, but then it
> goes on to mention that if it isnt normalized then you should
> left-shift the mantisa. This doesn't compute to me, can anyone help?
> 'Preciate it.
>
Normalization means to move the mantissa until it is "correct", by
shifting it and changing the exponent to reflect the shift. For most
implementations, that means getting rid of the leading zeros. It also
preserves accuracy. If you have a 64 bit accumulator, and you are going
to reduce down to a 32 bit format, if you don't get rid of the leading
zeros, you will lose digits off the right end.
Now, long ago, someone with excess cleverness noticed that if you
normalize numbers, you are either always going to have the leftmost
digit (bit) a '1', or else the entire mantissa is going to be zero.
So said clever programmer decided that if you shift off that top bit,
you don't really need it ! If the mantissa is all zeros, there was
no leading bit, otherwise, you can always assume the missing bit
was a '1'. Thus, the clever programmer saved a single bit in the
format, and probally retired rich somewhere.
-- Samiam is Scott A. Moore Personal web site: http:/www.moorecad.com/scott My electronics engineering consulting site: http://www.moorecad.com ISO 7185 Standard Pascal web site: http://www.moorecad.com/standardpascal Classic Basic Games web site: http://www.moorecad.com/classicbasic The IP Pascal web site, a high performance, highly portable ISO 7185 Pascal compiler system: http://www.moorecad.com/ippas Being right is more powerfull than large corporations or governments. The right argument may not be pervasive, but the facts eventually are.
- Next message: KVP: "Re: piplining principles (and confusion!)"
- Previous message: Clax86 : "Having trouble posting?"
- In reply to: encryption_x: "Confused about Floating Point format"
- Next in thread: Robert Wessel: "Re: Confused about Floating Point format"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|