From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 115914,eb58654c5683eea0 X-Google-Attributes: gid115914,public X-Google-Thread: 10cebf,eb58654c5683eea0 X-Google-Attributes: gid10cebf,public X-Google-Thread: 1164f8,eb58654c5683eea0 X-Google-Attributes: gid1164f8,public From: chiehcheng@geocities.com (Chieh Cheng) Subject: Re: VAX D-Float format Date: 1997/11/03 Message-ID: <345e03ce.617620030@serve.installshield.com>#1/1 X-Deja-AN: 287099468 References: <34575f82.182344367@serve.installshield.com> <63aalh$7rj@usenet.pa.dec.com> Newsgroups: comp.sys.dec,comp.sys.dec.micro,comp.arch.arithmetic 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/