5. Floating Point

5.9. Denormal Numbers

5.10. Infinities and NaNs

5.11. Floating-Point Addition(1)

Consider a 4-digit decimal example

$9.99910^1 + 1.61010^{-1}$

  1. Align decimal point

  2. Add significands

    $9.99910^1 + 0.01610^1 = 10.015*10^1$

  3. Normalize result & check for over/underflow

    $1.0015*10^2$

  4. Round and renormalize if necessary

    $1.002*10^2$

5.12. Floating-Point Addition(2)

Now consider a 4-digit binary example

$1.000_22^{-1}+-1.110_22^{-2}$

  1. Align binary points

    $1.000_22^{-1}+-0.111_2-2^{-1}$$1.002_22^{-1}+-0.111_2-2^{-1}$

  2. Add significands

    $1.000_22^{-1}+-0.111_2-2^{-1} = 0.001_2*2^{-1}$

  3. Normalize result & check for over/underflow

    $1.000_2*2^{-4}$, with no over/underflow