System software: operating systems, virtual machines and translation – A Level Computer Science (old syllabus, to 2021) (9608)

10 questions

0 / 0Answer a question to start your score.
New quizSaved 0

Quick quiz: 10 random questions from this topic. Answer them all, then open the Summary.

Advertisement
1
9608/32/O/N/16 · Question 2Oct/Nov 2016Paper 3214 marks
Loading question…
Question text

2
There are four stages in the compilation of a program written in a high-level language.
(a) Four statements and four compilation stages are shown below.
Draw a line to link each statement to the correct compilation stage.
Statement
Compilation stage
This stage can improve the time
Lexical analysis
taken to execute the statement:
x = y + 0
This stage produces object
Syntax analysis
code.
This stage makes use of tree
Code generation
data structures.
This stage enters symbols in
Optimisation
the symbol table.
[4]
(b) Write the Reverse Polish Notation (RPN) for the following expression.
P + Q – R / S
… [2]
(c) An interpreter is executing a program. The program uses the variables a, b, c and d.
The program contains an expression written in infix form. The interpreter converts the infix
expression to RPN. The RPN expression is:
b a * c d a + + -
The interpreter evaluates this RPN expression using a stack.
The current values of the variables are:
a = 2
b = 2
c = 1
d = 3
(i)
Show the changing contents of the stack as the interpreter evaluates the expression.
The first entry on the stack has been done for you.
2
[4]
(ii) Convert back to its original infix form, the RPN expression:
b a * c d a + + -
…
… [2]
(iii)
One advantage of using RPN is that the evaluation of an expression does not require
rules of precedence.
Explain this statement.
…
…
…
… [2]

2
9608/31/O/N/20 · Question 5Oct/Nov 2020Paper 314 marks
Loading question…
Question text

5
Complete these statements about a virtual machine.
A virtual machine is … that emulates a
… computer system.
A virtual machine allows multiple … operating systems to run
on one computer using a … operating system.
[4]

3
9608/32/M/J/18 · Question 2May/June 2018Paper 3212 marks
Loading question…
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]

Advertisement
4
9608/32/O/N/19 · Question 4Oct/Nov 2019Paper 329 marks
Loading question…
Question text

4
Physical memory is managed using virtual memory and paging.
(a) Describe what is meant by virtual memory.
…
…
…
… [2]
(b) (i)
Explain how paging is used to manage virtual memory.
…
…
…
…
…
…
…
… [4]
(ii)
Give a suitable page replacement algorithm for this process.
… [1]
(iii)
One drawback of using virtual memory is disk thrashing.
Describe what is meant by the term disk thrashing.
…
…
…
… [2]

5
9608/31/O/N/19 · Question 6Oct/Nov 2019Paper 3110 marks
Loading question…
Question text

6
(a) An operating system (OS) uses a memory management technique called paging.
Explain what is meant by the following terms.
Page …
…
…
Page frame …
…
…
Page table …
…
…
[3]
(b) Explain why an operating system needs to use scheduling algorithms.
…
…
…
…
…
… [3]
(c) State what is meant by an interrupt.
…
… [1]
(d) For a computer system using multi-programming, the low-level scheduler decides which
process will get next use of the processor.
One algorithm could be a round-robin, which means every process gets use of the processor
in sequence for a fixed amount of time (time-slice).
For a round-robin algorithm, five processes are currently loaded and get the use of the
processor in the sequence:
JOB21 – JOBSS – JOBPT – JOB32 – JOB42, then return to JOB21
Process JOB32 has just completed its time-slice.
The following paragraph describes what happens next. Complete the paragraph by inserting
the missing processes.
Interrupt
received
from
the
low-level
scheduler.
Save
all
register
contents
for
… .
Copy the saved registers for … to the CPU.
The processor will now process … .
[3]

6
9608/31/O/N/21 · Question 5Oct/Nov 2021Paper 3112 marks
Loading question…
Question text

5
(a) Flora has written a program that uses the variables a, b, c and d.
Part of the program contains the following calculations:
a
=
2
b
=
5
c
=
7
d
=
a * b – (a + b + c)
(i)
Write the Reverse Polish Notation (RPN) for the expression:
a * b – (a + b + c)
… [2]
(ii)
Show the changing contents of the stack as the value for variable d is calculated from
the RPN expression.
[4]
(b) Convert the following RPN expression back to its original infix form.
d b * b c d + - + a /
…
…
…
…
… [3]
(c) Explain why expressions are evaluated using RPN.
…
…
…
…
…
… [3]

7
9608/32/O/N/19 · Question 7Oct/Nov 2019Paper 329 marks
Loading question…
Question text

7
The following are the first few lines of a source code program written in a high-level language. The
source code program is to be translated by the language compiler.
// program written on 15 June 2019
DECLARE IsFound : Boolean;
DECLARE NoOfChildren : Integer;
DECLARE Count : Integer;
Constant TaxRate = 15;
// start of main program
For Count = 1 to 50
…
…
…
(a) During the lexical analysis stage, the compiler will use a keyword table and a symbol table.
(i)
Identify two types of data in the keyword table.
Type 1 …
Type 2 …
[2]
(ii)
Identify two types of data in the symbol table.
Type 1 …
Type 2 …
[2]
(iii)
Explain how the contents of the keyword and symbol tables are used to translate the
source code program.
…
…
…
… [2]
(iv)
State one additional task completed at the lexical analysis stage that does not involve
the use of a keyword or a symbol table.
…
… [1]
(b) The final stage of compilation can be code optimisation.
Explain why code is optimised.
…
…
…
… [2]

8
9608/32/O/N/21 · Question 7Oct/Nov 2021Paper 324 marks
Loading question…
Question text

7
A virtual machine is the software emulation of a computer system using another computer system.
Describe two benefits and two limitations of using a virtual machine.
Benefit 1 …
…
…
Benefit 2 …
…
…
Limitation 1 …
…
…
Limitation 2 …
…
…
[4]

Advertisement
9
9608/32/O/N/20 · Question 6Oct/Nov 2020Paper 3210 marks
Loading question…
Question text

6
Mahmoud is developing a new application, MyApp, that needs to work with three different
operating systems (OS1, OS2 and OS3).
He has decided to use virtual machine software to test MyApp with these three different operating
systems.
The diagram shows MyApp running on three virtual machines.
MyApp
MyApp
MyApp
OS1
OS2
OS3
Virtual machine software
OS4
Hardware
(a) Describe the roles of the four operating systems (OS1, OS2, OS3 and OS4) shown in the
diagram.
…
…
…
…
… [3]
(b) Describe the role of the virtual machine software in the testing of MyApp.
…
…
…
…
…
… [3]
(c) Explain one benefit and one drawback of this approach to testing MyApp.
Benefit …
…
…
…
Drawback …
…
…
…
[4]

10
9608/31/O/N/18 · Question 5Oct/Nov 2018Paper 3111 marks
Loading question…
Question text

5
A computer process can be in one of three states: running, ready or blocked.
(a) Explain how the processes are affected when the following events take place.
(i)
The running process needs to read a file from a disk.
…
…
…
… [2]
(ii)
The running process uses up its time slice.
…
…
…
… [2]
(b) (i)
State the conditions that are necessary for a process to move from the ready to the
running state.
…
…
…
… [2]
(ii)
State the conditions that are necessary for a process to move from the blocked to the
ready state.
…
…
…
… [2]
(c) Give three reasons why process scheduling is needed.
1 …
…
2 …
…
3 …
…
[3]

Advertisement