Pleas help! Thanks! Consider the following MIPS program: ADDI R1, R0, #1 SW R1,
ID: 3570076 • Letter: P
Question
Pleas help! Thanks!
Consider the following MIPS program:
ADDI R1, R0, #1
SW R1, 2000 (R0)
LOOP: LW R1, 2000 (R0)
MULT R2, R1, #4
ADDI R3,R2, #5000
LW R4, 0 (R3)
LW R5, 1500 (R0)
ADD R6, R4, R5
LW R1, 2000 (R0)
MULT R2, R1, #4
ADDI R7, R2, #0
SW R6, 0(R7)
LW R1, 2000 (R0)
ADDI R1, R1, #1
SW R1, 2000 (R0)
LW R1, 2000 (R0)
ADDI R8, R1, #-101
BNEZ R8, LOOP
a) What is the value of IC for this program?
b) What is the fraction of ALU instructions?
c) What is the fraction of Loads/Store instructions?
d)What is the fraction of Branch instructions?
e) Assume ALU, Loads/Stores, and Branch instructions require one, two, and three clock
cycles respectively. Find CPI.
f) Assuming the previous parts and 2 ns clock cycles, what is the execution time of this
program?
Explanation / Answer
a)1500
b)multily
add
multiply
add
add
add
multiply
c)4/3
f)execution time will be double as previous so 2 +2=4ns