🔒
Pro Content
Subscribe to access all 69 OCR H446 A Level lessons.
£7.99/month
or £59/year
Subscribe now →
🔒 Pro · Component 1 · 1.4.1 Data Types
1.4.1c Floating Point Representation
OCR H446 · A Level Computer Science · ~14 min read
Notes
Video
Slides
Worksheet
Quiz

Floating Point Representation

Computers need to represent very large numbers (e.g. the distance from Earth to Andromeda in metres) and very small numbers (e.g. the mass of an electron). Fixed-point binary cannot handle this efficiently. Floating point solves the problem by storing a number in two parts: mantissa and exponent.

The Floating Point Format

A floating point number is stored as:

Value = Mantissa × 2Exponent

  • Mantissa: stores the significant digits (the fractional part of the number)
  • Exponent: stores the power of 2 (controls the magnitude — how big or small the number is)
  • Both mantissa and exponent are stored in two's complement (so negative values are possible)

Binary Point and Normalisation

The binary point is always assumed to be immediately after the sign bit of the mantissa. A normalised floating point number has its mantissa in a specific form to maximise precision:

  • For a positive number: mantissa must start with 0.1... (sign bit = 0, first mantissa bit = 1)
  • For a negative number: mantissa must start with 1.0... (sign bit = 1, first mantissa bit = 0)

Normalisation ensures the maximum number of significant bits are used — no leading zeros (positive) or leading ones (negative) are wasted.

Reading a Floating Point Binary Number

Example: 8-bit mantissa (two's complement) + 4-bit exponent (two's complement) Number: mantissa = 0101 1000, exponent = 0011

Step 1 — Read mantissa as two's complement fraction:
Binary point after sign bit: 0.101 1000
Place values of mantissa bits after binary point: ½, ¼, ⅛, 1/16, 1/32, 1/64, 1/128
0 . 1 0 1 1 0 0 0
= 0.5 + 0 + 0.125 + 0.0625 = 0.6875

Step 2 — Read exponent: 0011 = +3

Step 3 — Value = 0.6875 × 2³ = 0.6875 × 8 = 5.5
Negative mantissa example: mantissa = 1011 0000, exponent = 0010 Mantissa = 1.011 0000 (two's complement, MSB=1 → negative)
Negate: flip = 0100 1111, +1 = 0101 0000
Positive value = 0.101 0000 = 0.5 + 0.125 = 0.625
So mantissa = −0.625
Exponent = 0010 = +2
Value = −0.625 × 2² = −0.625 × 4 = −2.5

Precision and Range Trade-off

In a fixed-bit system (e.g. 16 bits total), bits must be allocated between mantissa and exponent. Changing this allocation has consequences:

More bits for…Effect on precisionEffect on range
MantissaHigher precision (more significant bits)Smaller range of values
ExponentLower precision (fewer significant bits)Larger range of values (bigger/smaller numbers)

Normalisation in Detail

To normalise a floating point number, shift the binary point (adjust exponent) until the mantissa satisfies the normalised form:

Normalise: 00110100 mantissa, exponent 0000 Current mantissa: 00.110100 (starts with 00 — not normalised for positive, should be 0.1...)
Shift binary point left by 1 = 0.0110100, increase exponent by 1: exponent = 0001
Still 0.0... — not 0.1... Shift again: 0.110100, exponent = 0010
Now mantissa = 0.110100 → normalised! Store as mantissa = 01101000, exponent = 0010

Underflow and Overflow in Floating Point

  • Overflow: the exponent is too large to be stored — result is greater than the maximum representable value (exponent field saturates)
  • Underflow: the exponent is too negative — result is too close to zero to represent accurately (the number becomes 0, losing the value)

Rounding Errors

Because mantissas have finite bits, most real numbers cannot be represented exactly. The rounding error (or truncation error) is the difference between the stored value and the true value. More mantissa bits = smaller rounding errors.

IEEE 754 Standard (Context)

Modern computers use IEEE 754, which defines 32-bit (single precision) and 64-bit (double precision) formats. You do not need to know the specific IEEE 754 bit layout for OCR H446, but you should understand the general principle: sign bit, exponent field, mantissa (significand) field.

FormatTotal bitsSignExponentMantissa
Single precision321823
Double precision6411152
Exam tip: For normalisation — positive normalised mantissa starts with 0.1; negative starts with 1.0. If asked to normalise, shift the binary point right (dividing mantissa by 2) and decrease the exponent for each shift, OR shift left (multiplying by 2) and increase the exponent — until the mantissa is in normalised form.
Exam tip: "More precision" means more mantissa bits — the number is stored more accurately. "Greater range" means more exponent bits — you can represent much larger or smaller values. These are trade-offs with a fixed total number of bits.
⚠ Common Mistakes
  • Forgetting that the binary point is after the sign bit — the first bit after the sign bit is ½, not 1.
  • Confusing precision (mantissa bits) with range (exponent bits) — more mantissa bits do NOT increase range.
  • Not normalising properly — a leading 0 after the binary point (for positive) or a leading 1 after the binary point (for negative) means the number is not normalised and is wasting precision.
✓ Notes completed!
Video coming soon
Click to advance · Arrow keys also work
Click slide or press arrow keys to navigate

Worksheet — 1.4.1c Floating Point Representation

8 questions · 20 marks · instantly marked

Q1A floating point number uses an 8-bit two's complement mantissa and a 4-bit two's complement exponent. The mantissa is 01011000 and the exponent is 0010. Calculate the denary value.[3 marks]
✓ Mark scheme
Binary point after sign bit: 0.1011000 [1]; = 0.5 + 0.125 + 0.0625 = 0.6875 [1]; Exponent = 0010 = +2; value = 0.6875 × 2² = 0.6875 × 4 = 2.75 [1].
Q2What is meant by a normalised floating point number? State the conditions for normalisation for both positive and negative numbers.[3 marks]
✓ Mark scheme
A normalised floating point number has its mantissa arranged to maximise the number of significant bits stored [1]. For a positive number: mantissa starts with 0.1 (sign bit 0, next bit 1) [1]. For a negative number: mantissa starts with 1.0 (sign bit 1, next bit 0) [1].
Q3A floating point number has mantissa 10110000 (8 bits, two's complement) and exponent 0011 (4 bits, two's complement). Calculate the denary value.[4 marks]
✓ Mark scheme
MSB=1 → negative mantissa. Negate: flip 01001111, +1 = 01010000 [1]. Positive value: 0.1010000 = 0.5 + 0.125 = 0.625 [1]. So mantissa = −0.625 [1]. Exponent = 0011 = +3. Value = −0.625 × 2³ = −0.625 × 8 = −5 [1].
Q4A computer uses 16 bits total for floating point: 12 for the mantissa and 4 for the exponent. A designer proposes changing to 8 bits for mantissa and 8 for exponent. Describe the effect on (a) precision and (b) range.[4 marks]
✓ Mark scheme
(a) Precision decreases — fewer mantissa bits (8 vs 12) means fewer significant binary digits are stored; rounding errors become larger; the gap between representable numbers increases [2]. (b) Range increases — more exponent bits (8 vs 4) means much larger or smaller values can be represented (exponent can take a wider range of values, so the scale factor 2^exponent spans more orders of magnitude) [2].
Q5Explain what floating point underflow is and give a circumstance when it would occur.[2 marks]
✓ Mark scheme
Underflow occurs when the result of an arithmetic operation produces a number too close to zero to be represented (the exponent is too small/negative to be stored) [1]; for example, dividing a very small positive number by a very large number, so the result approaches zero but cannot be distinguished from zero in the available exponent range [1].
Q6Is the mantissa 01101100 (8-bit, two's complement) normalised? If not, normalise it and state what adjustment must be made to the exponent.[3 marks]
✓ Mark scheme
Binary point representation: 0.1101100. The first bit after the binary point is 1 — this IS normalised for a positive number [1]. No adjustment needed to exponent [2 — accept 1 if identified as normalised with no justification].
Q7Explain why rounding errors occur in floating point arithmetic, and how the precision of the mantissa affects the size of these errors.[3 marks]
✓ Mark scheme
Rounding errors occur because the mantissa has a finite number of bits, so most real numbers cannot be stored exactly — they must be rounded or truncated to the nearest representable value [1]. The stored value differs from the true value by the rounding error [1]. A longer mantissa (more bits) produces smaller rounding errors because the gaps between representable numbers decrease — the approximation is closer to the true value [1].
Q8A non-normalised mantissa is 00011010 with exponent 0001. Normalise it and state the new mantissa and exponent.[3 marks]
✓ Mark scheme
Binary point: 0.0011010. For a positive number, normalised form requires 0.1.... Need to shift left by 2 positions (move binary point right relative to bits, shifting mantissa left, decrease exponent by 2) [1]. Mantissa becomes: 0.1101000 = 01101000 [1]. Exponent: 0001 − 2 = 1111 (= −1 in two's complement) [1].
Topic Quiz
1 of 15
You scored
out of 15
🎯

Mini Test — 1.4.1c Floating Point

  • 10 questions · 10 marks · 10 minutes
  • 5 MCQ + 5 short answer
Card 1 of 15
Click to reveal
🎉
Complete!
TermDefinition
← 1.4.1b Two's Complement 1.4.1 Data Types Next: 1.4.1d Character Encoding →