CIE AS & A Level Computer Science, section 13.3 (Floating-point numbers, representation and manipulation)
What normalisation is
A floating-point number is normalised when its mantissa is as large as possible with the first two bits different:
- a positive mantissa starts
01 - a negative mantissa starts
10
Why normalise
- It gives the greatest precision, because no bits are wasted on leading zeros (or ones).
- Each number has one unique representation, which makes comparison easier.
Normalising a number
Shift the mantissa left until the first two bits differ, and subtract 1 from the exponent for each shift, so the value is unchanged.
Example: mantissa 00101100, exponent 0100.
| Step | Mantissa | Exponent |
|---|---|---|
| Start | 00101100 | 0100 (4) |
| Shift left once | 01011000 | 0011 (3) |
Check: and .
Negative numbers
Mantissa 11010000, exponent 0011. Shift left until the first two bits differ: 10100000, exponent 0010.
Zero
Zero cannot be normalised, because every bit is the same.
Common mistake: shifting the mantissa but forgetting to change the exponent. Every left shift needs the exponent to decrease by 1. Also, a number such as 0.1... is not normalised for a positive number if written 00....
Exam tip: write the mantissa and exponent after each shift, and finish by stating that the first two bits now differ. Mention that this gives maximum precision.
Check yourself
How can you tell that a positive mantissa is normalised?
It starts with 01.
Why are floating-point numbers normalised?
To get the greatest precision and a single representation for each number.
Normalise mantissa `00110000`, exponent `0010`.
Shift left once to give 01100000, exponent 0001.