Computer Architecture MS
Computer Architecture MS
_______________________________________________________________________
_______________________________________________________________________
(Total 1 mark)
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
Register _______________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
(Total 3 marks)
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
(Total 2 marks)
_______________________________________________________________________
(Total 1 mark)
_______________________________________________________________________
(Total 1 mark)
(a) Explain the role of main memory in the execute stage of the Fetch-Execute cycle.
6.
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
(2)
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
(2)
(Total 4 marks)
0 0
0 1
1 0
1 1
(Total 1 mark)
(a) State the type of logic gate labelled G1 in the figure above.
___________________________________________________________________
(1)
(b) Write a Boolean expression to show how the output D is calculated from the inputs A, B
and C in the figure above.
You must use the correct symbols for the Boolean operators in your expression.
D = _______________________________________________________________
(2)
(Total 3 marks)
The figure below shows three programs (A, B, C) that add two numbers and output the result.
9. The programs are written in different programming languages.
A B C
x = 14 LDR R0, #14 0000 00001110
y = 3 LDR R1, #3 0001 00000011
z = x + y ADD R2, R0, R1 0110 00010000
OUTPUT(z) STR R2, 63 1010 10111111
OUT R2 1110 00000000
Identify the type of programming language used for each program shown in the figure above, by
writing A, B or C in the correct row of the table below.
A, B or C
Assembly language
High-level language
Machine code
(Total 2 marks)
_______________________________________________________________________
(Total 1 mark)
Shade one lozenge to show which statement is true about program translators.
11.
A A compiler translates all the original program code before execution.
C Compiled code executes more slowly than code that is being interpreted.
(Total 1 mark)
_______________________________________________________________________
2 _____________________________________________________________________
_______________________________________________________________________
3 _____________________________________________________________________
_______________________________________________________________________
4 _____________________________________________________________________
_______________________________________________________________________
(Total 4 marks)
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
(Total 4 marks)
Many new computers use solid-state storage for secondary storage rather than magnetic
14. storage.
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
(Total 2 marks)
(Total 1 mark)
Shade one lozenge to show the Boolean expression that is equivalent to the logic circuit shown
16. in the diagram below.
A A AND NOT B
B NOT (A AND B)
C (NOT A) AND B
(Total 1 mark)
0 0 0
0 1 1
1 0 1
1 1 1
(Total 1 mark)
State two advantages of programming using a high-level language compared with programming
18. using a low-level language.
Advantage 1 ____________________________________________________________
_______________________________________________________________________
Advantage 2 ____________________________________________________________
_______________________________________________________________________
(Total 2 marks)
B Compiler
C Interpreter
Write the label (A–C) for the type of translator next to the description.
(Total 2 marks)
A burglar alarm sounds an alarm when it is armed (turned on) and the window or door is opened.
20.
The truth table for this basic system is below.
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
(Total 3 marks)
_______________________________________________________________________
_______________________________________________________________________
_______________________________________________________________________
(Total 2 marks)
B Control unit
C Fan
E Keyboard
(Total 2 marks)
The expression (B AND (NOT A)) OR (B AND C) can be represented by the logic circuit shown
23. below. In the circuit the logic gates are marked with labels instead of their proper symbols.
(a) State the name of the logic gate used at Gate 1 in the logic circuit.
___________________________________________________________________
(1)
(b) State the name of the logic gate used at Gate 2 in the logic circuit.
___________________________________________________________________
(1)
(c) Draw the logic circuit symbol in the space below for the logic gate used at Gate 3 in the
logic circuit.
(1)
(1)
(Total 4 marks)
0 0
0 1
1 0
1 1
(Total 3 marks)
Clock
Regulates the timing and speed of (computer) operations // sends out a
regular electronic pulse / timing signal;
Control Unit
Coordinates the actions of the CPU // decodes instructions // sends
control signals; A. controls the flow of data through the CPU
Register
Holds data used when executing an instruction // holds the result of
executing an instruction // holds an instruction (CIR) // holds a memory
address (MAR);
[3]
R. references to information
2
Fetch stage
The (next) instruction is fetched from the memory (to the CPU);
Decode stage
The instruction is decoded (to work out what it is);
2
[4]
Mark as follows:
I. case
1
A.B + C // C + A.B;;
Mark as follows:
Assembly language B
High-level language A
Machine code C
Mark as follows:
R. repeated letters
[2]
• Programs written in assembly language run faster // use less processor time;
• Programs written in assembly language can interact directly with hardware (when
executing);
• Assembly language programs require less memory (when executing);
• Programs written in assembly language have no unnecessary code added by a compiler;
At the upper end of the mark range the student will have shown a
coherent and accurate explanation of how an interpreter works with
2 clear references to the principles of operation. 3-4
At the lower end of the mark range the student will have demonstrated
a good understanding of how interpreters function.
At the upper end of the mark range the student will have included some
explanation of how an interpreter works though there may be key steps
or elements either missing or described inaccurately.
1 1-2
At the lower end of the mark range the student will have made one or
two relevant statements but there may be errors or omissions in their
understanding of how interpreters function.
No creditworthy material. 0
Indicative content
• Interpreters do not produce any machine code so the program needs to be
translated each time it is executed.
• They call machine code subroutines within their own code to carry out
commands / directly execute the instruction.
• Translating a line / statement at a time (rather than all at once) which it then
executes.
• If a runtime error is found the interpreter stops.
[4]
A. magnetic hard drives (usually) have higher write/erase cycles (which can make them
more suitable for hard disk recording, eg music, video)
A. SSDs have limited write/erase cycles // SSDs degrade over time
[2]
Answers must show two inputs and one output from the gate.
(High-level languages) are easier to test // identify mistakes (than low-level languages);
(High-level languages) allow faster development (than low-level languages);
(High-level languages) are better documented (than low-level languages);
(High-level languages) contain complex data structures;
(High-level languages) allow code to be more portable (than low-level languages);
[2]
• OR Gate, with correct symbol used, with TWO inputs from B and C;
• AND Gate, with correct symbol used, with TWO inputs from A and Gate A (even if Gate A
is an incorrect gate);
• Output from Gate B is the only connection to Q (even if Gate B is an incorrect gate);
[3]
NE. A specific example e.g. “like in a washing machine” without further qualification.
[2]
If more than two lozenges shaded then marks are not awarded.
[2]
AND;
1
I. all labels;
1
I. all labels;
1
[4]
0 0 0 1 1
0 1 0 1 1
1 0 0 0 0
1 1 1 0 1