Question: Suppose we have a 2 - way set associative cache for instructions. All instructions are 4 bytes ( e . g . , MIPS architecture

Suppose we have a 2-way set associative cache for instructions. All instructions are 4 bytes (e.g., MIPS architecture). The cache can store 8 instructions, or 32 bytes. Suppose the cache is initially empty and then the following loop is run:
Address (decimal)
Instructions
Comments
0
LOAD A,100
Register A =100
1
Call10
Subroutine call to Address 10
2
DEC A
Decrements A by 1, i.e., A =A-1
3
JANZ1
Jump to address 1 if A 0
4
STOP
Stop the program
10
INC B
Increment register B by 1, i.e., B = B+1
11
RET
Return from subroutine
(a)[1 pt] If the cache is direct mapped, how many misses will there be?
(b)[1 pt] If the cache were 2-way set associative, how many misses will there be?

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!