retagged by
989 views
2 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

1 Answer

Best answer
7 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:
Position:
Show:

Related questions

1 1 vote
3 3 answers
1.3k
1.3k views
Bikram asked Sep 3, 2016
1,297 views
Determine the number of page faults when references to pages occur in the sequence -$1,2,4,5,2,1,2,4$. Assume that the main memory can accommodate 3 pages and already ha...
1 1 vote
1 answers 1 answer
762
762 views
Bikram asked Sep 3, 2016
762 views
A computer system has 4 K word cache organized in a block-set associative manner, with 4 blocks per set, 64 words per block. The number of bits in the SET and WORD fields...
4 4 votes
1 answers 1 answer
3.1k
3.1k views
Bikram asked Sep 3, 2016
3,070 views
Consider a computer with 8 MB of main memory and a 128 KB cache. The cache block size is 4KB and it uses a direct mapping scheme for cache management. Total number of dif...
2 2 votes
1 1 answer
1.1k
1.1k views
Bikram asked Sep 3, 2016
1,081 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 ...