Floating point data formats John Wilson, 14-Dec-1995 387 data formats ---------------- bytes towards the right come at lower memory addresses +n-1 +0 (n=4, 8, or 10) +-------------+ |S| E | F | +-------------+ single: 32 bits total (1+8+23) double: 64 bits total (1+11+52) extended: 80 bits total (1+15+64) S sign bit: 0=+, 1=- (the only difference between + and - numbers) E exponent: E=0 means number=0; otherwise: single: 8 bits, excess-127 double: 11 bits, excess-1023 extended: 15 bits, excess-16383 F fraction: single: 23 bits plus implied leading "1." double: 52 bits plus implied leading "1." extended: 64 bits including required leading "1." FP11 data formats ----------------- words towards the left are at lower memory addresses, BUT within the words the bytes are in the usual right-to-left order +0 +n-1 (n=4 or 8) +-------------+ |S| E | F | +-------------+ single: 32 bits total (1+8+23) double: 64 bits total (1+8+55) S sign bit: 0=+, 1=- (the only difference between + and - numbers) E exponent: E=0 means number=0; otherwise 8 bits, excess-128 F fraction: single: 23 bits plus implied leading ".1" double: 55 bits plus implied leading ".1" The different radix point position and different exponent bias mean that FP11 numbers differ from 80x87 numbers by 2 in the exponent. To convert FP11 to 80x87, subtract 2 from the exponent; to convert 80x87 to FP11, add 2. PDP-10 data formats ------------------- words towards the left are at lower memory addresses -- right? +-------------+ |S| E | F | +-------------+ single: 36 bits total (1+8+27) double: 72 bits total (1+8+62, +1 for don't care in bit 0 of 2nd word) G format: 72 bits total (1+11+59, +1 for don't care in bit 0 of 2nd word) S sign bit (first word only, 0 in 2nd), two's complement E exponent: E=0 means number=0 (all other bits should be 0); otherwise 8 bits, excess-128, or 11 bits, excess-1024 for G format only F fraction: includes leading .1 unless number is 0.0 single: 27 bits including leading ".1" double: 62 bits including leading ".1" G format: 59 bits including leading ".1" Zero is represented as all zeros; zero fract/nonzero exp is specifically listed as bogus in the manual but it doesn't say anything about the other way around so that may be a legit number. Negatives are formed by taking the two's complement of the whole word; for double precision numbers, it's the two's complement of both words stuck together (except for bit 0 of the low order word, which is a don't care and is set to 0 in all results regardless of sign).