Skip to content
Official PYQ · 2024

GATE CS 2024 Set 1 Q43 — Memory Hierarchy: Cache, Main Memory and Secondary Storage

Explain with AI

​​​​Consider two set-associative cache memory architectures: WBC\text{WBC}, which uses the write back policy, and WTC\text{WTC}, which uses the write through policy. Both of them use the LRU\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?

Select all correct options
View worked solution

Answer: B;C

Let us analyze each option step-by-step:

  • Option A: Incorrect. In a Write-Back Cache (WBC\text{WBC}), when a read miss occurs and the target cache set is full, a block must be evicted using the LRU\text{LRU} policy. If the selected victim block is dirty (i.e., its dirty bit is 11), it must be written back to the main memory before the new block is loaded. Thus, a read miss in WBC\text{WBC} can evict a dirty block.
  • Option B: Correct. In a Write-Through Cache (WTC\text{WTC}), every write operation updates both the cache and the main memory simultaneously. Consequently, cache blocks are never "dirty" and there is no dirty bit. When a read miss occurs and a block needs to be evicted, the victim block can simply be overwritten without any write-back operation to the main memory.
  • Option C: Correct. In a Write-Back Cache (WBC\text{WBC}), a cache block is initially clean (dirty bit =0= 0) when loaded from main memory. If a write hit occurs on this clean block, the data is updated in the cache, and its dirty bit is modified from 00 to 11. Thus, a write hit can modify the value of the dirty bit.
  • Option D: Incorrect. Since WTC\text{WTC} maintains consistency with main memory on every write, no block in WTC\text{WTC} is ever dirty. Therefore, evicting a victim block in WTC\text{WTC} never requires writing it back to the main memory.

Hence, statements B and C are TRUE.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Hierarchy: Cache, Main Memory and Secondary Storage questions