IBM Floating Point Architecture

IBM System/360 computers, and subsequent machines based on that architecture (mainframes), support a hexadecimal floating-point format.[1][2]

In comparison to IEEE 754 floating-point, the IBM floating point format has a longer significand, and a shorter exponent.

Contents

Single-precision 32 bit

A single-precision binary floating-point number is stored in a 32 bit word:

   1     7               24              width in bits
  +-+-------+------------------------+
  |S|  Exp  |   Fraction             |
  +-+-------+------------------------+
  31 30   24 23                     0    bit index (0 on right)
     bias +64

Note that in this format the initial bit is not suppressed, and the radix point is set to the left of the mantissa in increments of 4 bits.

The bias is 64 because the exponent is to the power of 16. Even though the base is 16, the exponent in this form is slightly smaller than the equivalent in IEEE 754.

An Example

Let us decode the number −118.625 using the IBM floating point system.

We need to get the sign, the exponent and the fraction.

Because it is a negative number, the sign is "1". Let's find the others.

First, we write the number (without the sign) using binary notation. Look at binary numeral system to see how to do it. The result is 1110110.101

Now, let's move the radix point left, moving four bits at a time (because IBM exponents are written to the power of 16, not 2 as in IEEE): 1110110.101=.01110110101·162

The fraction is the part at the right of the radix point, filled with 0 on the right until we get all 24 bits. That is 011101101010000000000000.

The exponent is 2, but we need to convert it to binary and bias it (so the most negative exponent is 0, and all exponents are non-negative binary numbers). For the system/360 format, the bias is 64 and so 2 + 64 = 66. In binary, this is written as 1000010.

Putting them all together:

   1     7               24              width in bits
  +-+-------+------------------------+
  |S|  Exp  |  Fraction              |
  |1|1000010|011101101010000000000000|
  +-+-------+------------------------+
  31 30   24 23                     0    bit index (0 on right)
     bias +64

Quiet NAN (not a number)

   1     7               24              width in bits
  +-+-------+------------------------+
  |S|  Exp  |  Fraction              |
  |0|1111111|100000000000000000000000|
  +-+-------+------------------------+
  31 30   24 23                     0    bit index (0 on right)
     bias +64

Signaling NAN (not a number)

   1     7               24              width in bits
  +-+-------+------------------------+
  |S|  Exp  |  Fraction              |
  |0|1111111|011111111111111111111111|
  +-+-------+------------------------+
  31 30   24 23                     0    bit index (0 on right)
     bias +64

INFINITY

   1     7               24              width in bits
  +-+-------+------------------------+
  |S|  Exp  |  Fraction              |
  |0|1111111|000000000000000000000000|
  +-+-------+------------------------+
  31 30   24 23                     0    bit index (0 on right)
     bias +64

Double-precision 64 bit

Double-precision is the same except that the mantissa (fraction) field is wider and the double-precision number is stored in a double word (8 bytes):

  1     7                               56 bits
 +-+-----------+----------------------------------------------------+
 |S|  Exp      |  Fraction                                          |
 +-+-----------+----------------------------------------------------+
 63 62       56 55                                                 0

Extended-precision 128 bit

Extended-precision (quadruple-precision) was added to the System/370 series and was available on some S/360 models (S/360-85, -195, and others by special request or simulated by OS software). The extended-precision mantissa (fraction) field is wider, and the extended-precision number is stored as two double words (16 bytes):

 High-Order Part:
  1     7                               56 bits
 +-+-----------+----------------------------------------------------+
 |S|  Exp      |  Fraction (leftmost 14 of 28 digits)               |
 +-+-----------+----------------------------------------------------+
127 126     120 119                                               64

 Low-Order Part:
        8                               56 bits
 +-------------+----------------------------------------------------+
 |   Unused    |  Fraction (rightmost 14 of 28 digits)              |
 +-------------+----------------------------------------------------+
  63         56 55                                                 0

IEEE 754 on IBM mainframes

Starting with the S/390 G5 in 1998,[3] IBM mainframes have also included IEEE binary floating-point units which conform to the IEEE 754 Standard for Floating-Point Arithmetic. IEEE decimal floating-point was added to IBM System z9 GA2[4] in 2007 using millicode[5] and in 2008 to the IBM System z10 in hardware.[6]

Modern IBM mainframes support three floating-point radices with 3 hexadecimal (HFP) formats, 3 binary (BFP) formats, and 3 decimal (DFP) formats. There are two floating-point units per core; one supporting HFP and BFP, and one supporting DFP; note there is one register file, FPRs, which holds all 3 formats.

Special uses

The IBM floating-point format is used in:

Systems which use Base-16 Excess-64 Floating Point format

See also

References

  1. ^ IBM System/360 Principles of Operation, IBM Publication A22-6821-6, Seventh Edition (January 13, 1967), pp.41-50
  2. ^ IBM System/370 Principles of Operation, IBM Publication GA22-7000-4, Fifth Edition (September 1, 1975), pp.157-170
  3. ^ "The S/390 G5 floating-point unit", Schwarz, E. M. and Krygowsk, C. A., IBM Journal of Research and Development, Vol:43 No: 5/6 (1999), p.707
  4. ^ "Decimal floating-point in z9: An implementation and testing perspective", Duale, A. Y., et al., IBM Journal of Research and Development, Vol:51 No.1/2 (2007), p.217
  5. ^ "Millicode in an IBM zSeries processor", Heller, L C, Farrell, M S, IBM Journal of Research and Development, Vol:48 No.3/4 (2004), p.425
  6. ^ "Decimal floating-point support on the IBM System z10 processor", Schwartz, E. M., et al., IBM Journal of Research and Development, Vol:53 Issue:1 (Jan. 2009), pp.4:1-4:10
  7. ^ The Record Layout of a Data Set in SAS Transport (XPORT) Format

External references