System software: operating systems, virtual machines and translation – A Level Computer Science (old syllabus, to 2021) (9608)
9 questions · Clear filters
Question text
5
Complete these three statements about computer processors.
A processor with a few simple fixed-length instructions that have a small number of instruction
formats is called a … processor.
A processor with many complex variable-length instructions that has many instruction formats is
called a … processor.
Instruction-level parallelism, applied to the execution of instructions during the fetch-execute cycle,
is called … .
[3]
Question text
6
Duraid writes a short program in a high-level programming language. An interpreter executes the
program.
The following is part of Duraid’s program.
DECLARE P, Q, R, X, Y : INTEGER
CONSTANT M = 10
P
=
4
Q
=
2
R
=
1
X
=
(P + Q) * (P – Q)
Y
=
(M / Q) * (P + Q - R)
(a) Write the Reverse Polish Notation (RPN) for the following expression from Duraid’s program.
(P + Q) * (P – Q)
… [2]
(b) The interpreter is executing Duraid’s program. The expressions are in infix form.
The interpreter converts the infix to RPN.
The RPN expression for Y is:
M Q / P Q + R − *
The interpreter evaluates this RPN expression using a stack.
(i)
Show the changing contents of the stack, as the interpreter evaluates the expression
for Y.
Use the values of the variables and constant given in the program. The first entry has
been done for you.
10
[4]
(ii)
Convert the following RPN expression back to its infix form.
P Q + M * R P − −
…
… [2]
(c) Explain how RPN is used by an interpreter to evaluate expressions.
…
…
…
… [2]
Question text
7
A computer at a remote weather station is performing three tasks:
•
measuring and recording the temperature every 10 seconds
•
measuring and recording the wind speed every 10 seconds
•
sending the previous day’s temperature and wind speed readings to a scientist at another
location via the Internet.
The operating system is managing the multitasking of these tasks.
(a) At one point in time:
•
the temperature measuring and recording task is idle
•
the wind speed is being recorded
•
the task to send the previous day’s temperature and wind speed readings is waiting for
an internet connection.
Identify the process state for each task. Give a reason why each task is in that process state.
Temperature measuring and recording process state …
Reason …
…
…
Wind speed measuring and recording process state …
Reason …
…
…
Sending process state …
Reason …
…
…
[6]
(b) The weather station computer uses an operating system.
Explain how this operating system uses interrupts to schedule the measuring and recording
tasks.
…
…
…
…
…
…
…
… [4]
Question text
4
A compiler uses a keyword table and a symbol table. Part of the keyword table is shown.
•
Tokens for keywords are shown in hexadecimal.
•
All of the keyword tokens are in the range 00 – 5F.
Keyword
Token
01
+
02
=
03
<>
04
IF
4A
THEN
4B
ENDIF
4C
ELSE
4D
REPEAT
4E
UNTIL
4F
TO
50
INPUT
51
OUTPUT
52
ENDFOR
53
Entries in the symbol table are allocated tokens. These values start from 60 (hexadecimal).
Study the following piece of pseudocode.
0
Counter
INPUT Password
REPEAT
IF Password <> "Cambridge"
THEN
INPUT Password
ENDIF
Counter + 1
Counter
UNTIL Password = "Cambridge"
OUTPUT Counter
(a) Complete the symbol table to show its contents after the lexical analysis stage.
Token
Symbol
Value
Type
60
Variable
Counter
[3]
(b) The output from the lexical analysis stage is stored in the following table. Each cell stores one
byte of the output.
Complete the output from the lexical analysis using the keyword table and your answer to
part (a).
60 01
[2]
(c) The following table shows assembly language instructions for a processor which has one
general purpose register, the Accumulator (ACC).
Instruction
Explanation
Op code
Operand
Direct addressing. Load the contents of the location at the given
LDD
<address>
address to ACC
Add the contents of the given address to the ACC
ADD
<address>
Store the contents of ACC at the given address
STO
<address>
After the syntax analysis is completed successfully, the compiler generates object code.
The following lines of high level language code are compiled.
X = X + Y
Z = Z + X
The compilation produces the assembly language code as follows:
LDD
236
ADD
237
STO
236
LDD
238
ADD
236
STO
238
(i)
The final stage in the compilation process that follows this code generation stage is code
optimisation.
Rewrite the equivalent code after optimisation.
…
…
…
…
…
… [3]
(ii)
Explain why code optimisation is necessary.
…
…
…
… [2]
Question text
4
(a) Describe the main steps in the evaluation of a Reverse Polish Notation (RPN) expression
using a stack.
…
…
…
…
…
…
…
… [4]
(b) The infix expression 8 * (5 – 2) – 30 / (2 * 3) converts to:
8 5 2 – * 30 2 3 * / –
in Reverse Polish Notation (RPN).
Show the changing contents of the stack as this RPN expression is evaluated.
[4]
Question text
8
(a) A computer process can be in one of three states.
Identify and describe two of these states.
State 1 …
Description …
…
…
State 2 …
Description …
…
…
[6]
(b) One of the main tasks of an operating system is resource management.
Describe how an operating system can maximise the use of resources.
Primary memory …
…
…
…
…
…
Disk …
…
…
…
…
…
[6]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Question text
5
The following syntax diagrams show the syntax of:
•
an assignment statement
•
a variable
•
a signed integer
•
a letter
•
a digit
•
an operator
assignment statement
operator
variable
variable
signed integer
=
variable
letter
letter
signed integer
digit
+
-
letter
x
y
z
digit
operator
1
˄
2
\
3
4
5
(a) The following assignment statements are invalid.
Give the reason in each case.
(i)
xy = xy ^ c4
Reason …
… [1]
(ii)
zy = zy \ 10
Reason …
… [1]
(iii)
yy := xz ^ − 6
Reason …
… [1]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams on the opposite page.
<assignment statement> ::=
…
<variable> ::=
…
<signed integer> ::=
…
<operator> ::=
…
[4]
(c) Rewrite the BNF rule for a variable so that it can be any number of letters.
<variable> ::=
… [2]
Question text
2
The following syntax diagrams show the syntax of:
•
an assignment statement
•
a variable
•
an unsigned integer
•
a letter
•
a digit
•
an operator
assignment statement
;
operator
variable
variable
variable
=
variable
letter
unsigned integer
unsigned integer
digit
letter
A
B
C
digit
operator
+
1
2
-
3
*
4
/
5
(a) The following assignment statements are invalid.
Give the reason in each case.
(i)
A
=
B
+
5;
Reason …
… [1]
(ii)
A
=
B
−
D;
Reason …
… [1]
(iii)
C4
=
B2 − A1 + C3;
Reason …
… [1]
(b) Complete the Backus-Naur Form (BNF) for the syntax diagrams shown on the opposite page.
<assignment statement> ::=
…
<variable> ::=
…
<unsigned integer> ::=
…
<operator> ::=
…
[6]
(c) The syntax of variable is changed to allow one or more letters followed by an unsigned
integer.
Draw a syntax diagram for the new syntax of the variable.
[3]
Question text
3
(a) The following diagram shows how applications X, Y and Z can run on a virtual machine
system.
Application X
Application Y
Application Z
Guest operating
Guest operating system 1
system 2
Virtual machine software / virtual machine monitor
Host operating system
Hardware
(i)
The virtual machine software undertakes many tasks.
Describe two of these tasks.
Task 1 …
…
Task 2 …
… [2]
(ii)
Explain the difference between a guest operating system and a host operating
system.
…
…
…
… [2]
(b) A company uses a computer as a web server. The manufacturer will no longer support the
computer’s operating system (OS) in six months’ time. The company will then need to decide
on a replacement OS.
The company is also considering changing the web server software when the OS is changed.
Whenever any changes are made, it is important that the web server service is not disrupted.
In developing these changes, the company could use virtual machines.
(i)
Describe two possible uses of virtual machines by the company.
Use 1 …
…
…
…
Use 2 …
…
…
… [4]
The web server often has to handle many simultaneous requests.
(ii)
The company uses a virtual machine to test possible solutions to the changes that they
will need to make.
Explain one limitation of this approach.
…
…
…
… [2]