Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider a small two-way set-associative cach... Start Learning for Free
Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8
  • a)
    2
  • b)
    3
  • c)
    4
  • d)
    5
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Consider a small two-way set-associative cache memory, consisting of f...
We have 4 blocks and 2 blocks in a set => there are 2 sets. So blocks will go to sets as follows:
since the lowest bit of block address is used for indexing into the set.
So, 8, 12 and 0 first miss in cache with 0 replacing 8 (there are two slots in each set due to 2-way set) and then 12 hits in
cache and 8 again misses. So totally 4 misses.
View all questions of this test
Most Upvoted Answer
Consider a small two-way set-associative cache memory, consisting of f...
Overview:
In this question, we are given a small two-way set-associative cache memory with four blocks. We need to determine the number of cache misses for a given sequence of block addresses using the least recently used (LRU) replacement scheme. The sequence of block addresses is 8, 12, 0, 12, 8.

Explanation:
To solve this question, we need to understand the concept of a two-way set-associative cache memory with LRU replacement.

Two-Way Set-Associative Cache:
A two-way set-associative cache consists of two sets, each with two blocks. Each set is identified by an index. Each block in a set is identified by a tag. The cache memory is organized in such a way that each memory block can be stored in one of the two blocks within a set, based on the index of the memory block. The selection of the block to be replaced is determined by the LRU replacement scheme, which means the least recently used block is replaced when a cache miss occurs.

Cache Misses:
Let's analyze the given sequence of block addresses: 8, 12, 0, 12, 8.

- For the first block address 8, there is a cache miss as the cache is empty.
- For the second block address 12, there is a cache miss as the cache is empty.
- For the third block address 0, there is a cache miss as the cache is empty.
- For the fourth block address 12, there is a cache hit as block 12 is already present in the cache.
- For the fifth block address 8, there is a cache hit as block 8 is already present in the cache.

Therefore, the number of cache misses is 3 (for block addresses 8, 12, 0) out of the total 5 block addresses.

Conclusion:
The correct answer is option 'C' - 4.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. Can you explain this answer?
Question Description
Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. 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 small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. 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 small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. Can you explain this answer?.
Solutions for Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. 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 small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. Can you explain this answer?, a detailed solution for Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. Can you explain this answer? has been provided alongside types of Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is8, 12, 0, 12, 8a)2b)3c)4d)5Correct answer is option 'C'. 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