Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: chiehcheng@geocities.com (Chieh Cheng)
Subject: Re: VAX D-Float format
Date: 1997/11/03	[thread overview]
Message-ID: <345e03ce.617620030@serve.installshield.com> (raw)
In-Reply-To: 63aalh$7rj@usenet.pa.dec.com


On 30 Oct 1997 15:55:29 GMT, lionel@mail.dec.com (Steve Lionel) wrote:
>  Type    Exponent bits    Exponent bias    Fraction bits (including hidden)
>  ==========================================================================
>   F           8                128               24
>   D           8                128               56
>   G          11               1024               53
>   H          15              16384              113
>
>Example:  +1.5 in F float is hex 000040C0 (fraction of .11[base 2], biased
>exponent of 129)

Is that conversion correct? I can't seem to figure out the conversion.
I thought the bias is 128, how come it is 129 in the example.

I tried the following conversions, but none of them give the correct
answer. What am I doing wrong?

000040C0 = 0000 0000 0000 0000 0100 0000 1100 0000

S = 0
F = 100 0000 = 64
E = 100 0000 1 = 129

x = (-1)^S * 1.F * 2^(E - 128):
x = (-1)^0 * 1.64 * 2^(129 -128)
x = 1 * 1.64 * 2^1
x = 1.64 * 2
x = 3.28

x = (-1)^S * 1.F * 2^(E - 128):
x = (-1)^0 * 0.64 * 2^(129 -128)
x = 1 * 0.64 * 2^1
x = 0.64 * 2
x = 1.28

x = (-1)^S * 1.F * 2^(E - 129)
x = (-1)^0 * 1.64 * 2^(129 -129)
x = 1 * 1.64 * 1
x = 1.64

x = (-1)^S * 0.F * 2^(E - 129)
x = (-1)^0 * 0.64 * 2^(129 -129)
x = 1 * 0.64 * 1
x = 0.64

CC
--
http://www.geocities.com/Area51/8145/



  parent reply	other threads:[~1997-11-03  5:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-29  5:00 VAX D-Float format Chieh Cheng
1997-10-30  5:00 ` Steve Lionel
1997-10-31  5:00   ` Dik T. Winter
1997-10-31  5:00     ` John Wilson
1997-11-03  5:00       ` Dik T. Winter
1997-11-03  5:00   ` Chieh Cheng [this message]
1997-11-05  5:00     ` Steve Lionel
1997-11-06  5:00       ` Philippe Pouliquen
1997-11-10  5:00         ` John Laird
1997-10-30  5:00 ` Steve Atkins
1997-10-31  5:00   ` Pedasmith
1997-10-30  5:00 ` Hoff Hoffman
1997-10-30  5:00 ` John Laird
1997-10-30  5:00 ` Gregg E Economou
1997-10-31  5:00   ` Chieh Cheng
1997-11-05  5:00     ` WTB: Iomega Zip Drive Jerome Fine
     [not found]     ` <199711051454.JAA02820@dbit.dbit.com>
1997-11-05  5:00       ` Jerome Fine
1997-11-05  5:00 ` VAX D-Float format John Foust
read-only archive

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