Skip to content
Related Articles

Related Articles

Improve Article
GATE | GATE-CS-2009 | Question 29
  • Difficulty Level : Basic
  • Last Updated : 19 Nov, 2018

Consider a 4-way set associative cache (initially empty) with total 16 cache blocks. The main memory consists of 256 blocks and the request for memory blocks is in the following 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?
(A) 3
(B) 8
(C) 129
(D) 216


Answer: (D)

Explanation: 4 way set associative so 16 block will be divided in 4 sets of 4 blocks each.

We apply(Address mod  4) function to decide set.

Set 00480mod4=0*
432255mod4=3*
881mod4=1*
216924mod4=0*
Set 1113mod4=3*
1331338mod4=0*
129129133mod4=1*
7373159mod4=3*
Set 2216mod4=0*
129mod4=1*
          63mod4=3*
8mod4=0*
Set 325515598mod4=0*
3332mod4=0*
15915973mod4=1*
636392mod4=0*
155Mod4=3*

All  * are misses S1 in the first stage ans S2 in the second.



In the second stage 216 is not present in the cache.

So (D) is correct option.

 

Quiz of this Question

Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :