Teachers' Portal  /  A-Level Computer Science 9618  /  Data representation  /  Normalisation, range and precision
Lesson pack · A-Level Computer Science 9618 · 13.3 · A Level (A2)

Normalisation, range and precision

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.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Data representation
Syllabus reference
Cambridge International AS and A Level Computer Science 9618, 13.3
Level
A Level (A2)
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 4 of 4 in Data representation; follows Floating-point binary representation
Central model
Fig. 1: normalising 00011010 0101 gives 01101000 0011; both represent 6.5
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • 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.
Key points to leave on the board
  • 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.
The core visual model

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.

normalising: same value, more significant bits kept beforeafter 0.00110100.1101000 01010011 E = 5E = 3 mantissa: 2 places left exponent − 2 both are 6.5, but now the first two bits differ positive normalised: starts 0.1 negative normalised: starts 1.0
Fig. 1: normalising 00011010 0101 gives 01101000 0011; both represent 6.5
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen 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 minTeach and check: How to normaliseLeading 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 minTeach and check: Range versus precisionWith 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 minTeach and check: Approximations, overflow and underflowJust as 1/3 cannot be written exactly in denary, many fractions recur forever in binary.Round Table
30 to 36 minCheckThe 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 minPlenaryThe 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 minExit and homeworkSet the worksheet below (6 questions, 19 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

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.

Running the cooperative task

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.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching 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".
Worksheet

Normalisation, range and precision: worksheet

6 questions, 19 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · explain[2 marks]

Give two reasons why floating-point numbers are normalised.

Q2 · convert[3 marks]

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.

Q3 · convert[3 marks]

Using the same format, normalise 11110100 0101 and give its denary value.

Q4 · calculate[4 marks]

For the same format, write the binary and the denary value of (a) the largest positive number and (b) the smallest positive normalised number.

Q5 · analysis[3 marks]

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.

Q6 · explain[4 marks]

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
Q1 · 2 marks
  • 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).
Q2 · 3 marks
  • Mantissa shifted 2 places left: 01011000.
  • Exponent 4 - 2 = 2: 0010.
  • Value unchanged: 2.75.
Q3 · 3 marks
  • Mantissa shifted 3 places left until it starts 10: 10100000.
  • Exponent 5 - 3 = 2: 0010.
  • Value: -0.75 × 4 = -3.
Q4 · 4 marks
  • (a) Mantissa 01111111, exponent 0111.
  • = 127/128 × 27 = 127.
  • (b) Mantissa 01000000, exponent 1000.
  • = 0.5 × 2-8 = 1/512 (0.001953125).
Q5 · 3 marks
  • 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.
Q6 · 4 marks
  • 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.
Quiz

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.

Q11 mark

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
Q21 mark

An 8-bit mantissa and a 4-bit exponent are both in two's complement. What is 00010011 0101 after normalisation?

  • A01001100 0011
  • B01001100 0111
  • C01001100 0101
  • D10011000 0010
Q31 mark

Using the same format, what is 11101100 0100 after normalisation?

  • A10110000 0010
  • B11011000 0011
  • C01100000 0001
  • D10110000 0110
Q41 mark

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
Q51 mark

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?

  • A0100000000 100000, which is 2-33
  • B0000000001 100000, which is 2-41
  • C0100000000 111111, which is 2-2
  • D0100000000 000000, which is 2-1
Q61 mark

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
Q1: A

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.

Q2: A

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).

Q3: A

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).

Q4: A

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.

Q5: A

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.

Q6: A

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

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.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonFloating-point binary representation