The shape of the lesson
By the end of the lesson, learners can
- How to normalise: Leading 0s on a positive mantissa (or leading 1s on a negative one) carry no information: they just take up bits that could hold significant digits.
- Range versus precision: With a fixed number of bits, the split between mantissa and exponent is a trade-off.
- Approximations, overflow and underflow: Just as 1/3 cannot be written exactly in denary, many fractions recur forever in binary.
- Normalised: positive starts 01, negative starts 10.
- Normalise: shift the mantissa left, subtract the shift count from the exponent; check the value is unchanged.
- More mantissa bits: precision up. More exponent bits: range up.
- Limits: recurring binary fractions give rounding errors; too big is overflow, too close to zero is underflow.
One picture every idea returns to
A floating-point number is normalised when the first two bits of the mantissa are different: a positive mantissa starts 0.1 and a negative one starts 1.0. To normalise, shift the mantissa left until this is true and subtract the number of places shifted from the exponent, so the value is unchanged. Normalisation gives the maximum precision for the number of mantissa bits and a unique representation for each number. For a fixed total, more mantissa bits give greater precision and more exponent bits give a greater range. Many denary fractions, such as 0.1, recur in binary and can only be stored as an approximation, causing rounding errors; a result too large for the exponent causes overflow, and one too close to zero causes underflow.
Forty-five minutes, phase by phase
| Time | Phase | What happens in the room | Grouping |
|---|---|---|---|
| 0 to 5 min | Hook: predict | Open with the question in the title, Make every bit count.. A normalised floating-point number wastes no bits on leading zeros or ones, so it is as precise as the format allows and has only one representation. Put the figure on the board: it is the one picture every idea in the lesson returns to. | Whole class, then pairs |
| 5 to 13 min | Teach and check: How to normalise | Leading 0s on a positive mantissa (or leading 1s on a negative one) carry no information: they just take up bits that could hold significant digits. Model the worked example Positive mantissa on the board, one line at a time. Your turn: Normalise 00110000 0010 and give its denary value. | Whole class, then pairs |
| 13 to 21 min | Teach and check: Range versus precision | With a fixed number of bits, the split between mantissa and exponent is a trade-off. Model the worked example Extremes of a format on the board, one line at a time. Your turn: A system changes from an 8-bit mantissa and 4-bit exponent to a 6-bit mantissa and 6-bit exponent. State the effect on range and on precision. | Pairs |
| 21 to 30 min | Teach and check: Approximations, overflow and underflow | Just as 1/3 cannot be written exactly in denary, many fractions recur forever in binary. | Round Table |
| 30 to 36 min | Check | The four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong. | Individual, then whole class |
| 36 to 43 min | Plenary | The exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording. | Individual, random call |
| 43 to 45 min | Exit and homework | Set the worksheet below (6 questions, 19 marks). Learners self-assess against the objectives before they leave. | Individual |
Protect the parts that carry the learning
The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.
Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.
Cut first if the build overruns: the last check in Approximations, overflow and underflow, never the check or the plenary.
In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.
Round Table
One sheet travels round the team. Each student adds one line of working or one idea and passes it on, so the solution is built four hands at a time and every contribution is visible.
The full structure, with its variations and the other twelve, is on the cooperative-learning page.
What to head off, and how
| Trap learners fall into | Teaching move that pre-empts it |
|---|---|
| Shifting the mantissa without changing the exponent changes the number. | Every left shift must take 1 off the exponent; state the new exponent in binary. |
| Overflow and underflow are about the size of the result, not about a negative number. | Underflow means too close to zero, not "too negative". |
Normalisation, range and precision: worksheet
6 questions, 19 marks. Written in the style of the papers; no past paper question is reproduced.
Give two reasons why floating-point numbers are normalised.
A floating-point number has an 8-bit mantissa and a 4-bit exponent, both two's complement. Normalise 00010110 0100, showing the new mantissa and exponent.
Using the same format, normalise 11110100 0101 and give its denary value.
For the same format, write the binary and the denary value of (a) the largest positive number and (b) the smallest positive normalised number.
A designer must use 12 bits for each floating-point number and is choosing between an 8-bit mantissa with a 4-bit exponent and a 6-bit mantissa with a 6-bit exponent. Explain the effect of each choice.
The denary value 0.1 is stored using an 8-bit mantissa and a 4-bit exponent as 01100110 1101. Explain why this is not exactly 0.1, and describe one consequence for a program. Also explain the term overflow.
Answer key and marking notes
- To give the maximum precision for the number of bits in the mantissa (no bits wasted on leading 0s or 1s).
- So that each number has a unique representation (making comparison easier).
- Mantissa shifted 2 places left: 01011000.
- Exponent 4 - 2 = 2: 0010.
- Value unchanged: 2.75.
- Mantissa shifted 3 places left until it starts 10: 10100000.
- Exponent 5 - 3 = 2: 0010.
- Value: -0.75 × 4 = -3.
- (a) Mantissa 01111111, exponent 0111.
- = 127/128 × 27 = 127.
- (b) Mantissa 01000000, exponent 1000.
- = 0.5 × 2-8 = 1/512 (0.001953125).
- 8-bit mantissa: more significant bits, so greater precision (smaller gaps between values).
- 6-bit exponent: larger range (exponent -32 to +31, not -8 to +7), so much larger and smaller numbers can be stored.
- Trade-off: increasing one decreases the other for a fixed total number of bits.
- 0.1 is a recurring fraction in binary (0.000110011...), so the mantissa can hold only the first bits.
- The stored value is 0.099609375, a rounding error of 0.000390625.
- Consequence: errors accumulate over repeated calculations / an equality test on REAL values may fail.
- Overflow: the result of a calculation is too large to be represented, because the exponent needed is greater than the maximum.
6 multiple-choice questions on this lesson
From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.
A floating-point format keeps 12 bits in total but moves 2 bits from the mantissa to the exponent. What is the effect?
- AThe range increases and the precision decreases
- BThe precision increases and the range decreases
- CBoth the range and the precision increase
- DOnly negative numbers are affected
An 8-bit mantissa and a 4-bit exponent are both in two's complement. What is 00010011 0101 after normalisation?
- A
01001100 0011 - B
01001100 0111 - C
01001100 0101 - D
10011000 0010
Using the same format, what is 11101100 0100 after normalisation?
- A
10110000 0010 - B
11011000 0011 - C
01100000 0001 - D
10110000 0110
An 8-bit mantissa and a 4-bit exponent are both in two's complement. The variable X holds 01010000 0111, which is 80. What happens when the program calculates X × 2?
- AOverflow: 160 is larger than the largest value the format can hold
- BUnderflow: the exponent needed is below its minimum
- CA rounding error: 160 is stored as an approximation
- DThe result is stored as 01010000 1000
A different format uses a 10-bit mantissa and a 6-bit exponent, both in two's complement. Which is the smallest positive normalised number it can represent?
- A
0100000000 100000, which is 2-33 - B
0000000001 100000, which is 2-41 - C
0100000000 111111, which is 2-2 - D
0100000000 000000, which is 2-1
The denary value 0.2 is stored as a normalised floating-point number with an 8-bit mantissa and a 4-bit exponent, both in two's complement. Any bits that do not fit in the mantissa are cut off (truncated). What value is actually stored?
- A0.19921875
- B0.2
- C0.201171875
- D0.099609375
Quiz key
A longer exponent lets the binary point move further, so much larger and much smaller numbers fit (greater range), but a shorter mantissa keeps fewer significant bits (less precision). Giving bits to the mantissa would do the opposite, a fixed total cannot improve both, and the trade-off applies equally to positive and negative numbers.
Two left shifts give 01001100, so the exponent drops from 5 to 3 (0011). Both forms equal 4.75: 19/128 × 32 before and 76/128 × 8 after. Adding 2 to the exponent gives 76, leaving the exponent unchanged gives 19, and shifting 3 places pushes a 1 into the sign bit, making the number negative (-3.25).
The mantissa starts 11, so shift left: 11011000, then 10110000, which starts 10 after 2 shifts. The exponent drops from 4 to 2 (0010), and the value is unchanged: -0.15625 × 16 = -0.625 × 4 = -2.5. 11011000 0011 has the right value but still starts 11, so it is not normalised. 01100000 0001 shifts once too often and turns the number positive (1.5), and 0110 adds the shifts to the exponent (-40).
The largest value is 01111111 0111 = 127/128 × 27 = 127, and 160 would need an exponent of +8, above the maximum of +7, so the result overflows. Underflow is a result too close to zero, not too large. 160 is not stored approximately because it cannot be stored at all, and 1000 is -8 in two's complement, so 01010000 1000 is a tiny positive number.
The smallest normalised positive mantissa is 0.100000000 = ½, and the most negative 6-bit exponent is 100000 = -32, so the value is ½ × 2-32 = 2-33. 0000000001 is smaller but starts 00, so it is not normalised. 111111 is -1, the least negative exponent, not the most negative, and 000000 is an exponent of zero.
0.2 = 0.0011001100... = 0.1100110011... × 2-2. Truncating gives the mantissa 01100110 (102/128) and exponent 1110, so the stored value is 102/128 × ¼ = 0.19921875, a rounding error of 0.00078125. 0.2 cannot be stored exactly because the binary fraction recurs. 0.201171875 rounds the last bit up instead of truncating, and 0.099609375 uses an exponent of -3, which is the stored form of 0.1.
Slides for this lesson
A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.