Difficulty: Medium
Correct Answer: Write-back policy
Explanation:
Introduction / Context:
This question tests your understanding of cache memory write policies in computer architecture. When the processor writes data to a cache, the system must decide when and how to update the corresponding value in main memory. Two classic strategies are write-through and write-back. Knowing the difference between these policies is important for understanding performance, bandwidth usage, and data consistency in modern CPUs.
Given Data / Assumptions:
Concept / Approach:
With a write-through policy, every write to the cache is immediately written to main memory as well. With a write-back policy, the processor writes to the cache and marks the block as dirty, but main memory is not updated right away. Instead, the updated data is written back to main memory only when the dirty cache block is removed or replaced. The description in the question clearly matches the behaviour of write-back, where the update happens when the word or block leaves the cache.
Step-by-Step Solution:
Step 1: Identify the key phrase in the question: main memory is updated when a word is removed from the cache.
Step 2: Recall that write-through sends every write operation directly to both cache and main memory at the time of the write, not at removal.
Step 3: Recall that write-back keeps changed data only in the cache until the cache block is evicted, then writes the modified data back to main memory.
Step 4: Match this behaviour with the description of updating main memory when the data leaves the cache, which is exactly the write-back policy.
Step 5: Eliminate options that are not standard names for cache write policies or do not match this description.
Verification / Alternative check:
A quick way to verify is to remember the trade off between memory traffic and complexity. Write-through generates more memory traffic because every write hits main memory immediately, which is slower but simple and safer. Write-back reduces traffic and can improve performance because many repeated writes stay in the cache and memory is updated only once when the block is evicted. This characteristic of waiting until removal matches the wording of the question and confirms that write-back is correct.
Why Other Options Are Wrong:
Write-through policy: This is wrong because write-through updates main memory at the time of each write, not only when the cache block is removed.
Protected-write policy: This is wrong because it is not a standard name for a cache write policy in classical computer architecture terminology.
Cache-write policy: This is wrong because it is a vague phrase and not the recognised term used in textbooks for a specific write strategy.
Common Pitfalls:
Students often confuse write-through and write-back because both involve writing data to memory, but the timing is different. Another pitfall is to focus only on the word write in the option names without checking the definition. Always connect write-through with immediate updates to memory and write-back with delayed updates at eviction time. This distinction appears frequently in exam questions.
Final Answer:
The method that updates main memory when modified data is written back only when the cache block is removed is the Write-back policy.
Discussion & Comments