Question: The following code was run on a system that has a two-way set associative cache (N=2) and a block size = 1 word addi $t0,
The following code was run on a system that has a two-way set associative cache (N=2) and a block size = 1 word
addi $t0, $0, 10
loop: beq $t0, $0, done
lw $t1, 0x4($0)
lw $t2, 0x24($0)
addi $t0, $t0, -1
j loop
Assuming that the cache memory was initially empty:
A) What is the miss rate after running this code?
B) What is the hit rate after running this code?
If the code was changed (by adding two extra load instructions) to:
addi $t0, $0, 10
loop: beq $t0, $0, done
lw $t1, 0x4($0)
lw $t2, 0x24($0)
lw $t3, 0x34($0)
lw $t4, 0x44($0)
addi $t0, $t0, -1
j loop
Again, assume that the cache memory was initially empty:
C) What is the miss rate after running this updated code?
D) What is the hit rate after running this updated code?
E) How do you think the hit rate can be increased?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
