From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,2cbadcaf7f75436c X-Google-Attributes: gid1164f8,public From: gordon_b@apollo.HP.COM (Bruce Gordon) Subject: Re: 32-Bit floating point format Date: 1995/04/25 Message-ID: #1/1 X-Deja-AN: 101473442 sender: usenet@apollo.hp.com (Usenet News) references: <3niq25$pri@cd4680fs.rrze.uni-erlangen.de> organization: Hewlett-Packard Company, Chelmsford, MA keywords: floating point newsgroups: comp.sys.dec 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 \_| ------------------------------------------------------------------ | |