2.5 Floating Point Addition and Multiplication
2.5 Floating Point Addition and Multiplication
Rewrite the smaller number such that its exponent matches with the exponent
· If the mantissa does not fit in the space reserved for it, it has to be rounded
off.
The addition operation proceeds as the exponent of one operand is subtracted from
the other using the small ALU to determine which is larger and by how much. This
difference controls the three multiplexors; from left to right, they select the larger
exponent, the significant of the smaller number, and the significant of the larger
number. The smaller significant is shifted right, and then the significant are added
together using the big ALU. The normalization step then shifts the sum left or right
and increments or decrements the exponent. Rounding then creates the final result,
which may require normalizing again to produce the final result.
Step 1: Rewrite the smaller number such that its exponent matches with the
exponent of the larger number.
1.000 × 2-1 +
-0.1110 × 2-1
0.001 × 2-1
-126 <= -4 <= 127 (-4 is within the range of -126 and 127).No overflow or
underflow
1. Rewrite the smaller number such that its exponent matches with the
exponent of the larger number.
If the mantissa does not fit in the space reserved for it, it has to be rounded
off.
Example :
Can only keep three digits to the right of the decimal point, so the result is
10.212 × 105
1.0212 × 106
4. Round it
1.021 × 106