=========================preview======================
(COMP180)[2011](s)midterm1~3938^_75702.pdf
Back to COMP180 Login to download
======================================================
HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 180)
Spring Semester, 2011

Midterm Examination 1
March 16, 2010 Name: Student ID:
Email: Lab Section Number:
Instructions:
1.
This examination paper consists of 9 pages with 8 questions and two appendices.

2.
Please write your name, student ID, email and lab section number on this page.

3.
Please answer all the questions in the spaces provided on the examination paper.

4.
Please read each question very carefully, answer clearly and to the point. Make sure that your answers are neatly written.

5.
Keep all pages stapled together.

6.
Calculator and electronic devices are not allowed

7.
The examination period will last for 2 hours.


Question Percentage % Scores
1 10
2 10
3 15
4 11
5 12
6 10
7 18
8 14
TOTAL 100

Question 1 Multiple Choice (10 marks) 2marks for each correct tick 0 if more ticks than necessary in each sub-question
Answer the following by ticking all correct answers. There might be more than one correct answer for each question.
a) On the same machine for the same C++ program, two different compilers generate two different sequences of machine language consisting of 5 and 6 instructions respectively. We can say that:
Sequence 1 will execute faster than sequence 2
Sequence 2 will execute faster than sequence 1
Compiler 1 is better than compiler 2
Compiler 2 is better than compiler 1
None of the above

b) Replacing the ISA of an architecture from RISC to CISC to reduce the instruction count will probably:
Make the clock cycle shorter
Improve the performance of the architecture
Increase the CPI
Shorten the program
None of the above

c) On two machines with two different implementations of the same ISA, and the same clock rate. We can say that:
The MIPS rating of a program suffice to compare their performance
The CPI of a program suffice to compare their performance
The number of instructions in the program suffice to compare their performance
They have the same performance because they have the same ISA and clock rate
None of the above

Question 2 True/False (10 marks) 1 mark for each correct answer (no marks deducted for wrong answers)
Tick all true statements below with a T and the false ones with an F in the box
T All jump instructions are 32 bit long
F It is sufficient for the target address L1to be no farther away from the instruction j L1than 256MB for the program to run correctly They also must be aligned in memory addresses that share the same upper 4 bits
F The MIPS instruction addi $s0, $s1, 10is an R-type instruction (False it is in I type it has an immediate field)
T Instruction jal Lsaves PC+4 into register $ra, and jumps to the address specified by label L
F For a function to return to its caller, the last instruction must be j $ra (False it must be j