Answer:
711; 202
Step-by-step explanation:
MIPS code for the C fragment:
addi $t6, $zero, 101 # the loop termination value
add $t0, $zero, $zero # i = 0
addi $t2, $a0, 0 # ptr to current A[i]
addi $t3, $a1, 0 # ptr to current B[i]
loop: lw $t4, 0($t3) # load B[i]
add $t4, $t4, $s0 # B[i] + c
sw $t4, 0($t2) # store in A[i]
addi $t0, $t0, 1 # i++
addi $t2, $t2, 4 # ptr to next A[i]
addi $t3, $t3, 4 # ptr to next B[i]
bne $t0, $t6, loop # if i < 101, goto loop
The loop is executed 101 times and the loop contains 7 statements. There are 4 statements outside the loop. Therefore, the total number of instructions executed is 4 + (7*101) = 711.
The total number of memory data reference: 101 * 2 = 202.