Question 5(d)(iv) 2015 · May-June · Paper 33 · 18 marks
Question 5
Part (d)
(iv)
Question 5
<productcode> ::= <producttype><digitstring><location>
(i)
A BNF rule may be recursive.
What is meant by a recursive rule?
...........................................................................................................................................
.......................................................................................................................................[1]
(ii)
For each statement below, state whether it is TRUE or FALSE.
Statement TRUE or FALSE None of the given rules are recursive Rule 4 is recursive Rule 5 is recursive
Question 7
Part (c)
Circle whether or not each of the following sequences of characters is a valid product code.
Show how you arrived at your answer by listing, in order, the rules used.
(i)
D175N Valid / Invalid (circle)
Rules .................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(ii)
W058M Valid / Invalid (circle)
Rules .................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(iii)
C86N Valid / Invalid (circle)
Rules .................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
Question 8
Removal of a value is implemented with a procedure Pop.
Write pseudocode for the procedure Pop.
PROCEDURE Pop
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
ENDPROCEDURE
5 A computer system stores integers in a single byte using two’s complement representation.
Part (a)
State the denary integer represented by the following two bytes.
Give the hexadecimal representation of each integer.
(iv)
Why do computer scientists often write binary numbers in hexadecimal?
...........................................................................................................................................
.......................................................................................................................................[1]
Question 15
Part (b)
The integers 99 and 29 are to be added.
Write the binary values for 99 and 29 below, using two’s complement representation.
Show the binary addition calculation and the result.
Question 99
Question 29
+
Comment on the result.
...................................................................................................................................................
...............................................................................................................................................[3]
Part (c)
Integers can be represented in Binary Coded Decimal (BCD).
(i)
State what denary number is represented by this 2-byte BCD number.
Denary ................................................
(ii)
A second BCD 2-byte number has been copied incorrectly.
Without converting the whole pattern, how can you identify that this cannot be a valid BCD representation?
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[1]
Question 16
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Why this question appears here
98% assigned-topic match · Computational thinking and problem-solving › Recursion
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9691_s15_qp_33.pdf
