AQA 7517, section 4.5.4.8
The same number can be written in floating point in many different ways, by shifting the mantissa and changing the exponent to compensate. For example, all of these mean 5:
| Mantissa | Exponent | Value |
|---|---|---|
| () | (3) | |
| () | (4) | |
| () | (5) |
Normalising means choosing the one standard form, so that there's a single, consistent representation.
What is a normalised number?
A floating point number is normalised when its mantissa has no unnecessary leading digits: the first two bits are different.
| Sign of the number | Normalised mantissa starts | Value of mantissa |
|---|---|---|
| Positive | between and just under | |
| Negative | between and just under (more negative than ) |
A mantissa starting or is not normalised, because there's a wasted leading bit that could be used for another significant digit.
Why normalise?
- Maximum precision. All the mantissa bits carry useful digits, so none are wasted on leading zeros (or ones).
- A unique representation. Each number has just one normalised form, so there is no ambiguity.
- Easier comparison and arithmetic. Comparing two numbers is simple, because you can compare the exponents first.
How to normalise
Shift the mantissa left until the first two bits differ. Each shift left doubles the mantissa, so you must subtract 1 from the exponent to keep the value the same.
Rule: shift mantissa left by places, and reduce the exponent by .
Positive mantissa
Normalise mantissa , exponent .
- Value: .
- The mantissa begins , so it isn't normalised. Shift left 2 places: .
- Reduce the exponent by 2: .
Result: mantissa , exponent .
Check: . ✓ The value is unchanged.
Negative mantissa
Normalise mantissa , exponent .
- Value: the mantissa is , so .
- It begins , so it isn't normalised. Shift left: (exponent becomes 3), which still starts with . Shift left again: (exponent becomes 2).
- The mantissa now begins , so it is normalised.
Result: mantissa , exponent .
Check: , and . ✓
Zeros are shifted in on the right. The leading 1s that you shift out of a negative number do not change its value, because they were just copies of the sign.
Worked example
Task: normalise mantissa with exponent , and state the value.
- Value: , and the exponent is 6, so .
- Shift left 2 places to get . The exponent becomes (4).
- Check: and . ✓
The normalised form has mantissa and exponent .
Exam tip: the test is that the first two bits of the mantissa differ ( or ). Say the reason for normalising: it gives the maximum precision (and a unique representation). Always adjust the exponent to compensate, and check by working out the value before and after.
Check yourself
How can you tell that a mantissa is normalised?
The first two bits are different: it starts with if positive, or if negative.
Give two reasons for normalising a floating point number
It gives the maximum precision for the available mantissa bits, and it gives each number a unique representation.
If the mantissa is shifted left by 3 places during normalisation, what must happen to the exponent?
It must be reduced by 3, so that the value of the number stays the same.