Question: Performance of a MIPS program (The following code fragment processes two single-precision floating-point arrays A and B, and modifies the array B. Each array consists
Performance of a MIPS program (The following code fragment processes two single-precision floating-point arrays A and B, and modifies the array B. Each array consists of 500 single-precision floats. The addresses of A and B are stored in $a0 and $a1 respectively. Note that there is an outer loop and an inner loop in the MIPS assembly language code. 
a.Count the total number of instructions executed by the above code fragment, including those executed outside the outer loop.
b. How many cycles does it take to execute the above code?
c.What is the execution time in nanoseconds?
d.What is the average CPI for the above code?
e. What is the MIPS rate for the above code?
$a2, 500 $to, $a0 $t4, $zero ?zero, # $a2: 500 # $t0 address of array A # $f4 0 (move to coprocessor 1) # outer loop move move mtc1 ?f4 outer: # load single-precision float lwc1 add.s move $f4, $f4, $fo $t1, $a1 $t5, $zero # $t1: address of Array B move # $t5: 0 inner: # inner loop $f1, ($t1) # load single-precision float lwc1 mul.s div.s swc1 addi addi bne $f3, $f2, $f4 ?f3, ($t1) $t1, $t1, 4 $t5, $t5, 1 sts, $a2, inner # store single-precision float # end of inne r loop addi addi bne $to, $to, 4 $t4, $t4, 1 $t4, $a2, outer # end of outer loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
