Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Assume a four-way set associative cache with eight blocks. The address sequen

ID: 3762062 • Letter: 1

Question

1. Assume a four-way set associative cache with eight blocks. The address sequence: 1, 2, 4, 1, 2, 4, 5, 9, 11, 7, 5, 11

a. Assuming an LRU replacement policy, how many hits does this address sequence exhibit?

b. Assuming an MRU (most recently used) replacement policy, how many hits does this address sequence exhibit?

c. Redo a) and b) using direct mapped and fully associative cache organizations. Compare the hit ratios of the direct mapped, four-way set associative, and fully associative schemes.

Explanation / Answer

Given number of blocks = 8.

So, the set of block = 8/4-way=2

Therefore, number of sets is 1 containing of block size 8.

Given reference,

Reference

Hit or Miss

Comments

1

MISs

Fetch word 1 to set 0

2

HIT

Since in the set 1 contains 8 words. So 2 already exists in the cache

5

HIT

Already exists in set 1

1

HIT

Already exists in set 1

2

HIT

Already exists in set 1

4

HIT

Already exists in set 1

5

HIT

Already exists in set 1

9

MISS

Fetch word 5 to set 1

11

HIT

Already exists in set 1

7

HIT

Already exists in set 0

5

HIT

Already exists in set 0

11

HIT

Already exists in set 1

Reference

Hit or Miss

Comments

1

MISs

Fetch word 1 to set 0

2

HIT

Since in the set 1 contains 8 words. So 2 already exists in the cache

5

HIT

Already exists in set 1

1

HIT

Already exists in set 1

2

HIT

Already exists in set 1

4

HIT

Already exists in set 1

5

HIT

Already exists in set 1

9

MISS

Fetch word 5 to set 1

11

HIT

Already exists in set 1

7

HIT

Already exists in set 0

5

HIT

Already exists in set 0

11

HIT

Already exists in set 1