FP Addition and Subtraction Algorithm
The following figure shows the algorithm for binary floating-point addition and subtraction.
It includes the following five steps:
- Step 1. Making exponents of two operands equal
- Step 2. Adding or subtracting the significands
- Step 3. Normalizing the result
- Step 4. Rounding the significand
- Step 5. Checking for overflow or underflow
- The subtraction uses the addition hardware by converting the subtrahend to 2’s complement representation.
- If rounding causes the result to be unnormalized, we must repeat Step 3.
- For single precision, the maximum exponent is 127, and minimum exponent is -126.
The limits for double precision are 1023 and -1022.