Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following MIPS program: ADDI R1, R0, #1 SW R1, 2000 (R0) LOOP: LW R

ID: 656183 • Letter: C

Question

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

Static IC=18

fraction of ALU instructions=44%

fraction of load/store instructions= 50%

fraction of Branch instructions=5%

CPI=(3*5+2*50+1*44)/100=1.59

Execution time=CPI*IC*clock cycles=1.59*18*2=14.31ns

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote