in CO and Architecture edited by
1,897 views
1 vote
1 vote

​​​​Consider two set-associative cache memory architectures: $\text{WBC}$, which uses the write back policy, and $\text{WTC}$, which uses the write through policy. Both of them use the $\text{LRU}$ (Least Recently Used) block replacement policy. The cache memory is connected to the main memory. Which of the following statements is/are TRUE?

  1. A read miss in $\text{WBC}$ never evicts a dirty block
  2. A read miss in $\text{WTC}$ never triggers a write back operation of a cache block to main memory
  3. A write hit in $\text{WBC}$ can modify the value of the dirty bit of a cache block 
  4. A write miss in $\text{WTC}$ always writes the victim cache block to main memory before loading the missed block to the cache 
in CO and Architecture edited by
by
1.9k views

2 Answers

0 votes
0 votes
Ans: B and C
0 votes
0 votes

The answer should be B,C
 

A. False

When we miss accessing data in the cache (either by reading or writing), we can choose whether or not to add that missed data into the cache. Sometimes, we might decide not to add it because the data already in the cache from another memory location is more useful or accessed more often.

Source of above info: https://cs.stackexchange.com/questions/133352/what-is-a-cache-write-miss

So, the statement is false because it says that a read miss in WBC "never" removes a dirty block, which is not always the case.

Option D in GATE 2022 Question

B. True

In the write-through policy, data is always kept synchronized. Therefore, we never need to perform a "write back" operation to remove any entry from the cache. This makes the option correct because it states that "never" triggers a write-back.

C. True

A write hit in WBC can modify the value of the dirty bit of a cache block.

If there's a write hit in WBC, it means we're writing directly into the cache. So, of course, we'll also change the dirty bit.

D. False
A write miss in WTC always writes the victim cache block to main memory before loading the missed block to the cache.

There are two blocks mentioned: a missed block and a victim block. The missed block is the one we want to access, while the victim block is the one replaced by LRU.

When there's a write miss in WTC, it means the data we're trying to write isn't in the cache. Now, we may want to load it into the cache, or we may not want to. Suppose we don't want to bring it into the cache; in that case, we can directly modify the main memory.

However, if we decide to bring it into the cache, then we may or may not need to replace the victim block depending on cache is already full or not

edited by

2 Comments

D. False?
There are 2 blocks mentioned : a missed block and a victim block.
By my understanding Victim block is the block chosen by LRU to replace in case the set is full.

We bring the missed block to cache and  the set is not full(we still know which block was Least Recently Used), we will just load the missed block.So before loading the missed block there is no need write the victim block to main memory.
We bring the missed block to cache and  the set is full, only now we will write the victim block to main memory and then replace it.

Suppose we don't want to bring it into the cache; in that case, we can directly modify the main memory. So there is no need write the victim block to main memory.

So it is not always the case to write the victim to MM.
0
0

@Sachin Mittal 1 sir, can you once please check question number 46. I think answer should be 3. If it is 6 can you post an answer for that question. I wrote my solution on how i got 3

0
0
Answer:

Related questions