EXAM QUESTIONS · A LEVEL 9618

Floating-Point & Data Representation (A2) Exam-Style Questions with Answers (A Level 9618)

Original exam-style questions on user-defined data types, file organisation and access, hashing, and normalised floating-point binary numbers for Cambridge AS & A Level Computer Science 9618 (Paper 3). There are 22 marks in total. Try each question on paper first, then press Show answer to see the mark scheme. Answers that can be calculated mark themselves.

In Questions 1–4, floating-point numbers use an 8-bit mantissa and a 4-bit exponent, both in two’s complement. The binary point is after the first bit of the mantissa.

Question 1[2 marks]

Convert this floating-point number to denary. Show your working.

Mantissa 0110 1000   Exponent 0011

Show answer

6.5 [2]

  • Mantissa = 0.1101 = ½ + ¼ + 1/16 = 0.8125; exponent = 3 [1]
  • 0.8125 × 23 = 6.5 [1]
Question 2[2 marks]

Convert this floating-point number to denary.

Mantissa 1011 0000   Exponent 0010

Show answer

−2.5 [2]

  • Mantissa = −1 + ¼ + ⅛ = −0.625; exponent = 2 [1]
  • −0.625 × 22 = −2.5 [1]
Question 3[3 marks]

Show how the denary number 5.75 is stored as a normalised floating-point number.

Show answer
  • 5.75 = 101.11 in binary [1]
  • Move the binary point to get 0.10111 × 23 [1]
  • Mantissa 0101 1100, exponent 0011 [1]
Question 4[3 marks]

The number 0001 1010 with exponent 0100 is not normalised. Normalise it and explain why normalisation is used.

Show answer
  • Mantissa 0110 1000 [1], exponent 0010 [1] (shift the mantissa 2 places left and subtract 2 from the exponent)
  • A normalised mantissa starts 01 (positive) or 10 (negative), so the precision is as high as possible for the bits available / each number has a unique representation. [1]
Question 5[2 marks]

Explain the effect of using more bits for the exponent and fewer for the mantissa, in a fixed total number of bits.

Show answer
  • The range of numbers that can be stored increases. [1]
  • The precision (accuracy) of the numbers decreases. [1]
Question 6[4 marks]

A file uses random organisation. The address of each record is found using Key MOD 7.

  1. Calculate the addresses for the keys 45 and 23. [2]
  2. The key 30 is added next. Explain the problem and describe how it could be solved. [2]
Show answer
  1. 45 MOD 7 = 3; 23 MOD 7 = 2 [2]
  2. 30 MOD 7 = 2, which is the same address as key 23: a collision. [1] It could be stored in the next free location (open hashing / linear probing) or in an overflow area, which is searched if the record is not found at its calculated address. [1]
Question 7[3 marks]

Explain the difference between sequential access and direct access, and state which is more suitable for a large stock file where single items are looked up often.

Show answer
  • Sequential access: records are read one after another from the start until the required record is found. [1]
  • Direct (random) access: the record’s address is calculated (e.g. by hashing) so it can be read straight away. [1]
  • Direct access is more suitable, because each look-up does not need to read through the whole file. [1]
Question 8[3 marks]

Write pseudocode to declare an enumerated type for the days of the week and a pointer type that points to an integer.

Show answer
TYPE TDay = (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday)
TYPE TIntPointer = ^INTEGER
  • 1 mark: TYPE … = ( … ) with the seven values
  • 1 mark: correct enumerated syntax
  • 1 mark: pointer type with ^INTEGER

Frequently asked questions

How do you convert a floating-point binary number to denary?

Find the value of the mantissa (the first bit is −1, then ½, ¼, ⅛ …), find the exponent in two’s complement, then multiply the mantissa by 2 to the power of the exponent.

Are these past paper questions?

No. These are original exam-style questions written by a Computer Science teacher in the Cambridge style.

Revise the topic: 9618 data representation (A2) notes · 9618 flashcards · All exam-style questions