Skip to content
Questions

Floating point numbers can only be added or subtracted once their exponents are the same, in the same way that the decimal points must line up before two denary numbers are added.

Definition
Floating point arithmetic is adding or subtracting numbers held as a mantissa and an exponent. The mantissas are lined up by making the exponents equal, they are added or subtracted, and the result is normalised.

Adding Floating Point Numbers

  • 1.
    Compare the exponents. If they differ, raise the smaller exponent to match the larger one, shifting that mantissa one place right for each 1 added to its exponent.
  • 2.
    Add the mantissas. The exponent stays the same.
  • 3.
    Normalise the answer if its mantissa does not start 01 or 10.
Worked Example
Worked Example: 5.5 + 1.25

Both numbers have an 8-bit mantissa and a 4-bit exponent.
StepMantissaExponent
5.5010110000011 (3)
1.25010100000001 (1)
1.25 with its exponent raised to 3 (mantissa 2 places right)000101000011 (3)
Add the mantissas: 01011000 + 00010100011011000011 (3)
Check: 0.1101100 with the point moved 3 places right is 110.11 = 6.75.

The answer starts 01, so it is already normalised.

Subtracting Floating Point Numbers

Subtraction is done by adding a negative number. Line up the exponents, take the two's complement of the mantissa being subtracted, then add.

Worked Example
Worked Example: 5.5 - 3.5
StepMantissaExponent
5.5010110000011 (3)
3.5011100000010 (2)
3.5 with its exponent raised to 3 (mantissa 1 place right)001110000011 (3)
Two's complement of that mantissa, giving -3.5110010000011 (3)
Add: 01011000 + 11001000, ignoring the carry out001000000011 (3)
Normalise: mantissa 1 place left, exponent down by 1010000000010 (2)
Check: 0.1000000 with the point moved 2 places right is 10.0 = 2.
Key Point
Negative mantissas and lost bits:
• When a negative mantissa is shifted right to raise its exponent, the places on the left are filled with 1s so that it stays negative. Mantissa 10110000 with exponent 1 becomes 11101100 with exponent 3: both are -1.25
• Shifting a mantissa right can push bits off the end. Those bits are lost, so the answer can lose precision
Exam Tip
Floating point arithmetic:
• Never add the exponents. Make them equal first, then add only the mantissas
• Show each stage: matching the exponents, the addition, then normalising
• Check the answer by converting all three numbers to denary