9618/31/O/N/23 question 1: worked solution (October/November 2023, paper 31)
Show as plain textHide 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. Q40 9618/31/O/N/23 original Q1 Structured · 5 marks Worked solution (a) Write 65.25 in binary: 64 + 1 + 0.25 = 1000001.01. Add a sign bit 0 and move the point to just after the sign: 0.100000101 × 2⁷. The point moved 7 places, so the exponent is 7 = 0111 in 4 bits. The mantissa is the sign bit 0, then 100000101, then 00 to fill all 12 bits. Mantissa Exponent 010000010100 0111 Working: 65.25 converted to binary, 1000001.01 [1] Mantissa 010000010100 [1] Exponent 0111 [1] (b) Write: the fraction 0.20 cannot be written exactly as a sum of halves, quarters, eighths and so on, so the closest value that can be stored is 0.25 or 0.1875 [1] This gives a loss of precision because of a rounding error (truncation) [1] KEY IDEA Binary fractions are sums of 1/2, 1/4, 1/8 and so on, so a fraction like 0.20 can only be stored as a close value. TOTAL 5 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by Craig'n'Dave. Tap the picture to open it on YouTube.