=========================preview======================
(ELEC152)[2007](s)midterm~1212^_10284.pdf
Back to ELEC152 Login to download
======================================================
ELEC 152 Apr. 14, 2007 Spring 2007 George Yuan
ELEC152 Computer Organization
Mid-term Examination
Short Questions: 35pts, 7pts/each
1. a. Imagine you are a computer designer. How can you improve the performance of a computer?(4pts)
b. Now, you are a computer analyst. What can you do to evaluate the performance of a new computer?(3pts)
2. a. For MIPS, what is the value range for integers in 2s compliment?(4pt)
b. If we assume that single-precision floating point number is represented with the formula in the appendix, what is the value range for single-precision floating point number?(3pts)
3. For the following MIPS assembly segments, please calculate for the required results
0x00000100 addi $s0, $zero, 4000
0x00000104 lw $t0, 100($s0) #a. what is the address of the word #that is going to load from the #memory?(3pt)
0x00000108 beq $t0, $t1, L1 #b. what is the offset for L1 in the
#machine instruction?(2pt) 0x0000010c addi $s0, $s0, 4 0x00000110 j L2 #c. what is the offset for L2 in the
#machine instruction?(2pt) 0x00000114 L1: addi $s0, $s0, 3 0x00000118 addi $s0, $s0, 2 0x0000011c L2: addi $s0, $s0, 1
4. Please convert the following C code into MIPS assembly codes. (7pts)
x=0;
for(i=9;i--;i>0)
{

x=x+i*2;
}

5. A single-cycle processor is given in the appendix. For the instruction add $t0, $t1, $t2
1

a.
Please draw the timing diagram for the execution of this instruction.(3pts) (Without considering the delay tc-to-q, and the clock skew.)

b.
What is the total execution delay for this instruction.(2pts)

c.
On the diagram, please indicate the moment that the calculated result from the ALU is written back into the register file.(2pts)



Long Questions: 65pts
6. (20pts)An ISA includes 5 instruction classes. Processor X is one implementation of the ISA. The CPI of each instruction class is listed in the following table. Processor X runs at 1GHz. Program

is the main task for this processor. After compilation, it includes 109 instructions. Its composition is shown in the table.
Class A Class B Class C Class D Class E
CPI 1 2 3 4 5
Program 30% 10% 10% 10% 40%

a) What is the execution time of the program? (5pts)
b) What is the weighted average CPI for processor X during the execution of program ? (5pts)
c) Now, you are required to re-design processor X into processor X so that the execution time of program is halved. Assume that, among the 5 instruction classes, only the implementation of one class can be re-designed. What is your re-design plan? (Which class do you choose to redesign? What is the CPI you have to design for it?) Assume instruction count of program does not change. (5pts)
d) What is the peak performance of processor X in instructions per second? What about processor X ? (5pts)
7. (20pts)Please read the following MIPS code segment, and answer the questions
0x100 addi $t0, $zero, 14 #the target number is stored in t0