Question: Explain the steps to be followed for the addition of floating point numbers

0

0

Consider number A and B both are floating point number.

- Check whether A or B is zero if so the result is other operand.
- Calculate the difference between the exponents i.e. Ea-Eb or Eb-Ea.
- Select the number A or B which has a smallest exponent.
- Shift right the mantissa of the selected number by number of times equal to the difference between the exponents .Now both the numbers have same exponent.
- Perform addition of mantissa Ma+Mb.
- The sum is (Ma+Mb)×r exponent(Ec).
- Normalize the result this is done by shifting left the mantissa bit till the MSB bit is non-zero. For each left shift the exponent of the result has to be decreased by 1.

Please log in to add an answer.