Assignment#2 Solution
Assignment#2 Solution
(a)(3)
I1 -> 5 cycles
I2 -> 1 cycle
I3 -> 1 cycle
I4 -> 1 cycle
I5 -> 1 cycle
I6 -> 1 cycle
I7 -> 1 cycle
(b)(3)
I1 -> 5 cycles
I2 -> 1 cycle
I3 -> 1 cycle
I4 -> 1 cycle
I5 -> 1 cycle
I6 -> 1 cycle
I7 -> 1 cycle
(c)(3)
I1 -> 5 cycles
I2 -> 1 cycle
I3 -> 1 cycle
I4 -> 1 cycle
I5 -> 1 cycle
I6 -> 1 cycle
I7 -> 1 cycle
(d)(6)
ld R2, 20 (R6)
sw R2, 26 (R6)
For X(3)
30 Integer Instructions take = 30*2 = 60 cycles
Processor Y should go for option 1 as it is 0.95/0.92 = 1.032 times faster than option 2
Q3
Q4
1) [1st Stage] MUX (20ps) + Instruction Memory (250ps) -> Ignore (Adder)
[2nd Stage] Register File (150ps) -> Ignore (Sign-Extension)
[3rd Stage] MUX (20ps) + ALU (120ps) -> Ignore (Shift-Left + Adder)
[5th Stage] MUX (20ps) + Register File (150ps)
Total = 270+150+140+170 = 730ps
Mux can be ignored in 1st and 5th stage
Total = 250+150+140+150 = 690ps
2) Maximum time taken by 1st Stage i.e. 270ps, so clock cycle time will be 270ps.
(If Mux ignored) Maximum time taken by 1st Stage i.e. 250ps, so clock cycle time will be 250ps.
3) Between branch and Memory instruction, memory instruction uses all 5 stages and load
instruction critical instruction determines the critical path. For Load,
1st Stage (270) + 2nd Stage (150) + 3rd Stage (140) + 4th Stage (250) + 5th Stage (170) = 980ps
4) Maximum time taken by 1st Stage i.e. 270ps, so clock cycle time will be 270ps.
Maximum time taken by 1st Stage i.e. 250ps, so clock cycle time will be 250ps.
Q5
a) (IF -> Inst. 7), (ID -> Inst. 6), (EXE -> Inst. 5), (MEM -> Inst. 4), (WB -> Inst. 3) (10)
b) 8th cycle values
IF/ID (1)
Variable Name Value
PC (Program counter value of the instruction 6) + 4
Inst. 6 from Inst. Memory addi R6, R6, 4
Instruction Bits (I-Type) 001000 00110 00110 0000000000000100