A Level · Topic 13.3
A-Level Computer Science 9618 / Topic 13 / A2

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. Then see how the split between mantissa and exponent trades range for precision, and why some numbers can only ever be approximated.

The key idea

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
Section 01

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. Normalising removes them.

Worked example Positive mantissa
Normalise 00011010 0101 (8-bit mantissa, 4-bit exponent, both two's complement).
  1. The mantissa starts 00, so it is not normalised.
  2. Shift left until it starts 01: 00011010 → 00110100 → 01101000, which is 2 places.
  3. Exponent 0101 = 5; subtract 2 to get 3 = 0011.
  4. Check: before, 0.0011010 = 0.203125 × 25 = 6.5; after, 0.1101 = 0.8125 × 23 = 6.5.
Answer: 01101000 0011
Worked example Negative mantissa
Normalise 11100100 0011.
  1. The mantissa starts 11, so it is not normalised.
  2. Shift left until it starts 10: 11100100 → 11001000 → 10010000, which is 2 places.
  3. Exponent 0011 = 3; subtract 2 to get 1 = 0001.
  4. Check: before, (−1 + ½ + ¼ + 1/32) × 23 = −0.21875 × 8 = −1.75; after, (−1 + 1/8) × 2 = −1.75.
Answer: 10010000 0001
Your turn
Normalise 00110000 0010 and give its denary value.
Examiner trap

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.

Section 02

Range versus precision.

With a fixed number of bits, the split between mantissa and exponent is a trade-off. The exponent decides how far the point can move (range); the mantissa decides how many significant bits are kept (precision).

12 bits split asLargest positiveSmallest positive (normalised)Effect
10-bit mantissa, 2-bit exponent1.996093750.125high precision, tiny range
8-bit mantissa, 4-bit exponent1271/512 = 0.001953125a balance
6-bit mantissa, 6-bit exponent2 080 374 7842−33, about 1.16 × 10−10huge range, only 5 significant bits
Worked example Extremes of a format
For an 8-bit mantissa and a 4-bit exponent, both two's complement, give the largest positive number, the smallest positive normalised number and the most negative number, in binary and denary.
  1. Largest positive: biggest mantissa 01111111 (= 127/128) with biggest exponent 0111 (= 7): 127/128 × 128 = 127.
  2. Smallest positive normalised: smallest normalised positive mantissa 01000000 (= ½) with most negative exponent 1000 (= −8): ½ × 2−8 = 1/512.
  3. Most negative: mantissa 10000000 (= −1) with exponent 0111: −1 × 128 = −128.
  4. Note the smallest positive must still be normalised, so the mantissa cannot be 00000001.
Answer: 01111111 0111 = 127; 01000000 1000 = 1/512; 10000000 0111 = −128
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.
Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

Which 8-bit mantissa is normalised?

Quick check+10 XP

Normalising 00011010 0101 gives which result?

Quick check+10 XP

The total bits stay the same but more are given to the mantissa. What is the effect?

Quick check+10 XP

Why can 0.1 not be stored exactly in binary floating point?

Section 03

Approximations, overflow and underflow.

Just as 1/3 cannot be written exactly in denary, many fractions recur forever in binary. A fixed-size mantissa must cut them off, so the stored value is only close to the real number.

Examiner trap

Overflow and underflow are about the size of the result, not about a negative number. Underflow means too close to zero, not "too negative".

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to A Level Paper 3 and Paper 4 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

With an 8-bit mantissa and a 4-bit exponent, both two's complement, what is the largest positive number?

Exam style+20 XP

Using the same format, which is the smallest positive normalised number?

Exam style+20 XP

What is underflow in floating-point arithmetic?

Exam style+20 XP

Normalise 11100100 0011. What is the result?

Skill unlocked

Normalisation, range and precision, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Normalising positive and negative floating-point numbers, largest and smallest values of a format, the effect of the bit allocation on range and precision, rounding errors, overflow and underflow.