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

Suppose we have a 16 block cache. Each block of the cache is one word wide. When

ID: 3820885 • Letter: S

Question

Suppose we have a 16 block cache. Each block of the cache is one word wide. When a given program is executed, the processor reads data from the following sequence of decimal addresses: 0, 15, 2, 8, 14, 15, 26, 2, 0, 19, 7, 10, 8, 14, 11 Show the contents of the cache at the end of the above reading operations if: the cache is direct mapped the cache is 2-way set associative the cache is 4-way set associative the cache is fully associative The content at address 0 can be shown as [0]. Assume LRU (Least Recently Used) replacement algorithm is used for block replacement in the cache, and the cache is initially empty.

Explanation / Answer

block# modulo block(16)
0 % 16 = 0
15 % 16 = 15
2 % 16 = 2
8 % 16 = 8
14 % 16 = 14
15 % 16 = 15
26 % 16 = 10
2 % 16 = 2
0 % 16 = 0
19 % 16 = 3
7 % 16 = 7
10 % 16 = 10
8 % 16 = 8
14 % 16 = 14
11 % 16 = 11


block# Tag Data
0 0 [0]
1 15 [15]
2 2 [2]
3 8 [8]
4 14 [14]
5 15 [15]
6
7
8 2 [2]
9 0 [0]
10   
11 7 [7]
12 10 [10]
13 8 [8]
14 14 [14]
15 11 [11]


Two-way Set

block# modulo block(8)
0 % 8 = 0
15 % 8 = 7
2 % 8 = 2
8 % 8 = 0
14 % 8 = 6
15 % 8 = 7
26 % 8 = 2
2 % 8 = 2
0 % 8 = 0
19 % 8 = 3
7 % 8 = 7
10 % 8 = 2
8 % 8 = 0
14 % 8 = 6
11 % 8 = 3

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote