GATE CS 2024 Set 1 | Question 53

MSQ · 2 marks

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?

  1. Option A: A read miss in WBC never evicts a dirty block
  2. Option B: A read miss in WTC never triggers a write back operation of a cache block to main memory (correct)
  3. Option C: A write hit in WBC can modify the value of the dirty bit of a cache block (correct)
  4. Option D: A write miss in WTC always writes the victim cache block to main memory before loading the missed block to the cache

Answer

(B), (C)

Explanation

  • (A) False: on a read miss in a full set, LRU picks the victim without looking at its dirty bit. In a write back cache that block may be dirty, and it is then written back before the new block is brought in.
  • (B) True: write through updates main memory on every write, so no cache block is ever newer than memory and evicting one needs no write back.
  • (C) True: a write hit in a write back cache updates only the cache and sets the dirty bit, which changes it from 0 to 1 if the block was clean.
  • (D) False: in a write through cache the victim already matches main memory, so it is simply overwritten. Nothing is written back first (and with no-write-allocate the missed block is not loaded at all).

Answer: B, C