Data Representation
Data Representation
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) Calculate the normalised floating-point representation of +4.5 in this system. Show your
working.
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(b)
working.
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(c) Calculate the denary value for the following binary floating-point number. Show your working.
Mantissa Exponent
0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
(d) (i) State whether the floating-point number given in part (c) is normalised or not normalised.
...................................................................................................................................... [1]
...........................................................................................................................................
...................................................................................................................................... [1]
(e) The system changes so that it now allocates eight bits to both the mantissa and the exponent.
Explain two effects this has on the numbers that can be represented.
1 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
(i) Write the normalised floating-point representation of the following unsigned binary
number using this system.
1011100.011001
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Mantissa Exponent
[2]
(ii) State the consequence of storing the binary number in part (a)(i) as a floating-point
number in this system. Justify your answer.
Consequence ....................................................................................................................
...........................................................................................................................................
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(b) Explain the reason why binary numbers are stored in normalised form.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
© UCLES 2021 9618/32/O/N/21
6
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(b) State the most suitable method of file access when a record is referenced by a unique
address on a disk-type storage medium.
............................................................................................................................................. [1]
(c) State the most suitable method of file access when a bank stores its data records in ascending
order of account number.
............................................................................................................................................. [1]
1 Real numbers are stored in a computer system using floating-point representation with:
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(b) Calculate the denary value of the given binary floating-point number.
Show your working.
Mantissa Exponent
1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Mantissa Exponent
0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(d) The denary number 513 cannot be stored accurately as a normalised floating-point number in
this computer system.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(ii) Describe an alteration to the way floating-point numbers are stored to enable this number
to be stored accurately using the same total number of bits.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(i) SchoolDay to hold data about the days students are usually in school.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) WeekEnd to hold data about the days that are not school days.
...........................................................................................................................................
..................................................................................................................................... [1]
(c) Define, using pseudocode, the composite data type ClubMeet. This will hold data about club
members that includes:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
Benefit 1 ...........................................................................................................................................
..........................................................................................................................................................
Benefit 2 ...........................................................................................................................................
..........................................................................................................................................................
Drawback 1 ......................................................................................................................................
..........................................................................................................................................................
Drawback 2 ......................................................................................................................................
..........................................................................................................................................................
[4]
0 1 1 0 1 0 0 0 0 1 0 0
[3]
[1]
(iii) Show the binary pattern for the smallest positive number which can be stored using a
normalised 12-bit floating-point representation.
Mantissa:
Exponent:
Denary: [3]
(b) The developer of a new programming language decides that all real numbers will be stored
using 20-bit normalised floating-point representation. She cannot decide how many bits to
use for the mantissa and how many for the exponent.
Explain the trade-off between using either a large number of bits for the mantissa, or a large
number of bits for the exponent.
[2]
1 In a particular computer system, two real numbers, A and B, are stored using floating-point
representation with:
1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
(a) (i) Identify whether each number is positive or negative. Justify your answer.
Number A .........................................................................................................................
...........................................................................................................................................
Number B .........................................................................................................................
...........................................................................................................................................
[2]
(ii) Convert the binary values of the mantissa and the exponent for each number to their
separate denary values.
A mantissa ........................................................................................................................
...........................................................................................................................................
A exponent ........................................................................................................................
...........................................................................................................................................
B mantissa ........................................................................................................................
...........................................................................................................................................
B exponent ........................................................................................................................
...........................................................................................................................................
[4]
(iii) Calculate the denary value of each floating-point number using your values from
part (a)(ii).
Number A .........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Number B .........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(b) State which number, A or B, is stored in normalised floating-point form. Justify your answer.
Number .....................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
1 In a computer system, two real numbers, A and B, are stored using floating-point representation
with:
0 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1
1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0
(a) (i) Convert the binary values of the mantissa and the exponent for each number to their
separate denary values.
A mantissa .......................................................................................................................
...........................................................................................................................................
A exponent .......................................................................................................................
...........................................................................................................................................
B mantissa .......................................................................................................................
...........................................................................................................................................
B exponent .......................................................................................................................
...........................................................................................................................................
[4]
(ii) Calculate the denary value of each floating-point number using your values from
part (a)(i).
Number A .........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Number B .........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(b) State which number, A or B, is stored in normalised floating-point form. Justify your answer.
Number .....................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
2 The TCP/IP protocol suite can be viewed as a stack with four layers.
(a) Write the correct descriptions for the two layers and the correct layers for the two descriptions
given in the following table.
Layer Description
Application
Transport
[4]
(b) Identify and state the purpose of two communication protocols other than TCP/IP.
Protocol 1 .................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Protocol 2 .................................................................................................................................
Purpose ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
1 In a particular computer system, real numbers are stored using floating-point representation with:
Calculate the denary value for the floating-point number. Show your working.
Mantissa Exponent
0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Mantissa Exponent
[2]
(ii) Describe one problem that can occur when floating-point numbers are not normalised.
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
TYPE box
ENDTYPE
(a) (i) Identify one composite and three non-composite data types used in the pseudocode.
..................................................................................................................................... [1]
Write pseudocode to store the details of this box in the first element of the array.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
1 In a particular computer system, real numbers are stored using floating-point representation, with:
(a) Calculate the denary value for the following floating-point number. Show your working.
Mantissa Exponent
0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
(b) A new operating system has been installed that has changed the way the floating-point
numbers are used. The order of the exponent and the mantissa are reversed.
(i) Calculate the new denary value for the following floating-point number that has the same
bit pattern as the number in part (a). Show your working.
Exponent Mantissa
0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(ii) Identify two problems that can occur due to the change in the representation of the
floating-point number.
Problem 1 ..........................................................................................................................
...........................................................................................................................................
Problem 2 ..........................................................................................................................
...........................................................................................................................................
[2]
(a) Draw one line from each data type to its correct classification.
Pointer
Record Composite
Set
Class Non-composite
Integer
[2]
(b) A user-defined data type, timeOfDay, is declared using the following pseudocode.
(i) Identify the type of user-defined data type declared and state its classification.
Type ..................................................................................................................................
Classification .....................................................................................................................
[2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) Calculate the normalised floating-point representation of +192.5 in this system. Show your
working.
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) Calculate the normalised floating-point representation of –192.5 in this system. Show your
working.
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(c) The floating-point representation has changed. There are now 12 bits for the mantissa and 4
bits for the exponent as shown.
Mantissa Exponent
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
2 The diagram shows four files and three methods of file organisation.
Draw one line to match each file with its most appropriate method of file organisation.
Text file
Sequential
Random
Serial
[4]
(a) (i) A real number is stored as a 12-bit normalised binary number as follows:
Mantissa Exponent
0 1 0 1 0 0 1 0 0 0 1 0
Calculate the denary value for this binary number. Show your working.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(ii)
Mantissa Exponent
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
(b) The number of bits available to represent a real number is increased to 16.
...................................................................................................................................................
............................................................................................................................................. [1]
(c) State why some binary representations can lead to rounding errors.
...................................................................................................................................................
............................................................................................................................................. [1]
(d) Complete the following descriptions by inserting the two missing terms.
exponent has become too large to be represented using the number of bits available.
A calculation results in a number so small that it cannot be represented by the number of bits
8 (a)
complement form. The twelve most significant bits are used for the mantissa and the four
least significant bits are used for the exponent.
Most Least
significant bit significant bit
0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1
..................................................................................................................................... [1]
..................................................................................................................................... [1]
(iii) State whether the number stored is positive or negative. Justify your choice.
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(iv) Convert the binary floating-point number in part (a) into denary. Show your working.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(b) The number of bits used for the exponent is increased to eight, and the number of bits used
for the mantissa is decreased to eight.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
............................................................................................................................................. [2]
(b) A pseudocode declaration for a user-defined data type for the months of the year is as follows:
TYPE
DECLARE Months: (January, February, March, April, May, June, July,
August, September, October, November, December)
ENDTYPE
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
..................................................................................................................................... [1]
(iii) Write a pseudocode statement to assign the value August to the variable
CurrentMonth.
...........................................................................................................................................
..................................................................................................................................... [1]
1 In a computer system, real numbers are stored using normalised floating-point representation
with:
(a) Calculate the denary value for the following binary floating-point number.
Mantissa Exponent
1 0 0 1 0 1 1 1 0 0 1 1 0 1 1 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Mantissa Exponent
[3]
(c) (i) Write the largest positive number that can be stored as a normalised floating-point
number using this format.
Mantissa Exponent
[2]
(ii) Write the smallest non-zero positive number that can be stored as a normalised
floating-point number using this format.
Mantissa Exponent
[2]
(d) The developer of a new programming language decides that all real numbers will now be
stored using 20-bit normalised floating-point representation. She must decide how many bits
to use for the mantissa and how many bits for the exponent.
Explain the trade-off between using either a large number of bits for the mantissa, or a large
number of bits for the exponent.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
1 (a) A computer stores real numbers using floating-point representation. The floating-point
numbers have:
Mantissa Exponent
0 0 1 1 0 1 1 1 0 1 0 1
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Answer ..............................................................................................................................
[3]
(ii) State why the floating-point number in part (a)(i) is not normalised.
...........................................................................................................................................
..................................................................................................................................... [1]
Mantissa Exponent
[2]
(b) (i) Convert the denary number +11.625 into a normalised floating-point number.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Mantissa Exponent
[3]
(ii)
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Mantissa Exponent
[3]
OUTPUT(0.2 * 0.4)
The student is surprised to see that the interpreter outputs the following:
0.08000000000000002
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
Packet switching is not always the most appropriate method of transferring data.
............................................................................................................................................. [1]
(b) Give an example of a situation where the method you identified in part (a) is more appropriate.
Example ....................................................................................................................................
...................................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
TYPE Book
DECLARE ISBN : INTEGER
DECLARE Author : STRING
DECLARE Title : STRING
DECLARE Supplier : (Amazone, Stones, Smiths, Blackwalls, Greens,
Coals, Boarders)
ENDTYPE
...............................................................................................................................................[1]
(b) Name the non-composite data type used in the Supplier declaration.
...............................................................................................................................................[1]
(c) (i) Write a pseudocode statement to declare a variable, BestSeller, of type Book.
.......................................................................................................................................[1]
.......................................................................................................................................[1]
2 (a) A computer system stores real numbers using floating-point representation. The floating-point
numbers have:
Mantissa Exponent
0 0 1 1 1 0 0 0 0 1 1 1
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Answer ..............................................................................................................................
[3]
(ii) State how you know the floating-point number in part (a)(i) is not normalised.
...........................................................................................................................................
.......................................................................................................................................[1]
Mantissa Exponent
[2]
(b) (i) Write the largest positive number that this system can represent as a normalised
floating-point number in this format.
Mantissa Exponent
[2]
(ii) Write the smallest positive number that can be stored as a normalised floating-point
number in this format.
Mantissa Exponent
[2]
(c) The number of bits available to represent a real number is increased to 16.
State the effect this has on the numbers that can be represented, if the additional four bits are
used in the:
.......................................................................................................................................[1]
.......................................................................................................................................[1]
X = 0.1
Y = 0.2
Z = 0.3
OUTPUT (X + Y + Z)
0.6000000000000001
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
1 (a) A computer system uses floating-point representation to store real numbers. The floating-point
numbers have:
(i) Calculate the denary value of the following floating-point number. It is not in normalised
form.
Mantissa Exponent
0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Answer ..............................................................................................................................
[3]
(ii) Convert the denary number + 7.5 into a normalised floating-point number.
Mantissa Exponent
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
(iii)
Mantissa Exponent
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
Mantissa Exponent
0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) State what will happen if a positive number is added to this number.
...........................................................................................................................................
.......................................................................................................................................[1]
1 In a computer system, real numbers are stored using normalised floating-point representation
with:
(a) Find the denary value for the following binary floating-point number.
Mantissa Exponent
1 0 1 1 1 0 0 1 1 0 1 0 0 1 0 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
(b) Calculate the normalised floating-point representation of 5.25 in this system. Show your
working.
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Mantissa Exponent
[3]
(c) The size of the mantissa is decreased and the size of the exponent is increased.
State how this affects the range and precision of the numbers that the computer system can
represent.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
...................................................................................................................................................
...............................................................................................................................................[1]
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
...................................................................................................................................................
...............................................................................................................................................[1]
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Description ................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
3 Star and bus are two types of topology that can be used in a Local Area Network (LAN).
Bus topology
Star topology
(a) (i) State one benefit and one drawback of the star topology.
Benefit ...............................................................................................................................
...........................................................................................................................................
Drawback ..........................................................................................................................
...........................................................................................................................................
[2]
(ii) State one benefit and one drawback of the bus topology.
Benefit ...............................................................................................................................
...........................................................................................................................................
Drawback ..........................................................................................................................
...........................................................................................................................................
[2]
© UCLES 2018 9608/33/M/J/18
2
TYPE StudentRecord
DECLARE StudentID : INTEGER
DECLARE StudentFirstName : STRING
DECLARE StudentSurname : STRING
DECLARE StudentDOB : DATE
DECLARE StudentCourse : ARRAY[1:10] OF STRING
ENDTYPE
...............................................................................................................................................[1]
(i) Students can take six courses from: Computer Science, Engineering, Science, Maths,
Physics, Chemistry, Music, Drama and English Language.
Rewrite one line from the type definition of StudentRecord to implement the change.
DECLARE ...........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(ii) The values for the field StudentID must be between 1 and 8000 inclusive.
Rewrite one line from the type definition of StudentRecord to implement the change.
DECLARE .......................................................................................................................[1]
(c) A programmer is asked to write a program to process the assessment data for each student.
Students sit one exam in every course they take.
A composite data type, StudentAssessment, needs to be defined with the following three
fields.
• a student assessment code (a unique code of three letters and two digits)
• the marks for the six exams
• the average mark of the six exams
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[4]
(ii) Data about all students and their assessments are stored in a file that uses random
organisation. The StudentID is used as the key field.
Explain how the program adds the new data to the file.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(c) The syntax of variable is changed to allow one or more letters followed by an unsigned
integer.
[3]
3 In a computer system, real numbers are stored using normalised-floating point representation
with:
(a) Calculate the normalised floating-point representation of + 21.75 in this system. Show your
working.
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Mantissa Exponent
[3]
(b) Find the denary value for the following binary floating-point number.
Mantissa Exponent
1 0 1 1 0 0 0 0 1 1 1 0
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
(a) The table has statements about transmitting data across the Internet.
Put a tick ( ) in each row to identify whether the responsibility belongs to TCP or IP.
Responsibility TCP IP
Correct routing
[5]
(b) Identify two other internet protocols. State a use for each protocol.
Protocol 1 .................................................................................................................................
...................................................................................................................................................
Use ...........................................................................................................................................
...................................................................................................................................................
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) Calculate the floating-point representation of + 2.5 in this system. Show your working.
Mantissa Exponent
•
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(b) Calculate the floating-point representation of − 2.5 in this system. Show your working.
Mantissa Exponent
•
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(c) Find the denary value for the following binary floating-point number. Show your working.
Mantissa Exponent
0
•0 1 1 0 0 0 0 0 0 0 0 0 0 1 1
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(d) (i) State whether the floating-point number given in part (c) is normalised or not normalised.
...................................................................................................................................... [1]
...........................................................................................................................................
...................................................................................................................................... [1]
(e) The system changes so that it now allocates 8 bits to both the mantissa and the exponent.
State two effects this has on the numbers that can be represented.
1 ...............................................................................................................................................
...................................................................................................................................................
2 ...............................................................................................................................................
.............................................................................................................................................. [2]
TYPE LibraryBookRecord
DECLARE ISBN : INTEGER
DECLARE Title : STRING
ENDTYPE
.......................................................................................................................................[1]
.......................................................................................................................................[1]
(b) The user-defined data type LibraryBookRecord needs to be modified by adding the
following fields:
• Genre
• NumberOfLoans which can be an integer value in the range 1 to 99
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(c) A pointer is a variable that stores the address of a variable of a particular type.
The four assignment statements are executed. The diagram shows the memory contents
after execution.
Memory
Variable Contents
address
...
8217
IntVar 8216 88
8215
8214
...
7307
IntPointer 7306 8216
7305
...
6717
Temp1 6716 88
Temp2 6715 57
6714
...
Use the diagram to state the current values of the following expressions:
.......................................................................................................................................[1]
.......................................................................................................................................[1]
(iii) Copy the value in Temp2 into the memory location currently pointed at by IntPointer.
.......................................................................................................................................[1]
TYPE MyContactDetail
DECLARE Name : STRING
DECLARE HouseNumber : INTEGER
ENDTYPE
.......................................................................................................................................[1]
(ii) Write a pseudocode statement that assigns 129 to the HouseNumber of NewFriend.
.......................................................................................................................................[1]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(c) A pointer is a variable that stores the address of a variable of a particular type.
The four assignment statements are executed. The diagram shows the memory contents
after execution.
Memory
Variable Contents
Address
...
5848
5847
IPointer 5846 4402
5845
...
4403
Sum 4402 33
4401
...
3428
MyInt1 3427 91
MyInt2 3426 33
3425
...
Use the diagram to state the current values of the following expressions:
.......................................................................................................................................[1]
.......................................................................................................................................[1]
(iii) Copy the value in MyInt2 into the memory location currently pointed at by IPointer.
.......................................................................................................................................[1]
4 (a) Three file organisation methods and two file access methods are shown below.
Draw lines to link each file organisation method to its appropriate file access method(s).
random sequential
serial direct
sequential
[4]
(b) An energy company supplies electricity to a large number of customers. Each customer has
a meter that records the amount of electricity used. Customers submit meter readings using
their online account.
• account number
• personal data (name, address, telephone number)
• meter readings
• username and encrypted password.
For each of the files A, B and C, state an appropriate file organisation method for the use
given in the table.
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) Calculate the floating point representation of + 3.5 in this system. Show your working.
Mantissa Exponent
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(b) Calculate the floating-point representation of –3.5 in this system. Show your working.
Mantissa Exponent
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(c) Find the denary value for the following binary floating-point number. Show your working.
Mantissa Exponent
0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(d) (i) State whether the floating-point number given in part (c) is normalised or not normalised.
...................................................................................................................................... [1]
...........................................................................................................................................
...................................................................................................................................... [1]
(e) Give the binary two’s complement pattern for the negative number with the largest magnitude.
Mantissa Exponent
[2]
4 (a) Three file organisation methods and two file access methods are shown below.
Draw lines to link each file organisation method to its appropriate file access method or
methods.
serial direct
sequential sequential
random
[4]
(b) A bank has a very large number of customers. The bank stores data for each customer. This
includes:
• A – a file that stores customer personal data. This file is used at the end of each month
for the production of the monthly statement.
• B – a file that stores encrypted personal identification numbers (PINs) for customer bank
cards. This file is accessed when the customer attempts to withdraw cash at a cash
machine (ATM).
• C – a file that stores all customer transaction records for the current month. Every time
the customer makes a transaction, a new record is created.
For each of the files A, B and C, state an appropriate method of organisation. Justify your
choice.
Justification ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Justification ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Justification ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
4 (a) Three file organisation methods and two file access methods are shown below.
Draw lines to link each file organisation method to its appropriate file access method or
methods.
serial direct
sequential sequential
random
[4]
(b) A bank has a very large number of customers. The bank stores data for each customer. This
includes:
• A – a file that stores customer personal data. This file is used at the end of each month
for the production of the monthly statement.
• B – a file that stores encrypted personal identification numbers (PINs) for customer bank
cards. This file is accessed when the customer attempts to withdraw cash at a cash
machine (ATM).
• C – a file that stores all customer transaction records for the current month. Every time
the customer makes a transaction, a new record is created.
For each of the files A, B and C, state an appropriate method of organisation. Justify your
choice.
Justification ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Justification ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Justification ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
1 In a particular computer system, real numbers are stored using floating-point representation with:
Mantissa Exponent
0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(ii) Explain why the floating-point number in part (a)(i) is not normalised.
...........................................................................................................................................
.......................................................................................................................................[2]
Mantissa Exponent
[2]
(b) (i) Write the largest positive number that can be written as a normalised floating-point
number in this format.
Mantissa Exponent
[2]
(ii) Write the smallest positive number that can be written as a normalised floating-point
number in this format.
Mantissa Exponent
[2]
(iii) If a positive number is added to the number in part (b)(i) explain what will happen.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(c) A student writes a program to output numbers using the following code:
X 0.0
FOR i 0 TO 1000
X X + 0.1
OUTPUT X
ENDFOR
The student is surprised to see that the program outputs the following sequence:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) (i) A real number is stored as the following 12-bit binary pattern:
0 1 1 0 1 0 0 0 0 0 1 1
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(ii) Give the normalised binary pattern for +3.5. Show your working.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(iii) Give the normalised binary pattern for –3.5. Show your working.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(b) (i) If the system were to use the extra 4 bits for the mantissa, state what the effect would be
on the numbers that can be represented.
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) If the system were to use the extra 4 bits for the exponent instead, state what the effect
would be on the numbers that can be represented.
...........................................................................................................................................
.......................................................................................................................................[1]
0.3000000000000001
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
4 (a) A particular programming language allows the programmer to define their own data types.
TYPE ThisAddress
DECLARE ThisHouseNo : INTEGER
DECLARE ThisStreet : STRING
DECLARE ThisTown : STRING
ENDTYPE
(i) Write the statement that assigns the house number 34 to HomeAddress.
.......................................................................................................................................[1]
Rewrite one line from the definition for each of the following changes.
DECLARE ...........................................................................................................................
The possible towns are limited to: Brightown, Arunde and Shoram.
DECLARE .......................................................................................................................[2]
(b) Temperature data from a number of weather stations are to be processed by a program.
• average temperature (to the nearest whole number) for each year from 2001 to 2015
inclusive
A programmer designs a composite data type WeatherStation. A variable of this type can
be used to store all the data for one particular station.
(i) Write the definition for the user-defined data type WeatherStation.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[5]
(ii) The programmer decides to store all the data in a file. The number of weather stations
could grow to reach 20000, but not all stations will be present at first.
Describe three steps which show how a new weather station record is added to the file.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
3 ........................................................................................................................................
.......................................................................................................................................[3]
3 (a) A particular programming language allows the programmer to define their own data types.
TYPE ThisDate
DECLARE ThisDay : (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31)
DECLARE ThisMonth : (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug,
Sep, Oct, Nov, Dec)
DECLARE ThisYear : INTEGER
ENDTYPE
(i) Name the non-composite data type used in the ThisDay and ThisMonth declarations.
.......................................................................................................................................[1]
.......................................................................................................................................[1]
.......................................................................................................................................[1]
(b) Annual rainfall data from a number of locations are to be processed in a program.
• location name
• height above sea level (to the nearest metre)
• total rainfall for each month of the year (centimetres to 1 decimal place)
A variable of this type can be used to store all the data for one particular location.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[5]
(ii) The programmer decides to store all the data in a file. Initially, data from 27 locations will
be stored. More rainfall locations will be added over time and will never exceed 100.
The programmer has to choose between two types of file organisation. The two types are
serial and sequential.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]