Cambridge A2 Level Computer Science 9618 · 13.3 Floating-point numbers, representation and manipulation

Q41 · 9618/32/O/N/23 Q1

Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 3 of 3.

Q419618/32/O/N/23original Q1Structured · 6 marks
Question 1 from 9618/32/O/N/23

Worked solution

(a)

Write 96.75 in binary with a sign bit: 01100000.11. Invert the bits and add 1 to make it negative: 10011111.00 + 1 = 10011111.01 (check: -128 + 16 + 8 + 4 + 2 + 1 + 0.25 = -96.75).

Move the point to just after the first bit so the mantissa starts 1.0: 1.001111101 × 27. The point moved 7 places, so the exponent is 7 = 000111 in 6 bits.

MantissaExponent
1001111101000111

Working: -96.75 converted to binary, 10011111.01 [1]

Mantissa 1001111101 [1]

Exponent 000111 [1]

(b)

Write: real numbers can have a fractional part, such as 0.4 or 1/3 [1]

Binary fractions are made from powers of 2 (1/2, 1/4, 1/8, 1/16 ...), so not every fraction can be stored exactly with the precision the fixed number of bits allows [1]

The fractional part is stored as close as possible within these limits, so the stored number is an approximation [1]

KEY IDEAA negative mantissa is found by inverting the positive number and adding 1, and fixed-length binary fractions can only approximate many real numbers.
TOTAL 6 marks

Official mark scheme

Mark scheme for 9618/32/O/N/23 question 1
VIDEO
▶ Whole paper

Video solution of the whole paper · by TEACHING BY SM. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.