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

Q34 · 9618/31/M/J/21 Q1

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

Q349618/31/M/J/21original Q1Structured · 14 marks
Question 1 from 9618/31/M/J/21

Worked solution

(a)

Change 7.25 to binary: 7 = 111 and 0.25 = 0.01, so 7.25 = 111.01.

Put the binary point after the sign bit and before the first 1: 0.11101 × 23. Move the point 3 places, so the exponent is 3. Exponent 3 = 000011 [1]

10-bit mantissa for +7.25: 0111010000 [1]

Make it negative with two's complement. Invert: 1000101111. Add 1: 1000110000.

MantissaExponent
1000110000000011

Correct final mantissa and exponent [1]

(b)

Exponent 000111 = 7, so move the binary point 7 places to the right [1]

Mantissa 1011000111 with the point after the first bit is 1.011000111. Move it 7 places: 10110001.11 [1]

Evaluate with a negative first place value: –128 + 32 + 16 + 1 + 0.5 + 0.25

Write: –78.25 [1]

(c)

Exponent 100111 = –32 + 7 = –25. The mantissa 0000000111 begins 00, so shift it left until it begins 01.

Move the mantissa 6 places left and subtract 6 from the exponent, so the number keeps its value [1]

Mantissa: 0111000000 [1]

Exponent: –25 – 6 = –31 = 100001 [1]

(d)(i)

513 in binary is 1000000001, which needs 10 bits [1]

As a normalised positive mantissa it is 0.1000000001, so it needs a sign bit as well: 11 bits but only 10 are available [1]

The largest number this system can store is 511, so 513 is too big and gives overflow [1]

(d)(ii)

Give more bits to the mantissa and fewer to the exponent, keeping 16 bits in total.

Increase the number of bits for the mantissa [1]

For example 11 or 12 bits for the mantissa and 5 or 4 bits for the exponent [1]

KEY IDEANormalise by moving the binary point and adjusting the exponent; more mantissa bits give more precision, more exponent bits give more range.
TOTAL 14 marks

Official mark scheme

Mark scheme for 9618/31/M/J/21 question 1
VIDEO
▶ Topic lesson

A lesson on this topic · by Craig'n'Dave. 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.