Question: his question analyzes the following array sum function, whose first argument is a pointer to an array of integers and whose second argument is the

his question analyzes the following array sum function, whose first argument is a pointer to an array of
integers and whose second argument is the length of the array.
add1: add $v0, $0, $0
beq1: beq $a1, $0, jr1
addi1: addi $a1, $a1,-1
lw1: lw $t0,0($a0)
add2: add $v0, $v0, $t0
addi2: addi $a0, $a0,4
beq2: beq $0, $0, beq1
jr1: jr $ra
(a) List the data addresses referenced by this function when called on an array of length three, starting
at address A.
(b) List the instruction address (i.e., PC) references that same function call makes, assuming add1 is
at address P.
What is the hit rate of this call on an L1 data cache that is 256B, direct mapped, with 16B lines?
Assume that A =0x0000EFA0.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!