Monday, 24 April 2017 2.00 ppm – 4.00 pm (Duration: 2 hours)
DEGREES OF MSc, MSci, MEng, BEng, BSc,MA and MA (Social Sciences)
System and Networks Answer ALL Questions
This examination paper is worth a total of 60 marks
The use of a calculator is not permitted in this examination
INSTRUCTIONS TO INVIGILATORS
Please collect all exam question papers and exam answer scripts
and retain for school to collect. Candidates must not remove exam question papers.
1. (a)
In a 16-bit two’s complement code what are the codewords for:
- 255
- -255
Express your answers in hexadecimal.
(b) What is meant by an overflow in a numeric code? Give an example of an addition that overflows in the 16-bit two’s complement code but not in the 16-bit unsigned code.
[3] [2]
[2]
[7] [2]
[4]
(c) Suppose the Sigma16 instruction MUL R1, R2,R3 is executed with $FFFF in R2. Recalling that MUL works exclusively with two’s complement numbers, what are the smallest (most negative) and largest (most positive) values that R3 can contain which will NOT produce an overflow?
(d) A Sigma16 system has an array X of n 16-bit signed numbers in memory. Write an assembly language program to add the absolute values of all elements in X storing the result in a variable ABSUM.
(Note that the absolute value of a number, x, is equal to x, if x ≥ 0, but equal to -x if x < 0.)
- (e) Would your program work for all two’s complement array elements?
- (f) What is the maximum value that ABSUM can have without overflow occurring? What is the maximum value that can be added to ABSUM at any one time? Given that Sigma16 does not detect unsigned or signed overflows, using these facts or otherwise, devise a test that a programmer could use to determine whether overflow has occurred or not? (Describe what you would test for, but do not write the code).
For reference, this is part of the instruction set of the Sigma16 CPU.
lea load store add sub mul div cmplt cmpeq cmpgt inv jumpf jumpt jal trap jump
Rd, x[Ra] Rd, x[Ra] Rd, x[Ra] Rd,Ra,Rb Rd,Ra,Rb Rd,Ra,Rb Rd,Ra,Rb Rd,Ra,Rb Rd,Ra,Rb Rd,Ra,Rb Rd,Ra,Rb Rd, x[Ra] Rd, x[Ra] Rd, x[Ra] Rd,Ra,Rb x[Ra]
Rd:= x +Ra
Rd:= mem[x +Ra] mem[x +Ra]:=Rd
Rd:= Ra+Rb
Rd:= Ra-Rb
Rd:= Ra*Rb
Rd:= Ra/Rb
Rd:= Ra<Rb
Rd:= Ra=Rb
Rd:= Ra>Rb
Rd:= NOT Ra
If Rd=0 then PC:=x+Ra If Rd<>0 then PC:=x+Ra Rd:= pc, pc: =x +Ra PC:= interrupt handler PC:= x +Ra
CONTINUED OVERLEAF
Page 1
2 (a)
(b)
(c)
(d)
3. (a)
(b) (c)
(d)
(d)
Explain the difference between a memory cycle and an instruction cycle. Explain also how the two ideas are related.
The following Sigma16 instructions have the same effect:
LEA R1,0[R0]; ADD R1,R0,R0.
Using your knowledge of Sigma16, give two reasons why the second might be preferable to the first and justify your answer.
[4]
With the aid of a diagram, identify the main components of a von Neumann CPU, their function and how they are connected.
[6]
[6]
With reference to the components identified in (c) outline the sequence of events involved in the execution of the instruction: LOAD R1,5[R2].
What is meant by the term packet switching? Give two reasons why most packet protocols limit packet size?
[4]
[4]
[5]
[1]
What is the difference between a switched and a broadcast network? Give one advantage of each.
How do IP packets inform routers of their intended destinations? Explain how the packets are then forwarded and how the mechanism to achieve this adapts to changing conditions in the Internet.
Give one reason why attempting to adapt the routing mechanism to changing Internet conditions, as suggested in (c), might cause a problem.
What difficulties might be encountered in using IP to carry streamed video and how might these be overcome? Discuss additional difficulties that might apply to IP based telephone conversations and to IP remote control of a robot vehicle? In each case suggest what might be done to tackle the difficulties you identify.
[6]
[4]
END OF EXAMINATION PAPER Page 2