Question
Consider two set-associative cache memory architectures: WBC, which uses the write back policy, and WTC, which uses the write through policy. Both of them use the LRU (Least Recently Used) block replacement policy. The cache memory is connected to the main memory. Which of the following statements is/are TRUE?
Official answer and solution
- Official answer
- B and C
- From
- Official GATE 2024 answer key
Solution
Compare how write-back (WBC) and write-through (WTC) caches handle dirty bits and block evictions.
- (A) is FALSE: In a write-back cache (WBC), if all ways in the target set are occupied and the LRU victim block happens to be dirty, a read miss will evict that dirty block and write it back to main memory.
- (B) is TRUE: In a write-through cache (WTC), every write updates main memory immediately, so cache blocks are never dirty; hence a read miss never triggers a write-back of the evicted block.
- (C) is TRUE: In WBC, when a write hit occurs on a clean block (
dirty = 0), its dirty bit is changed from0to1. - (D) is FALSE: In WTC, main memory already holds the latest copy of every cached block, so victim blocks are never written back to main memory upon replacement.
Options (B), (C)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2024 Computer Science and Information Technology - Set 1 (CS1)
- Question
- 53 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.