Question 8(a)(i) 2015 · October-November · Paper 42 · 15 marks
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Show text version of question
Question 8
Part (a)
(i)
Question 8
: : 1999 2000
(ii)
Another procedure call is made: Add("Drive", "Laufwerk")
Explain the problem that occurs when this key-value pair is saved.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
......................................................................................................................................
Question 10
(iii)
Describe a method to handle the problem identified in part (b)(ii).
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(iv)
Write pseudocode to implement the method you described in part
Part (b)
(iii)
. Choose line
numbers to indicate where your pseudocode should be inserted in the given pseudocode.
10 PROCEDURE Add(NewKey : STRING, NewValue : STRING)
20 Index ← Hash(NewKey)
30 Dictionary[Index, 1] ← NewKey // store the key
40 Dictionary[Index, 2] ← NewValue // store the value
50 ENDPROCEDURE
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
......................................................................................................................................
Question 11
Question 5 begins on page 12.
Question 12
5 The table shows assembly language instructions for a processor which has one general purpose register – the Accumulator (ACC).
Instruction Explanation Op Code Operand LDM #n Immediate addressing. Load the number n to ACC LDD <address> Direct addressing. Load the contents of the given address to ACC STO <address> Store the contents of ACC at the given address ADD <address> Add the contents of the given address to the ACC INC <register> Add 1 to the contents of the register CMP <address> Compare the contents of ACC with the contents of <address> JPN <address> Following a compare instruction, jump to <address> if the compare was False END Return control to the operating system
(i)
Dry-run this assembly language program using the trace table.
500 LDD 512
501 ADD 509
502 STO 512
503 LDD 511
504 INC ACC
505 STO 511
506 CMP 510
507 JPN 500
508 END
509 7
510 3
511 0
512 0
Question 13
Trace table
Memory address Accumulator 509 510 511 512 7 3 0 0
Why this question appears here
99% assigned-topic match · Processor fundamentals › Assembly language
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 9608_w15_qp_42.pdf
