University of Nottingham Ningbo China
School of Computer Science
A Level 1 Module, Autumn Semester 2019–2020 Systems and Architecture (COMP1040)
Time Allowed: TWO Hours
Candidates may complete the front cover of their answer book and sign their desk card but must NOT write anything else until the start of the examination period is announced
Answer ALL questions
Total Marks: 100
No calculators are permitted in this examination
Dictionaries are not allowed with one exception. Those whose first language is not English may use a standard translation dictionary to translate between that language and English provided that neither language is the subject of this examination. Subject-specific
translation dictionaries are not permitted.
No electronic devices capable of storing and retrieving text, including electronic dictionaries, may be used.
DO NOT turn examination paper over until instructed to do so
ADDITIONAL MATERIAL: MIPS Reference Card INFORMATION FOR INVIGILATORS:
Collect both the exam papers and the answer booklets at the end of the exam.
COMP1040-E2 1 Turn Over
COMP1040-E2
Question 1 (25 marks)
(a) Convert the following decimal numbers to binary in 8-bit two’s complement representa- tion:
a = 110 b = 81 c = −30 (6)
(b) Using the values in the question above, calculate using signed 8-bit two’s complement
format the following sums:
a+b b+c a−c
In which case does an overflow occur? (4)
(c) Convert the following 8-bit two’s complement integers into decimal.
a = 100010002 b = 010011002 c = 111111102 (4)
(d) Work out the decimal value of the following single-precision floating point number.
1001.101112 (4)
(e) Convert the following decimal number to the IEEE 754 single-precision floating point
form in binary format.
a = 49.0625 (7)
COMP1040-E2 2
COMP1040-E2
Question 2 (25 marks)
(a) Refer to the following MIPS assembly code and answer the questions below: (5)
addi $s0, $0, 0
addi $t0, $0, 3
beq $s0, $t0, done
lw $s1, $s5, 4($s3)
add $t3, $s1, $s0
sub $t8, $t1, $t6
or $t6, $t3, $t1
addi $s0, $s0, 1
Find the number of executed instructions of the above code under these types:
Unconditional jumps = Conditional jumps =
(b) Consider three different processors P1, P2, and P3 executing the same program A. P1 has 3 GHz clock frequency and CPI of 1.5; P2 has 2.5 GHz clock frequency and CPI of 1.0; P3 has 4.0 GHz clock frequency and CPI of 2.2.
(i) Which processor executes A in the shortest time? (3)
(ii) For P3, we are trying to reduce the execution time by 30% but this leads to an increase of 20% in the CPI. What new clock frequency for P3 is needed to obtain this reduction in execution time? (3)
(iii) Assume running another program B, for arithmetic instructions, load/store instruc-
tions, and branch instructions, the CPIs are 1, 12, and 5 on P2, respectively. Also
assume program B is compiled into 5 million instructions, including 60% arithmetic
instructions, 30% load/store instructions, and 10% branch instructions. Find the
average CPI and calculate the total execution time of program B on P2. The
frequency for P2 remains 2.5 GHz. (Hint: CPI avg = #Cycletotal ) (4) #Instructionstotal
COMP1040-E2 3 Turn Over
程序代写 CS代考 加微信: cstutorcs
COMP1040-E2
(c) Convert the following high-level code into MIPS assembly. Assume the a is an array containing 4 elements, and the base address for a is stored in register $s0. The instruc- tions that you can choose are: add, sub, sll, sra, addi, lw, sw, j, beq, bne, slt.
for (i=1; i<5; i++)
a[i] = i + 8;
COMP1040-E2 4
程序代写 CS代考 加QQ: 749389476
COMP1040-E2
Question 3 (25 marks)
(i) All communication over User Datagram Protocol (UDP) is encrypted using the checksum option. (1)
(ii) Transmission Control Protocol (TCP) can be implemented over datagram packet delivery. (1)
(iii) In socket programming, the same TCP server may receive messages on more than one Internet address. (1)
(iv) Under UDP, messages that are transmitted must be shorter than the Maximum Transfer Unit (MTU) of the underlying network. (1)
(v) Ethernet is based on circuit switching. (1)
(vi) Every computer may have at most one IP address on the internet. (1)
(vii) Under UDP, there are provisions for controlling congestion of the network. (1)
(b) Of the transport layer protocols, we discussed UDP and TCP:
(i) Write down one feature provided by UDP which is not provided by Internet Pro- tocol (IP). (2)
(ii) Write down two guarantees provided by TCP which are not provided by UDP. (4)
(c) We discussed a few switching schemes in this course:
(i) Which switching scheme is used in wireless networking? (1)
(ii) Which switching scheme is used in Asynchronous Transfer Mode (ATM)? (1)
(iii) Write down one advantage of circuit switching over packet switching. (2)
(iv) Explain briefly (in fewer than 50 words) why communication over the internet is primarily based on packet switching rather than circuit switching. (4)
(d) In computer networking, long messages are divided into packets of restricted lengths before transmission. Write down two reasons why packets of restricted lengths are used in computer networking. (4)
COMP1040-E2 5 Turn Over
Programming Help
COMP1040-E2
Question 4 (25 marks)
(a) Consider a client-server system with the following performance assumptions:
Latency per packet (local or remote, incurred on both send and receive)
5 milliseconds
Connection setup time (TCP only) Data transfer rate
Maximum Transfer Unit (MTU) Server request processing time
7 milliseconds
8 megabits per second 1500 bytes
2 milliseconds
The client sends a 200 byte request message to the server, which produces a response containing 3000 bytes. Estimate the total time to complete the request/response in each of the following cases:
(i) Using connectionless communication; (5)
(ii) Using connection-oriented communication; (2)
(iii) The server process is in the same machine as the client, and no connection set-up is needed. For this part, estimate the interprocess data transfer rate on the machine at 16 megabits/second, and latency per message at 3 milliseconds. (5)
Please show all workings.
(b) In this course, we discussed socket programming in C. The subject of this question is client-server socket programming under the TCP protocol. Draw a diagram which clearly depicts the various steps taken by both the server, and the client, in establishing a connection under TCP protocol, and subsequent communications. You need to write down the name of the function called at each step. (13)
COMP1040-E2 6 END