Floating Point


Encoding non-integer values requires the use of Scientific or Floating-point notation. Many floating-point systems exist but one of the more common is the IEEE 754 standard.

A value encoded in floating-point format is composed of two major components: a mantissa and an exponent. The actual structure of these is examined for the IEEE 754 standard.

Floating-point values may be handled completely through software, by means of an extra "math co-processor", or by complex instructions built into the main processor.


Fractional Values

Fractions can be handled in 3 different ways:

IEEE 754 Standard

      1-bit sign | 8-bit exponent | 23-bit mantissa
      (sign bit = 1 for negative values)

      For example:
         43 4D 40 00 (hex)
      re-written in binary:
         0100 0011  0100 1101  0100 0000 0000 0000
      re-grouped:
         sign:   exponent(+127):   mantissa:
           0       10000110         (1.)100110101000...
       (positive)    134(dec)
                  exponent: 
                     134-127 = 7
        moving the decimal point 7 positions to the right:
             1   1  0  0  1  1  0  1 .  0   1
            128 64 32 16  8  4  2  1   1/2 1/4 (weights)
        = +205.25
      


64-bit Format - the 64-bit ("double precision") format has the same structure as the 32-bit format except that it uses an 11-bit exponent encoded in excess-1023 notation and a 52-bit mantissa. This provides for approximately 15 decimal digits of precision and a scale of 300 digits (in decimal).
  • Special Values - note that some patterns are reserved for special values. Floating point values with either all 0's or all 1's represent non-standard (special) values. Specifically, for example, the value 0 is represented by a floating point encoding with all 0's in both the exponent and mantissa fields.


  • Other Floating Point Forms

    Main mainframe computers were designed prior to the establishment of the IEEE 754 standard and employ their own format for floating point encoding.

    Implementation Methods

    How floating point arithmetic is actually performed varies among different computer systems.