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) ...
LRU Replacement Policy in Fully Associative Cache

In a fully associative cache, each cache block can store any memory block from the main memory. The cache blocks are not assigned to specific memory locations, allowing for flexibility in mapping memory blocks to cache blocks.

The LRU (Least Recently Used) replacement policy is used in fully associative caches to determine which cache block to replace when a new memory block needs to be loaded into the cache. This policy replaces the cache block that has been accessed least recently.

Given Information:
- Fully associative cache with 8 cache blocks numbered from 0 to 7.
- Sequence of memory block requests: 4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7

Steps to Find the Cache Block for Memory Block 7:
1. Initially, all cache blocks are empty.
2. When a memory block is requested, we check if it is already present in the cache.
3. If the memory block is present, it is a cache hit, and the cache block containing the memory block is considered the most recently used.
4. If the memory block is not present, it is a cache miss, and we need to replace a cache block with the requested memory block.
5. In LRU policy, the cache block that has been accessed least recently is replaced.
6. We keep track of the order of memory block accesses to determine the least recently used cache block.
7. Let's go through the sequence of memory block requests and track the cache blocks.

Sequence of Memory Block Requests:
1. Request for memory block 4: Cache miss. Cache block 0 is filled with memory block 4.
Cache: [4, -, -, -, -, -, -, -]
2. Request for memory block 3: Cache miss. Cache block 1 is filled with memory block 3.
Cache: [4, 3, -, -, -, -, -, -]
3. Request for memory block 25: Cache miss. Cache block 2 is filled with memory block 25.
Cache: [4, 3, 25, -, -, -, -, -]
4. Request for memory block 8: Cache miss. Cache block 3 is filled with memory block 8.
Cache: [4, 3, 25, 8, -, -, -, -]
5. Request for memory block 19: Cache miss. Cache block 4 is filled with memory block 19.
Cache: [4, 3, 25, 8, 19, -, -, -]
6. Request for memory block 6: Cache miss. Cache block 5 is filled with memory block 6.
Cache: [4, 3, 25, 8, 19, 6, -, -]
7. Request for memory block 25: Cache hit. Cache block 2 is considered the most recently used.
Cache: [4, 3, 25, 8, 19, 6, -, -]
8. Request for memory block 8: Cache hit. Cache block 3 is considered the most recently used.
Cache: [4, 3, 25,
Free Test
Community 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
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