From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,f7957712d6a203d4 X-Google-Attributes: gid1164f8,public From: fairfield@sldb4.slac.stanford.edu Subject: Re: HELP: PDP 11/24 floating point format ? Date: 1996/06/11 Message-ID: <1996Jun10.183011.1@sldb4.slac.stanford.edu>#1/1 X-Deja-AN: 159535635 sender: news@unixhub.SLAC.Stanford.EDU references: <4pi94a$ad4@sanjuan.islandnet.com> organization: Stanford Linear Accelerator Center newsgroups: comp.sys.dec In article <4pi94a$ad4@sanjuan.islandnet.com>, Rene Chave 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...