Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider a fully associative cache with 8 cac... Start Learning for Free
Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7? 
  • a)
    4
  • b)
    5
  • c)
    6
  • d)
    7
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
Consider a fully associative cache with 8 cache blocks (numbered 0-7) ...
Block size is =8 Given 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 So from 0 to 7 ,we have
  • 4 3 25 8 19 6 16 35    //25,8 LRU so next 16,35 come in the block.
  •  45 3 25 8 19 6 16 35
  • 45 22 25 8 19 6 16 35
  • 45 22 25 8 19 6 16 35
  • 45 22 25 8 3 6 16 35     //16 and 25 already there
  • 45 22 25 8 3 7 16 35   //7 in 5th block Therefore , answer is  B
View all questions of this test
Most Upvoted Answer
Consider a fully associative cache with 8 cache blocks (numbered 0-7) ...
Explanation:

LRU (Least Recently Used) replacement policy is used in fully associative cache. In this policy, the block that has been least recently used is replaced when a new block is added to the cache.

The given sequence of memory block requests is as follows:

4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7

Let's see how the cache blocks are filled and replaced according to the LRU policy:

Initially, all the cache blocks are empty.

1. Memory block 4 is requested. It is not present in the cache, so it is loaded into block 0.

Cache: 4, _, _, _, _, _, _, _

2. Memory block 3 is requested. It is not present in the cache, so it is loaded into block 1.

Cache: 4, 3, _, _, _, _, _, _

3. Memory block 25 is requested. It is not present in the cache, so it is loaded into block 2.

Cache: 4, 3, 25, _, _, _, _, _

4. Memory block 8 is requested. It is not present in the cache, so it is loaded into block 3.

Cache: 4, 3, 25, 8, _, _, _, _

5. Memory block 19 is requested. It is not present in the cache, so it is loaded into block 4.

Cache: 4, 3, 25, 8, 19, _, _, _

6. Memory block 6 is requested. It is not present in the cache, so it is loaded into block 5.

Cache: 4, 3, 25, 8, 19, 6, _, _

7. Memory block 25 is requested again. It is already present in the cache, so no block is replaced.

Cache: 4, 3, 25, 8, 19, 6, _, _

8. Memory block 8 is requested again. It is already present in the cache, so no block is replaced.

Cache: 4, 3, 25, 8, 19, 6, _, _

9. Memory block 16 is requested. It is not present in the cache, so it is loaded into block 6.

Cache: 4, 3, 25, 8, 19, 6, 16, _

10. Memory block 35 is requested. It is not present in the cache, so it is loaded into block 7.

Cache: 4, 3, 25, 8, 19, 6, 16, 35

11. Memory block 45 is requested. It is not present in the cache, so block 0 is replaced as it was the least recently used block.

Cache: 45, 3, 25, 8, 19, 6, 16, 35

12. Memory block 22 is requested. It is not present in the cache, so block 1 is replaced as it was the least recently used block.

Cache: 45, 22, 25, 8, 19, 6, 16, 35

13.
Free Test
Community Answer
Consider a fully associative cache with 8 cache blocks (numbered 0-7) ...
D
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer?
Question Description
Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer?.
Solutions for Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer?, a detailed solution for Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7 If LRU replacement policy is used, which cache block will have memory block 7?a)4b)5c)6d)7Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev