Processor fundamentals and assembly language – A Level Computer Science (9618)

40 questions · page 3 of 3 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
31
9618/13/O/N/22 · Question 6Oct/Nov 2022Paper 1310 marks
Loading question…
Question text

6
The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Explanation
Opcode
Operand
LDM
#n
Immediate addressing. Load the number n to ACC
LDD
<address>
Direct addressing. Load the contents of the location at the given
address to ACC
LDX
<address>
Indexed addressing. Form the address from <address> + the contents
of the index register. Copy the contents of this calculated address to
ACC
LDR
#n
Immediate addressing. Load the number n to IX
MOV
<register>
Moves the contents of the accumulator to the given register (IX)
STO
<address>
Store contents of ACC at the given address
ADD
<address>
Add the contents of the given address to the ACC
ADD
#n
Add the denary number n to the ACC
SUB
#n
Subtract the denary number n from the ACC
INC
<register>
Add 1 to the contents of the register (ACC or IX)
JMP
<address>
Jump to the given address
CMP
#n
Compare the contents of ACC with number n
CMI
<address>
Indirect addressing. The address to be used is at the given address.
Compare the contents of ACC with the contents of this second
address
JPE
<address>
Following a compare instruction, jump to <address> if the compare
was True
JPN
<address>
Following a compare instruction, jump to <address> if the compare
was False
OUT
Output to the screen the character whose ASCII value is stored in
ACC
END
Return control to the operating system
<address> can be an absolute or a symbolic address
# denotes a denary number, e.g. #123
B denotes a binary number, e.g. B01001101
(a) The current contents of main memory and selected values from the ASCII character set are
given.
(i)
Trace the program currently in memory using the trace table.
Memory address
Instruction
Address
Instruction
ACC
IX
Output
address
100
101
110
111
112
LDR #0
75
LDD 100
76
1
0
97
98
97
CMP #2
77
JPE 91
78
LDX 110
79
SUB #32
80
CMP #65
81
JPN 86
82
LDM #1
83
ADD 101
84
STO 101
85
LDM #1
86
ADD 100
87
STO 100
88
INC IX
89
JMP 76
90
LDD 101
91
ADD #48
92
OUT
93
END
94
…
1
100
0
101
…
97
110
98
111
97
112
ASCII
Character
value
49
1
50
2
51
3
52
4
65
A
66
B
67
C
68
D
[4]
(ii)
Explain the purpose of relative addressing in an assembly language program.
…
…
…
… [2]
(b) The following table shows another part of the instruction set for the processor.
Instruction
Explanation
Opcode
Operand
AND
#n
Bitwise AND operation of the contents of ACC with the operand
AND
Bn
Bitwise AND operation of the contents of ACC with the binary number n
AND
<address>
Bitwise AND operation of the contents of ACC with the contents of <address>
XOR
#n
Bitwise XOR operation of the contents of ACC with the operand
XOR
<address>
Bitwise XOR operation of the contents of ACC with the contents of <address>
OR
#n
Bitwise OR operation of the contents of ACC with the operand
OR
Bn
Bitwise OR operation of the contents of ACC with the binary number n
OR
<address>
Bitwise OR operation of the contents of ACC with the contents of <address>
LSL
#n
Bits in ACC are shifted logically n places to the left. Zeros are introduced on
the right-hand end
LSR
#n
Bits in ACC are shifted logically n places to the right. Zeros are introduced on
the left-hand end
<address> can be an absolute or a symbolic address
# denotes a denary number, e.g. #123
B denotes a binary number, e.g. B01001101
(i)
The current contents of the ACC are:
0
0
1
1
0
1
1
0
Show t

32
9618/11/M/J/22 · Question 6May/June 2022Paper 1115 marks
Loading question…
Question text

6
(a) A computer system is designed using the basic Von Neumann model.
(i)
Describe the role of the registers in the Fetch-Execute (F-E) cycle.
…
…
…
…
…
…
…
…
…
… [5]
(ii)
Describe when interrupts are detected in the F-E cycle and how the interrupts are
handled.
Detected …
…
Handled …
…
…
…
…
…
…
…
…
…
[5]
(b) Identify one factor that can affect the performance of the computer system and state how it
impacts the performance.
Factor …
Impact …
…
…

33
9618/12/M/J/22 · Question 3May/June 2022Paper 129 marks
Loading question…
Question text

3
The table shows part of the instruction set for a processor. The processor has one general purpose
register, the Accumulator (ACC).
Instruction
Explanation
Opcode
Operand
AND
#n
Bitwise AND operation of the contents of ACC with the operand
Bitwise AND operation of the contents of ACC with the contents
AND
<address>
of <address>
XOR
#n
Bitwise XOR operation of the contents of ACC with the operand
Bitwise XOR operation of the contents of ACC with the contents
XOR
<address>
of <address>
OR
#n
Bitwise OR operation of the contents of ACC with the operand
Bitwise OR operation of the contents of ACC with the contents of
OR
<address>
<address>
<address> can be an absolute or a symbolic address
# denotes a denary number, e.g. #123
(a) The ACC currently contains the following positive binary integer:
0
1
1
0
0
1
0
1
Write the bit manipulation instruction that would change the binary integer in ACC to:
1
1
1
1
1
1
1
1
Opcode … Operand …
[2]
(b) The ACC currently contains the following positive binary integer:
0
1
1
0
0
1
0
1
Write the bit manipulation instruction that would change the binary integer in ACC to:
1
0
0
1
1
0
1
0
Opcode … Operand …
[2]
(c) Convert the following positive binary integer into hexadecimal.
0 1 1 1 1 1 1 0
… [1]
(d) A three-place logical shift to the left is performed on the following positive binary integer.
Show the result of this logical shift.
0 1 1 1 1 1 1 0
… [1]
(e) Convert the denary numbers 127 and 12 to 8-bit binary and then perform the subtraction
12 − 127 in binary.
Show your working.
127 in binary …
12 in binary …
12 − 127 in binary …
…
…
…
…
[3]

Advertisement
34
9618/13/M/J/22 · Question 2May/June 2022Paper 138 marks
Loading question…
Question text

2
(a) The Fetch-Execute (F-E) cycle is represented in register transfer notation.
Describe each of the given steps.
Step
Description
…
[PC] + 1
PC
…
…
…
[[MAR]]
MDR
…
…
…
[PC]
MAR
…
…
[3]
(b) Explain how interrupts are handled during the F-E cycle.
…
…
…
…
…
…
…
…
…
…
…
…
… [5]

35
9618/13/M/J/22 · Question 3May/June 2022Paper 1310 marks
Loading question…
Question text

3
(a) The table shows part of the instruction set for a processor. The processor has one general
purpose register, the Accumulator (ACC).
Instruction
Explanation
Opcode
Operand
LDM
#n
Immediate addressing. Load the number n to ACC
Direct addressing. Load the contents of the location at the
LDD
<address>
given address to ACC
Indirect addressing. The address to be used is at the given
LDI
<address>
address. Load the contents of this second address to ACC
<address> can be an absolute or symbolic address
# denotes a denary number, e.g. #123
The current contents of main memory are:
Address
101
100
67
101
104
102
100
103
68
104
Complete the table by writing the value stored in the accumulator after the execution of each
instruction.
Instruction
Accumulator
LDM #103
LDD 102
LDI 103
[3]
(b) The instructions in part (a) are examples of the data movement group.
Describe two other instruction groups.
1 …
…
…
…
2 …
…
…
…
[4]
(c) The table shows part of the instruction set for a processor. The processor has one general
purpose register, the Accumulator (ACC).
Instruction
Explanation
Opcode
Operand
AND
Bn
Bitwise AND operation of the contents of ACC with the operand
XOR
Bn
Bitwise XOR operation of the contents of ACC with the operand
OR
Bn
Bitwise OR operation of the contents of ACC with the operand
B denotes a binary number, e.g. B01001010
The binary value 00111101 is stored in the memory address 200.
Each instruction in the diagram is performed on the data in memory address 200.
Draw one line from each instruction to its correct result.
Instruction
Result
01111101
XOR B11110000
00111101
OR B01010101
11111111
11000010
AND B11111111
11001101
[3]

36
9618/11/O/N/21 · Question 6Oct/Nov 2021Paper 118 marks
Loading question…
Question text

6
(a) There are two errors in the following register transfer notation for the fetch‑execute cycle.
[PC]
1
MAR
[PC] − 1
2
PC
[MAR]
3
MDR
[MDR]
4
CIR
Complete the following table by:
•
identifying the line number of each error
•
describing the error
•
writing the correct statement.
Line
Description of the error
Correct statement
number
[4]
(b) The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Explanation
Opcode
Operand
LDM
#n
Immediate addressing. Load the number n to ACC
LDD
<address>
Direct addressing. Load the contents of the location at the given address to
ACC
STO
<address>
Store the contents of ACC at the given address
INC
<register>
Add 1 to the contents of the register (ACC or IX)
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
JMP
<address>
Jump to the given address
IN
Key in a character and store its ASCII value in ACC
OUT
Output to the screen the character whose ASCII value is stored in ACC
END
Return control to the operating system
XOR
#n
Bitwise XOR operation of the contents of ACC with the operand
XOR
<address>
Bitwise XOR operation of the contents of ACC with the contents of <address>
AND
#n
Bitwise AND operation of the contents of ACC with the operand
AND
<address>
Bitwise AND operation of the contents of ACC with the contents of <address>
OR
#n
Bitwise OR operation of the contents of ACC with the operand
OR
<address>
Bitwise OR operation of the contents of ACC with the contents of <address>
LSL
#n
Bits in ACC are shifted logically n places to the left. Zeros are introduced on
the right hand end
LSR
#n
Bits in ACC are shifted logically n places to the right. Zeros are introduced on
the left hand end
<address> can be an absolute or symbolic address
# denotes a denary number, e.g. #123
B denotes a binary number, e.g. B01001101
The current contents of main memory are shown:
Address
Data
100
00001111
101
11110000
102
01010101
103
11111111
104
00000000
Each row of the following table shows the current contents of ACC in binary and the instruction
that will be performed on those contents.
Complete the table by writing the new contents of the ACC after the execution of each
instruction.
Current contents of the ACC
Instruction
New contents of the ACC
11111111
OR 101
00000000
XOR #15
10101010
LSR #2
01010101
AND 104
[4]

37
9618/12/O/N/21 · Question 7Oct/Nov 2021Paper 1211 marks
Loading question…
Question text

7
A computer has system software.
(a) The Operating System handles interrupts.
Tick (  ) one box in each row to identify whether each event is an example of a hardware
interrupt or a software interrupt.
Event
Hardware interrupt
Software interrupt
Buffer full
Printer is out of paper
User has pressed a key on the keyboard
Division by zero
Power failure
Stack overflow
[3]
(b) Describe the file management tasks that an Operating System performs.
…
…
…
…
…
…
…
… [4]
(c) Identify two utility programs that can be used to improve the performance of a computer and
state how they improve the performance.
1 …
…
…
…
2 …
…
…
…
[4]

38
9618/12/O/N/21 · Question 8Oct/Nov 2021Paper 1215 marks
Loading question…
Question text

8
The Von Neumann model for a computer system uses registers.
(a) Describe the role of the following special purpose registers in the fetch-execute (F-E) cycle.
(i)
Memory Address Register (MAR) …
…
…
…
Memory Data Register (MDR) …
…
…
…
[4]
(ii)
Another special purpose register is the Index Register.
Identify one other special purpose register used in the Von Neumann model for a
computer system.
…
… [1]
(b) The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Explanation
Opcode
Operand
LDM
#n
Immediate addressing. Load the number n to ACC
LDD
<address>
Direct addressing. Load the contents of the location at the given address to
ACC
STO
<address>
Store the contents of ACC at the given address
INC
<register>
Add 1 to the contents of the register (ACC or IX)
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
JMP
<address>
Jump to the given address
IN
Key in a character and store its ASCII value in ACC
OUT
Output to the screen the character whose ASCII value is stored in ACC
END
Return control to the operating system
XOR
#n
Bitwise XOR operation of the contents of ACC with the operand
XOR
<address>
Bitwise XOR operation of the contents of ACC with the contents of <address>
OR
#n
Bitwise OR operation of the contents of ACC with the operand
Bitwise OR operation of the contents of ACC with the contents of <address>
OR
<address>
AND
#n
Bitwise AND operation of the contents of ACC with the operand
AND
<address>
Bitwise AND operation of the contents of ACC with the contents of <address>
Bits in ACC are shifted logically n places to the left. Zeros are introduced on
LSL
#n
the right hand end
Bits in ACC are shifted logically n places to the right. Zeros are introduced on
LSR
#n
the left hand end
<address> can be an absolute or symbolic address
# denotes a denary number, e.g. #123
The current contents of main memory are shown:
Address
Data
100
01010101
101
11110000
102
00001111
103
00000000
104
11111111
(i)
In the following table, each row shows the current contents of the ACC in binary and the
instruction that will be performed on those contents.
Complete the table by writing the new contents of the ACC after the execution of each
instruction.
Current contents of the ACC
Instruction
New contents of the ACC
01010101
XOR 101
11110000
AND 104
00001111
LSL #4
11111111
OR 102
[4]
(ii)
The following table contains five assembly language instruction groups.
Write an appropriate assembly language instruction for each ins

Advertisement
39
9618/11/M/J/21 · Question 3May/June 2021Paper 1113 marks
Loading question…
Question text

3
A processor has one general purpose register, the Accumulator (ACC), and several special
purpose registers.
(a) Complete the following description of the role of the registers in the fetch-execute cycle by
writing the missing registers.
The … holds the address of the next instruction
to be loaded. This address is sent to the … .
The … holds the data fetched from this address.
This data is sent to the … and the Control Unit
decodes the instruction’s opcode.
The … is incremented.
[5]
(b) The following table shows part of the instruction set for a processor. The processor has one
general purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Explanation
Opcode
Operand
LDM
#n
Immediate addressing. Load the number n to ACC
LDD
<address>
Direct addressing. Load the contents of the location at the given address to ACC
Indirect addressing: The address to be used is at the given address. Load the
LDI
<address>
contents of this second address to ACC
Indexed addressing. Form the address from <address> + the contents of the
LDX
<address>
Index Register. Copy the contents of this calculated address to ACC
LDR
#n
Immediate addressing. Load the number n to IX
MOV
<register>
Move the contents of the accumulator to the given register (IX)
STO
<address>
Store 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 (ACC or IX)
CMP
<address>
Compare the contents of ACC with the contents of <address>
JPE
<address>
Following a compare instruction, jump to <address> if the compare was True
JPN
<address>
Following a compare instruction, jump to <address> if the compare was False
JMP
<address>
Jump to the given address
OUT
Output to the screen the character whose ASCII value is stored in ACC
END
Return control to the operating system
Bits in ACC are shifted logically n places to the left. Zeros are introduced on
LSL #n
the right hand end
Bits in ACC are shifted logically n places to the right. Zeros are introduced on
LSR #n
the left hand end
<address> can be an absolute address or a symbolic address
# denotes a denary number, e.g. #123
The current contents of the main memory and selected values from the ASCII character set
are shown.
Address
Instruction
ASCII code table (selected codes only)
200 LDD 365
ASCII code
Character
201 CMP 366
65
A
202 JPE 209
66
B
203 INC ACC
67
C
204 STO 365
68
D
205 MOV IX
206 LDX 365
207 OUT
208 JMP 200
209 END
…
365 1
366 3
367 65
368 66
IX 0
Complete the trace table for the program currently in main memory.
Memory address
Instruction
IX
Output
ACC
address
365
366
367
368
1
3
65
66
0
[6]
(c) (i)
The Accumulator currently contains the binary number:
0
0
1
1
0
1
0
1
Write the contents of the Accumulator after the processor has executed the following
instruction:
LSL #2
[1]
(ii)
The Accumulator currently contains the binary number:
0
0
1
1
0
1
0
1
Identify the mathematical operation that the following instruction will perform on the
contents of the accumulator.
LSR #3
…
… [1]

40
9618/12/M/J/21 · Question 4May/June 2021Paper 128 marks
Loading question…
Question text

4
The table shows part of the instruction set for a processor. The processor has one general purpose
register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Explanation
Opcode
Operand
LDM #n
Immediate addressing. Load the number n to ACC
Direct addressing. Load the contents of the location at the given address to
LDD <address>
ACC
STO <address>
Store 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 (ACC or IX)
DEC <register>
Subtract 1 from the contents of the register (ACC or IX)
CMP <address>
Compare the contents of ACC with the contents of <address>
JPE <address>
Following a compare instruction, jump to <address> if the compare was True
JPN <address>
Following a compare instruction, jump to <address> if the compare was False
JMP <address>
Jump to the given address
IN
Key in a character and store its ASCII value in ACC
OUT
Output to the screen the character whose ASCII value is stored in ACC
END
Return control to the operating system
# denotes a denary number, e.g. #123
The current contents of the main memory and selected values from the ASCII character set are:
Address
Instruction
ASCII code table (selected codes only)
70
IN
ASCII code
Character
71
CMP 100
65
A
72
JPE 80
66
B
73
CMP 101
67
C
74
JPE 76
68
D
75
JMP 80
76
LDD 102
77
INC ACC
78
STO 102
79
JMP 70
80
LDD 102
81
DEC ACC
82
STO 102
83
JMP 70
…
100 68
101 65
102 100
(a) Complete the trace table for the program currently in main memory when the following
characters are input:
A D
Do not trace the program any further when the third input is required.
Memory address
Instruction
ACC
address
100
101
102
68
65
100
[4]
(b) Some bit manipulation instructions are shown in the table:
Instruction
Explanation
Opcode
Operand
AND #n
Bitwise AND operation of the contents of ACC with the operand
AND <address>
Bitwise AND operation of the contents of ACC with the contents of <address>
XOR #n
Bitwise XOR operation of the contents of ACC with the operand
XOR <address>
Bitwise XOR operation of the contents of ACC with the contents of <address>
OR #n
Bitwise OR operation of the contents of ACC with the operand
OR <address>
Bitwise OR operation of the contents of ACC with the contents of <address>
<address> can be an absolute address or a symbolic address
# denotes a denary number, e.g. #123
The contents of the memory address 300 are shown:
7
6
5
4
3
2
1
0
Bit Number
300
0
1
1
0
0
1
1
0
(i)
The contents of memory address 300 represent an unsigned binary integer.
Write the denary value of the unsigned binary integer in memory address 300.
… [1]
(ii)
An assembly language program needs to test if bit number 2 in memory address 300
is a 1.
Complete the assembly language instruction to perform this test.
… #4
[1]
(iii)
An assembly language program needs to set bit numbers 4, 5, 6 and 7 to 0, but keep
bits 0 to 3 with their existing values.
Write the assembly language instruction to perform this action.
…
… [2]

Advertisement