Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: fairfield@sldb4.slac.stanford.edu
Subject: Re: HELP: PDP 11/24 floating point format ?
Date: 1996/06/11	[thread overview]
Message-ID: <1996Jun10.183011.1@sldb4.slac.stanford.edu> (raw)
In-Reply-To: 4pi94a$ad4@sanjuan.islandnet.com


In article <4pi94a$ad4@sanjuan.islandnet.com>, 
    		Rene Chave <chave@islandnet.com> writes:
> 
> I am looking for the floating point format on PDP 11/24. We have some old
> data in this format that I need to translate but I do not have the PDP
> 11/24 hardware manual to look up the format. If anyone can help I would
> very much appreciate it.

        Going out on a limb  here,  especially given the large number of
    "11"  afficionados out there, but isn't the VAX F_float the same  as
    the PDP-11 representation because of the 11/780 compatibility  mode?
    That's what I'd always been told.  The VAX representation looks like
    this:

===============================================================================
C.5.1 REAL*4 (F_floating)

    "REAL*(4 (F_floating) data is four contiguous bytes starting on
    an arbitrary byte boundary.  Bits are labeled from the right, 0
    through 31.

                15 14                 7 6         0
                +-+--------------------+----------+
                |S|                    |          |
                |I|  E X P O N E N T   | FRACTION |   :A
                |G|                    |          |
                |N|                    |          |
                +-+--------------------+----------+
                |                                 |
                |         F R A C T  I O N        |   :A+2
                |                                 |
                |                                 |
                +---------------------------------+
                31                               16

    SIGN = 0(+), 1(-)


    The form of REAL*4 (F_floating) data is sign magnitude, with bit
    15 the sign bit, bits 14:7 an excess 128 binary exponent, and
    bits 6:0 and 31:16 a normalized 24-bit fraction with the
    redundant most significant fraction bit not represented. The
    value of F_floating data is in the approximate range: 0.29*10**-38
    through 1.7*10**38.  The precision is approximately one part in 2**23,
    that is, typically, seven decimal digits."
===============================================================================

        Note that the  exponent  is  biased  by  128  (not 127 like IEEE
    Single)  and that the _normalization_ is such that the mantissa,  M,
    is in the range 1.0 <= M < 2.0 (not like IEEE which is 0.5  <=  M  <
    1.0).   The result is that if you rearrange the two 16-bits words so
    that the least  significant  mantissa  word  (which  is  at a higher
    address) is in the least significant 16-bits of a 32-bit float/REAL,
    and  the  word containing the sign, exponent, and  most  significant
    mantissa (at the lower address) is in the most  significant  16-bits
    of  the  32-bit  float/REAL, the format is identical to IEEE Single.
    However, the _value_ needs to be  reduced by a multiplicative factor
    of _4_ if interpreted as IEEE due to the difference in normalization
    and exponent bias.

        Be aware that  11's  are  little-endian  machines,  so if you're
    reading this data on a big-endian machine, you'll need to swap bytes
    before rearranging words.

        -Ken
-- 
 Kenneth H. Fairfield       |  Internet: Fairfield@Slac.Stanford.Edu
 SLAC, P.O.Box 4349, MS 46  |  DECnet:   45537::FAIRFIELD (45537=SLACVX)
 Stanford, CA   94309       |  Voice:    415-926-2924    FAX: 415-926-3515
 -------------------------------------------------------------------------
 These opinions are mine, not SLAC's, Stanford's, nor the DOE's...



      reply	other threads:[~1996-06-11  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-10  4:00 HELP: PDP 11/24 floating point format ? Rene Chave
1996-06-11  4:00 ` fairfield [this message]
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