9618/13/O/N/24 question 8: worked solution (October/November 2024, paper 13)

Show as plain text

Cambridge AS Level Computer Science 9618 · 1.1 Data Representation Worked solution from the Information representation Paper 1 Theory Fundamentals booklet, Part 1 of 3. Q19 9618/13/O/N/24 original Q8 Structured · 6 marks Worked solution (a) Multiply each hex digit by its place value: 1 = 1 × 16³, F (15) = 15 × 16², A (10) = 10 × 16, B (11) = 11. 4096 + 3840 + 160 + 11 Write: 8107 [1] (b) Method: the leftmost bit has a negative place value, so either flip the bits and add 1, or add up the place values. Flip every bit of 10011111 to get 01100000. Add 1 to get 01100001. [1] Convert 01100001 to denary: 64 + 32 + 1 = 97. [1] The original number was negative, so write: −97 [1] Other correct way: −128 + 16 + 8 + 4 + 2 + 1 = −97 using the negative place value for the most significant bit. (c) In a logical shift, all the bits move to the right and zeros are put in the empty leftmost places. [1] In an arithmetic shift, all the bits move to the right and the sign bit is copied into the most significant bit (MSB). [1] KEY IDEA A logical shift fills with zeros; an arithmetic shift keeps the sign bit so negative numbers stay negative. TOTAL 6 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.