retagged by
489 views
2 votes
2 votes

There is a 4 way set associative cache memory with 8 cache blocks. The main memory consists of 256 blocks and the request for memory blocks is in that order:
$$0,255,1,4,3,8,133,159,216,129,63,8,48,32,73,92,155 $$
Which one of the following memory block will not be in cache if LRU replacement policy is used?

  1. 159
  2. 8
  3. 129
  4. 48
retagged by

1 Answer

Best answer
7 votes
7 votes

We have 8 cache blocks and 4 blocks in a set. So, no. of sets = 2.

After each block access cache will be as follows

Set 1 Set 2
0  
0 255
0 255, 1
0, 4 255, 1
0, 4 255, 1, 3
0, 4, 8 255, 1, 3
0, 4, 8 255, 1, 3, 133
0, 4, 8 1, 3, 133, 159 (255 replaced)
0, 4, 8, 216 1, 3, 133, 159
0, 4, 8, 216 3, 133, 159, 129 (1 replaced)
0, 4, 8, 216 133, 159, 129, 63 (3 replaced)
0, 4, 216, 8 (LRU info of 8 updated) 133, 159, 129, 63
4, 216, 8, 48 (0 replaced) 133, 159, 129, 63
216, 8, 48, 32 (4 replaced) 133, 159, 129, 63
216, 8, 48, 32 159, 129, 63, 73 (133 replaced)
8, 48, 32, 92 (216 replaced) 159, 129, 63, 73
8, 48, 32, 92 129, 63, 73, 155 (159 replaced)
selected by
Answer:

Related questions

1 votes
1 votes
1 answer
2
3 votes
3 votes
1 answer
3
2 votes
2 votes
1 answer
4
Bikram asked Sep 3, 2016
293 views
Match these OS abstractions with Hardware components:A. Thread1. interruptB. Virtual address space2. memoryC. File system3. CPUD. Signal4. DiskA-2 B-4 C-3 D-1A-1 B-2 C-3 ...