Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* 32-Bit floating point format
@ 1995-04-25  4:00 Thomas Schueller
  1995-04-25  4:00 ` Bruce Gordon
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Schueller @ 1995-04-25  4:00 UTC (permalink / raw)


Hello !

Does somebody out there know how the 32-bit floating point used by a Vax
looks like ?
I need this information in order to convert some floating-numbers into
another number-format.

Thanks in advance,

Thomas Schueller


--
-----------------------------------------------------------------------------
Thomas Schueller, System administrator =-==-= University of Erlangen, Germany
Internet: tsschuel@ipb.uni-erlangen.de             Phone: +49 9131 852491
=============================================================================



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 32-Bit floating point format
  1995-04-25  4:00 32-Bit floating point format Thomas Schueller
@ 1995-04-25  4:00 ` Bruce Gordon
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Gordon @ 1995-04-25  4:00 UTC (permalink / raw)


In article <3niq25$pri@cd4680fs.rrze.uni-erlangen.de>, tsschuel@informatik.uni-erlangen.de (Thomas Schueller) writes:
|> Hello !
|> 
|> Does somebody out there know how the 32-bit floating point used by a Vax
|> looks like ?
|> I need this information in order to convert some floating-numbers into
|> another number-format.
|> 
|> Thanks in advance,
|> 
|> Thomas Schueller
|> 
  3                       1
  1                       6
 +-------------------------+
 | Fraction                |
 +-------------------------+
   1  1               
   5  4        7 6        0 
 +---+----------+----------+
 | S | Exponent | Fraction |
 +---+----------+----------+

bit 31 is the sign bit
bits 23 - 30 are the exponent in excess 128 format (i.e. an exponent
of 0 is 2^-128, an exponent of 128 is 2^0, and an exponent of 255 is
2^127)
the rest of the bits are the frational part and are always assumed to
begin with 0.1.  This bit is known as the phantom bit, it is always
set but you can't see it.

Examples:
                              Sign  Exponent  Fration
	 5.0 is 000041A0 hex    0   10000011  [.1]01000000000000000000000
	 2.0 is 00004100 hex    0   10000010  [.1]00000000000000000000000
	 1.0 is 00004080 hex    0   10000001  [.1]00000000000000000000000
	 0.5 is 00004000 hex    0   10000000  [.1]00000000000000000000000
	-1.0 is 0000C080 hex    1   10000001  [.1]00000000000000000000000

Note: I put in the leading bit but the vax does not.  If you count all
the bits, including the phantom bit, you'll see there are actually 33
bits.

This information can be found in the VAX Architecture Reference
Manual.

Bruce

-- 
  /
 / -----------------------------------------------------------------------
 | Bruce F. Gordon                       INTERNET:  gordon_b@apollo.hp.com
  \ Technical Consultant
 O \__ Hewlett Packard                   VOICE:     (508) 436-4621
  \/  | 300 Apollo Drive                 FAX:       (508) 436-5142
  u-  | Chelmsford, MA 01824
    \_| ------------------------------------------------------------------
      |
       |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-04-25  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-04-25  4:00 32-Bit floating point format Thomas Schueller
1995-04-25  4:00 ` Bruce Gordon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox