next up previous
Next: Division Up: Floating Point Arithmetic Previous: Addition and Subtraction

Multiplication

The multiplication of two floating point numbers is analogous to multiplication in scientific notation. For example, to multiply 1.8x tex2html_wrap_inline3048 times 9.5x tex2html_wrap_inline3050 :

  1. Perform unsigned integer multiplication of the mantissas. The decimal point in the sum is positioned so that the number of decimal places equals the sum of the number of decimal places in the numbers.

      1.8
    x 9.5
    -----
    17.10
  2. Add the exponents:

      1
    + 0
    ---
      1
  3. Normalize the result:

    displaymath3040

  4. Set the sign of the result.

The multiplication of two IEEE FPS numbers is performed similarly. The number 18.0 in IEEE FPS format is:

tabular1044

The number 9.5 in IEEE FPS format is:

tabular1047

  1. The product of the 24 bit mantissas produces a 48 bit result with 46 bits to the right of the binary point:

    displaymath3041

    Truncated to 24 bits with the hidden bit in (), the mantissa is:

    displaymath3042

  2. The biased-127 exponents are added. Addition in biased-127 representation can be performed by 2's complement with an additional bias of -127 since:

    displaymath3043

    The sum of the exponents is:

          E
      1000 0011 (4)
    + 1000 0010 (3)
    ----------- 
      0000 0101
    + 1000 0001 (-127)
    -----------
      1000 0110 (+7)
  3. The mantissa is already in normal form. If the position of the hidden bit overflows, the mantissa must be shifted right and the exponent incremented.
  4. The sign of the result is the xor of the sign bits of the two numbers.

When the fields are assembled in IEEE FPS format, the result is:

tabular1053

Rounding occurs in floating point multiplication when the mantissa of the product is reduced from 48 bits to 24 bits. The least significant 24 bits are discarded.

Overflow occurs when the sum of the exponents exceeds 127, the largest value which is defined in bias-127 exponent representation. When this occurs, the exponent is set to 128 (E = 255) and the mantissa is set to zero indicating + or - infinity.

Underflow occurs when the sum of the exponents is more negative than -126, the most negative value which is defined in bias-127 exponent representation. When this occurs, the exponent is set to -127 (E = 0). If M = 0, the number is exactly zero.

If M is not zero, then a denormalized number is indicated which has an exponent of -127 and a hidden bit of 0. The smallest such number which is not zero is tex2html_wrap_inline3052 . This number retains only a single bit of precision in the rightmost bit of the mantissa.


next up previous
Next: Division Up: Floating Point Arithmetic Previous: Addition and Subtraction

CS 301 Class Account
Mon Sep 13 11:15:41 ADT 1999