Revision Library

Computer Architecture, Assembly and the LMC - Worksheets, Questions and Revision

11 original exam-style questions - 5 pages of questions with a full mark scheme - free printable PDF.

Download PDFJump to mark scheme (page 6)Read the revision guide
« Previous: Legal, Moral, Cultural and Ethical IssuesNext: Boolean Algebra, Logic Gates and Karnaugh Maps »
Revision Library
revisionlibrary.co.uk
A-Level · Computer Systems

A1.6 Computer Architecture, Assembly and the LMC

OCR H446/01 · Calculators not allowed · about 105 minutes
Total Marks
Name: _______________________________    Date: ____ / ____ / ______
Answer ALL questions. Show all your working.
1
Once an instruction has been fetched into the Current Instruction Register (CIR), it must be decoded before it can be executed.
(a)State what is meant by the 'opcode' part of a machine instruction, and what is meant by the 'operand' part.(2)
(b)Describe what happens during the decode stage of the fetch-decode-execute cycle.(2)
(c)State which CPU component is responsible for decoding the instruction.(1)
(Total for Question 1 is 5 marks)
2
Two assembly instructions are STA 250 (store the value in the accumulator directly to memory address 250) and BRA 50 (branch always to the instruction at address 50).
(a)Using register transfer notation, describe the execute stage of STA 250.(3)
(b)Using register transfer notation, describe the execute stage of BRA 50.(2)
(c)Explain how the execute stage of BRA 50 is able to change the normal sequential order in which instructions are fetched.(2)
(Total for Question 2 is 7 marks)
3
A processor's assembly language supports both immediate and direct addressing. LDM #45 loads the value 45 directly into the accumulator. LDD 45 loads, into the accumulator, whatever value is currently stored at memory address 45.
(a)Explain what is meant by immediate addressing.(2)
(b)Explain what is meant by direct addressing.(2)
(c)Memory address 45 currently holds the value 12. State the value that would be loaded into the accumulator by (i) LDM #45 and (ii) LDD 45, and (iii) explain why these two answers are different.(3)
(Total for Question 3 is 7 marks)
4
The same assembly language also supports indirect addressing (LDI) and indexed addressing (LDX), where LDX uses the index register (IX).
(a)Explain what is meant by indirect addressing.(2)
(b)Explain what is meant by indexed addressing, with reference to the index register (IX).(2)
(c)Memory address 60 holds the value 80. Memory address 63 holds the value 55. Memory address 80 holds the value 7. The index register (IX) currently holds the value 3. State the value loaded into the accumulator, and (where relevant) the effective address used, for (i) LDD 60, (ii) LDI 60, (iii) LDX 60.(4)
(Total for Question 4 is 8 marks)
5
The Little Man Computer (LMC) is a simplified model used to help understand how a real processor carries out the fetch-decode-execute cycle.
(a)State what the LMC is used to model.(1)
(b)Complete the table to match each part of the LMC model to its real computer equivalent.
i) Calculator:
ii) In-tray:
iii) Out-tray:
iv) Mailboxes:
(4)
(c)State the number of mailboxes in the standard LMC model, and the range of values each mailbox can hold.(2)
(Total for Question 5 is 7 marks)
6
The table below sets out the LMC instruction set. Some cells have been left blank.
OpcodeMnemonicMeaning
1xx(i)Add the value in mailbox xx to the accumulator
(ii)SUBSubtract the value in mailbox xx from the accumulator
3xxSTA(iii)
5xxLDALoad the value in mailbox xx into the accumulator
(iv)BRABranch always: set the program counter to xx
7xx(v)If the accumulator is zero, set the program counter to xx
(vi)BRPIf the accumulator is zero or positive, set the program counter to xx
901(vii)Input a value from the in-tray into the accumulator
(viii)HLTStop the program executing
(a)Complete the table by giving the missing mnemonic or opcode for each of (i) to (viii).(8)
(b)Explain the purpose of a DAT instruction in an LMC program, giving an example.(2)
(Total for Question 6 is 10 marks)
7
The LMC program below inputs two numbers and outputs their sum.
00 INP
01 STA 99
02 INP
03 ADD 99
04 OUT
05 HLT
99 DAT 000
The program is run with the inputs 15, then 23, entered in that order.
(a)Complete a trace table showing the value in the accumulator (ACC) and in mailbox 99 immediately after each instruction (addresses 00 to 05) executes, and any value output.(6)
(b)State the value output by the program.(1)
(c)State the purpose of mailbox 99 in this program.(1)
(Total for Question 7 is 8 marks)
8
An LMC program is required that: inputs two numbers; subtracts the second number from the first; outputs the result if it is zero or positive; outputs 0 instead if the true result would be negative.
(a)Write LMC mnemonics for a program that meets this specification. Mailbox addresses do not need to be given, but the mnemonics must be in a logical, executable order.(6)
(b)Explain why the BRP instruction must be used at this point, rather than BRZ.(2)
(c)State the output of the program in part (a) for the input pairs (i) 8 then 8, (ii) 20 then 8, (iii) 8 then 20.(3)
(Total for Question 8 is 11 marks)
9
The LMC program below inputs a number and counts down from it, outputting each value in turn.
00 INP
01 STA 90
02 LDA 90
03 BRZ 08
04 OUT
05 SUB 91
06 STA 90
07 BRA 02
08 HLT
90 DAT 000
91 DAT 001
The program is run with the input 4.
(a)Complete a trace table showing the value in the accumulator and in mailbox 90 during each pass through the loop (addresses 02 to 07), all values output, and the point at which the program halts.(8)
(b)The instruction at address 07 (BRA 02) is changed to BRA 00. Explain the effect this would have if the program were run again with the input 4.(2)
(Total for Question 9 is 10 marks)
10
Discuss the extent to which the Little Man Computer (LMC) is a realistic model of how a modern processor carries out the fetch-decode-execute cycle. Your answer should consider registers, addressing modes and instruction sets.
(Total for Question 10 is 6 marks)
11
The LMC program below inputs two numbers and outputs their product, calculated by repeated addition.
00 INP
01 STA 90
02 INP
03 STA 91
04 LDA 95
05 STA 92
06 LDA 91
07 BRZ 15
08 LDA 92
09 ADD 90
10 STA 92
11 LDA 91
12 SUB 96
13 STA 91
14 BRA 06
15 LDA 92
16 OUT
17 HLT
90 DAT 000
91 DAT 000
92 DAT 000
95 DAT 000
96 DAT 001
The program is run with the inputs 3, then 4, entered in that order.
(a)Complete a trace table showing the values in the accumulator (ACC) and in mailboxes 90, 91 and 92 after each pass through the loop (addresses 06 to 14), and the final value output.(10)
(b)Explain, in your own words, how this program uses repeated addition to calculate the product of the two input values.(2)
(c)State one limitation of using this method to multiply two large numbers, and explain your answer.(2)
(Total for Question 11 is 14 marks)
Mark scheme · A1.6 Computer Architecture, Assembly and the LMC

Question 1

Question 2

Question 3

Question 4

Question 5

Question 6

Question 7

Question 8

Question 9

Question 10

Question 11

Mark your answers

This checks your answers in your browser, stores nothing on a server and needs no account.

Question 1

5 marks
Did your answer earn the marks?

Question 2

7 marks
Did your answer earn the marks?

Question 3

7 marks
Did your answer earn the marks?

Question 4

8 marks
Did your answer earn the marks?

Question 5

7 marks
Did your answer earn the marks?

Question 6

10 marks
Did your answer earn the marks?

Question 7

8 marks
Did your answer earn the marks?

Question 8

11 marks
Did your answer earn the marks?

Question 9

10 marks
Did your answer earn the marks?

Question 10

6 marks
Did your answer earn the marks?

Question 11

14 marks
Did your answer earn the marks?
Mark my answers