1.4.1 Data Types
1.4.1 Data Types
The quantity of a particular product in stock is stored as a binary number usingtwo bytes.
There are 312 tins of beans left in stock.
[2]
(b). The name of a product is stored using characters from the computer's character set.
[2]
[3]
[1]
(b). Using binary subtraction, calculate your answer to the following. You must show your working.
[2]
(c). Using two’s complement convert the denary number −43 into an 8 bit binary number. You must show your
working.
[2]
(d).
(i) Using normalised floating point binary representation using 4 bits for the mantissa and 4 for the exponent,
represent the denary value 1.75. You must show your working.
[2]
(ii) Using normalised floating point binary representation using 4 bits for the mantissa and 4 for the exponent,
represent the denary value −1.75. You must show your working.
[2]
[3]
(b).
(i) Change the denary number -89 into a two's complement, 8 bit binary number.
[1]
(ii) Change the denary number -72 into a two's complement, 8 bit binary number.
[1]
(i) Add the two binary answers which you obtained, using 8 bit arithmetic.
[2]
[2]
[1]
The following algorithm takes a message as binary digits, one at a time, from a source and outputs the message
that is being transmitted.
[2]
[2]
Write this routine in a high level language you have studied, stating the name of the language you have used.
Yo u should use good program writing techniques to ensure that your routine is easy to understand.
You can assume that the message consists only of the characters A, B, C and D.
Name of language
Routine
[7]
Name two of these facilities. Describe how each can be used when writing the routine in part (e).
[6]
[2]
(b). Represent the number 55 in normalised floating point binary notation, using 8 bits for the mantissa followed by 8
bits for the exponent, both in two's complement binary.
[2]
(c). Represent the number 55 in normalised floating point binary notation, with the mantissa and exponent both in
two's complement binary, using as few bits as possible.
[2]
(d). State why a programmer might choose to declare a variable as a floating point number.
[1]
For the newsletter, club members send in descriptions of games they play using chess notation, which consist of
a sequence of symbols, letters and numbers. It is important that these descriptions are accurate.
One member sends in the description as a plain text file. The text file is saved using Unicode, an extract of which
is shown below.
[3]
When Asim opens this file on the text editor on his computer it looks as below.
[2]
[4]
[1]
[1]
[1]
(c). The two values below are stored using unsigned binary. Calculate the subtraction of 01110010 from 11000011.
Show your working.
[2]
[3]
[1]
[1]
[1]
Mantissa Exponent
0100101 0100
[3]
(e). Given that computers store everything in binary, explain how they are able to represent text.
[2]
Examiner's Comments
Total 7
Total 9
(1 per –, max 3)
b i 10100111 1
Examiner's Comments
ii 10111000 1
Examiner's Comments
Total 9
4 a 100011 1
Examiner's Comments
Examiner's Comments
Examiner's Comments
INPUT message
Uses a loop
… to correctly visit each character
Replaces “A”, “B”, “C” and “D” with
correct code
Outputs the result
Meaningful identifiers
Commenting
Indenting
Total 18
5 a 00110111 2
(1 mark per nibble) Examiner's Comments
b 01101110 00000110 2
Examiner's Comments
(1 mark for mantissa, 1 for exponent)
Few candidates achieved full marks on this
question. Many represented a normalised
floating point mantissa with two of the
same bit at the start.
c 0110111 0110 2
Examiner's Comments
(1 mark for mantissa, 1 for exponent)
Few candidates achieved full marks on this
question. Many reduced the number of bits
by deleting the leading zero's, rendering
the result negative.
Total 7
ii □ Asim's text editor may only support 2 Question states plain text file so no credit
ASCII which doesn't include characters for mention of missing graphics files.
for the chess piece [1]
□ Cannot recognize / understand the Examiner's Comments
binary values of the two pieces [1]
Few candidates referred to the codes that
OR represent the symbols in their
explanations, more so referring to the
symbols themselves which did not gain
□ Asim may be using a font which credit.
doesn't include a representation for the
chess pieces… [1]
□ …and so those characters can't be
represented. [1]
Total 5
7 Method [3 marks] 4
Examiner's Comments
□ Treat left most bit as negative value These questions were well answered, with
(e.g. –128) [1] many candidates achieving full marks.
□ Treat remaining bits as positive However, some candidates lost marks for
values [1] simple arithmetic errors. Candidates
□ Total them the relevant placeholder should be reminded to thoroughly check
values. [1] their responses.
OR
OR
Answer [1 mark]
11010101 [1]
Total 4
8 a 6F 1
AO2.1
Examiner’s Comment
Very well answered by the majority of
candidates.
b i 11101101 1
AO2.1
ii 10010011 1
AO2.1
Examiner’s Comment
Very well answered by the majority of
candidates.
01101 001
Total 8
9 a 01001000 1
AO1.2
(1)
b 133 1
AO1.2
(1)
c 68 1
AO1.2 Examiner’s Comments
(1)
A significant number of candidates
achieved all three available marks across
the first three parts of this question.
Total 8