You are on page 1of 2

Homework

Set 4
Session: Winter 2015 Instructor: Prof. L. HE
Total Points: 60 Due Date: 11th Feb 2015 (before class starts)

1. Consider two different implementations of the same instruction


classes of instructions, A, B, C, and D. The clock rate and CPI of
the following table.
Clock Rate
CPI Class A
CPI Class B
P1
1.5 GHz
1
2
P2
2 GHz
2
2

set architecture. There are four


each implementation are given in
CPI Class C
3
2

CPI Class D
4
2

a. Given a program with 10 instructions divided into classes as follows: 10% class A, 20% class B,
50% class C and 20% class D, which implementation is faster?
b. What is the global CPI for each implementation?
c. Find the clock cycles required in both cases? [15 points]
2. Consider two different implementations, P1 and P2, of the same instruction set. There are five
classes of instructions (A, B, C, D, and E) in the instruction set. P1 has a clock rate of 4 GHz. P2 has
a clock rate of 6 GHz. The average number of cycles for each instruction class for P1 and P2 are as
follows:
Class
A
B
C
D
E

CPI on P1
1
2
3
4
3

CPI on P2
2
2
2
4
4

Assume that peak performance is defined as the fastest rate that a computer can execute any
instruction sequence. What are the peak performances of P1 and P2 expressed in instructions per
second? [10 points]

3. Identify all of the data dependencies in the following code. Which dependencies are data hazards that
will be resolved via forwarding? Which dependencies are data hazards that will cause a stall? [10
points]
add $3, $4, $2
sub $5, $3, $1
lw $6 200 ( $3)
add $7, $3, $6

4. The basic single-cycle MIPS implementation can only implement some instructions. New instructions
can be added to an existing ISA, but the decision whether or not to do that depends, among other
things, on the cost and complexity such an addition introduces into the processor datapath and
control. The next three problems refer to the new instruction given in the table below:

i.
ii.
iii.

Instruction
add3 Rd, Rs, Rt, Rx

Interpretation

a.
b.

sll Rt, Rd, Shift

Reg[Rd]=Reg[Rt] << Shift (shift left by Shift bits)

Reg[Rd]=Reg[Rs]+Reg[Rt] + Reg[Rx]

Which existing blocks (if any) can be used for this instruction?
Which new functional blocks (if any) do we need for this instruction?
What new signals do we need (if any) from the control unit to support this instruction? [15 points]

5. Describe the effects of a single stuck-at-0 fault (i.e. regardless of what it should be, the signal is
always 0) would have for the signals shown below, in the single-cycle datapath in Figure 1.
Which instructions, if any, will not work correctly? Explain why.
a. RegWrite = 0
b. ALUop0 = 0
c. ALUop1 = 0
d. Branch = 0
e. MemRead = 0
f. MemWrite = 0

[10 points]
Figure 1