9618/32/O/N/23 question 1: worked solution (October/November 2023, paper 32)

Show as plain text

Cambridge A2 Level Computer Science 9618 · 13.3 Floating-point numbers, representation and manipulation Worked solution from the Data Representation Paper 3 Advanced Theory booklet, Part 3 of 3. Q41 9618/32/O/N/23 original Q1 Structured · 6 marks 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 × 2⁷. The point moved 7 places, so the exponent is 7 = 000111 in 6 bits. Mantissa Exponent 1001111101 000111 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 IDEA A 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 VIDEO ▶ Whole paper Video solution of the whole paper · by TEACHING BY SM. Tap the picture to open it on YouTube.