Consider two set-associative cache memory architectures: WBC, which uses the…

2024

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?

Answer: B. A read miss in WTC never triggers a write back operation of a cache block to main memory; C. A write hit in WBC can modify the value of the dirty bit of a cache blockFinal answer: The true statements are: "A read miss in WTC never triggers a write back operation of a cache block to main memory" and "A write hit in WBC can…

  1. A.

    A read miss in WBC never evicts a dirty block

  2. B.

    A read miss in WTC never triggers a write back operation of a cache block to main memory

  3. C.

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

  4. D.

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

Attempted by 126 students.

Show answer & explanation

Correct answer: B, C

Final answer: The true statements are: "A read miss in WTC never triggers a write back operation of a cache block to main memory" and "A write hit in WBC can modify the value of the dirty bit of a cache block".

Reasoning:

  • "A read miss in WBC never evicts a dirty block": False. In a write-back cache, writes update the cache and set a dirty bit; the block is written back to main memory only on eviction. A read miss that requires loading a new block can evict the least-recently-used block even if it is dirty, causing a write-back.

  • "A read miss in WTC never triggers a write back operation of a cache block to main memory": True. Write-through updates main memory on every write, so cache blocks are not left in a dirty state. Therefore evicting a block on a read miss does not require a separate write-back.

  • "A write hit in WBC can modify the value of the dirty bit of a cache block": True. On a write hit in a write-back cache, the cache copy is updated and the dirty bit is set (or remains set) to indicate main memory is stale; the actual memory update is deferred until eviction.

  • "A write miss in WTC always writes the victim cache block to main memory before loading the missed block to the cache": False. Because write-through updates main memory on every write, victim blocks are not left dirty and typically do not need a write-back on eviction. Also, whether a write miss causes loading the block into cache depends on the system's write-allocate versus no-write-allocate policy, so the statement's universal claim is incorrect.

Summary: The two correct statements are the one about read misses in write-through caches not triggering write-backs to main memory, and the one about write hits in write-back caches affecting the dirty bit.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Computer Architecture

Loading lesson…