Computer Science (9608) · Oct/Nov 2016 · Question paper 31

Cambridge Computer Science (9608) question paper for paper 31, Oct/Nov 2016 — 9608/31/O/N/16, file 9608_w16_qp_31.pdf.

Advertisement
Loading the paper…
Text of this paper

www.dynamicpapers.com

Cambridge International Examinations
Cambridge International Advanced Level

* 2 1 5 5 3 9 6 6 5 3 *

9608/31

COMPUTER SCIENCE
Paper 3 Advanced Theory

October/November 2016
1 hour 30 minutes

Candidates answer on the Question Paper.
No Additional Materials are required.
No calculators allowed.
READ THESE INSTRUCTIONS FIRST
Write your Centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.
Answer all questions.
No marks will be awarded for using brand names of software packages or hardware.
At the end of the examination, fasten all your work securely together.
The number of marks is given in brackets [ ] at the end of each question or part question.
The maximum number of marks is 75.

This document consists of 11 printed pages and 1 blank page.
DC (NF/AR) 116626/4
© UCLES 2016

[Turn over

www.dynamicpapers.com
2
1

In a particular computer system, real numbers are stored using floating-point representation with:
•
•
•

12 bits for the mantissa
4 bits for the exponent
two’s complement form for both mantissa and exponent

(a) Calculate the floating-point representation of + 2.5 in this system. Show your working.
Mantissa

Exponent

•

[3]
(b) Calculate the floating-point representation of − 2.5 in this system. Show your working.
Mantissa

Exponent

•

[3]

© UCLES 2016

9608/31/O/N/16

www.dynamicpapers.com
3
(c) Find the denary value for the following binary floating-point number. Show your working.
Mantissa
0

•0

1

1

0

0

0

Exponent
0

0

0

0

0

0

0

1

1

[3]
(d) (i)

State whether the floating-point number given in part (c) is normalised or not normalised.
[1]

(ii)

Justify your answer given in part (d)(i).

[1]

(e) The system changes so that it now allocates 8 bits to both the mantissa and the exponent.
State two effects this has on the numbers that can be represented.
1

2
[2]

© UCLES 2016

9608/31/O/N/16

[Turn over

www.dynamicpapers.com
4
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 removes any
comments in the program
source code.

Lexical analysis

This stage could be
ignored.

Syntax analysis

This stage checks the
grammar of the program
source code.

Code generation

This stage produces a
tokenised version of the
program source code.

Optimisation

[4]
(b) Write the Reverse Polish Notation (RPN) for the following expressions.
(i)

(A + B) * (C − D)
[2]

(ii)

− A / B * 4 / (C − D)
[3]

© UCLES 2016

9608/31/O/N/16

www.dynamicpapers.com
5
(c) An interpreter is executing a program. The program uses the variables w, x, y and z.
The program contains an expression written in infix form. The interpreter converts the infix
expression to RPN. The RPN expression is:
x w z + y − *
The interpreter evaluates this RPN expression using a stack.
The current values of the variables are:
w = 1

(i)

x = 2

y = 3

z = 4

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:
x w z + y − *

[2]

(iii)

Explain one advantage of using RPN for the evaluation of an expression.

[2]

© UCLES 2016

9608/31/O/N/16

[Turn over

www.dynamicpapers.com
6
3

A computer operating system (OS) uses paging for memory management.
In paging:
•
•
•

main memory is divided into equal-size blocks, called page frames
each process that is executed is divided into blocks of the same size, called pages
each process has a page table that is used to manage the pages of this process

The following table is the incomplete page table for a process X.
Page

Presence
flag

Page frame address

1

1

132

2

1

245

3

1

232

4

0

0

5

1

542

6

0

0

135

0

0

Additional data

When a particular page of the process is currently in main memory, the Presence flag entry in the
page table is set to 1.
If the page is not currently present in memory, the Presence flag is set to 0.
(a) The page frame address entry for Page 2 is 245.
State what the value 245 could represent.
[1]

(b) Process X executes until the next instruction is the first instruction in Page 4. Page 4 is not
currently in main memory.
State a hardware device that could be storing this page.
[1]

© UCLES 2016

9608/31/O/N/16

www.dynamicpapers.com
7
(c) When an instruction to be accessed is not present in main memory, its page must be loaded
into a page frame. If all page frames are currently in use, the contents of a page frame will be
overwritten with this new page.
The page that is to be replaced is determined by a page replacement algorithm.
One possible algorithm is to replace the page that has been resident in main memory for the
longest time.
(i)

Give the additional data that would need to be stored in the page table.

[1]

(ii)

Complete the table entries below to show what happens when Page 4 is swapped into
main memory. Assume that Page 5 is the one to be replaced.
In the final column, give an example of the data you have identified in part (c)(i).

Page

4

Presence
flag

Page frame address

Additional data

[3]
An alternative algorithm is to replace the page that has been used least.
(iii)

Give the different additional data that the page table would now need to store.

[1]

(iv)

In the following table, complete the missing data to show what happens when Page 3 is
swapped into main memory. Assume that Page 1 is the one to be replaced.
In the final column, give an example of the data you have identified in part (c)(iii).

Page

3

© UCLES 2016

Presence
flag

Page frame address

Additional data

9608/31/O/N/16

[3]
[Turn over

www.dynamicpapers.com
8
(d) Explain why the algorithms given in part (c) may not be the best choice for efficient memory
management.
Longest resident

Least used

[4]

4

(a) (i)

Complete the truth table for this logic circuit.
Input

X

A

Y

B

X
0
0
1
1

Y
0
1
0
1

Output
A
B

[2]
(ii)

State the name given to this logic circuit.
[1]

(iii)

Name the labels usually given to A and B.
Label A
Label B
Explain why your answers are more appropriate for the A and B labels.

[4]

© UCLES 2016

9608/31/O/N/16

www.dynamicpapers.com
9
(b) (i)

Write the Boolean expression corresponding to the following logic circuit:

A
B
X

C
[2]
(ii)

Use Boolean algebra to simplify the expression that you gave in part (b)(i).
Show your working.

[3]

© UCLES 2016

9608/31/O/N/16

[Turn over

www.dynamicpapers.com
10
5

The TCP/IP protocol suite can be viewed as a stack with four layers.
(a) (i)

Complete the stack by inserting the names of the three missing layers.

Transport

[3]
(ii)

State how each layer of the stack is implemented.
[1]

(b) A computer is currently running two processes:
•
•

Process 1 is downloading a web page.
Process 2 is downloading an email.

(i)

Describe two tasks that the Transport layer performs to ensure that the incoming data is
downloaded correctly.
1

2

[4]
(ii)

Name a protocol that will be used by Process 1.
[1]

(iii)

Name a protocol that will be used by Process 2.
[1]

© UCLES 2016

9608/31/O/N/16

www.dynamicpapers.com
11
6

(a) The table below gives descriptions of three types of malware.
Description

Term

Malware that attaches itself to another program.
Malware that redirects the web browser to a fake website.
Email that encourages the receiver to access a website and
give their banking details.
Complete the table by adding the correct terms.

[3]

(b) Ben wants to send a highly confidential email to Mariah so that only she can read it. Plain text
and cipher text will be used in this communication.
(i)

Explain the terms plain text and cipher text.
Plain text

Cipher text
[2]

(ii)

Explain how the use of asymmetric key cryptography ensures that only Mariah can read
the email.

[4]

© UCLES 2016

9608/31/O/N/16

www.dynamicpapers.com
12
BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable
effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the 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 International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local
Examinations Syndicate (UCLES), which is itself a department of the University of Cambridge.

© UCLES 2016

9608/31/O/N/16

Advertisement