---
title: "Cache write techniques"
subject: "Embedded System"
chapter: 4
key: "semester_6/embedded_system:cache-write-techniques"
source: https://www.bctengineer.com/q/semester_6/embedded_system/cache-write-techniques
site: BCT Engineering
---

# Cache write techniques

Embedded System · Chapter 4: Memory

- Asked in: 2069 Bhadra, 2 marks
- Video: [Cache Updating schemes || Write back vs. write through || computer organisation and design ..](https://www.youtube.com/watch?v=P5pqkf32qGY) — Deepesh Jain
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/embedded_system/cache-write-techniques
- Whole chapter: https://www.bctengineer.com/md/semester_6/embedded_system/chapter-4

## Question

Describe the cache write techniques.

## Short answer

The two main cache write techniques are write-through and write-back. Write-through updates both cache and main memory on every write, keeping memory current but slow. Write-back updates only the cache and sets a dirty bit; the block is written to memory only when evicted, reducing bus traffic but adding complexity.

## Answer

When the processor writes to a cached location, the cache and main memory must stay consistent. The two techniques are:

- **Write-through:** every write updates both the cache and main memory at once. Memory is always current and the design is simple, but writes are slow (memory-speed) and bus traffic is high.
- **Write-back (copy-back):** a write updates only the cache and sets a **dirty bit**. The block is written to main memory only when it is replaced. This is faster and gives less bus traffic, but memory may be stale and the hardware is more complex.

A write miss is handled by *write-allocate* (load the block, then write) or *no-write-allocate* (write straight to memory).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. In write-through, a write to a cached location is performed on:
   A. The cache only
   B. Main memory only
   C. Both cache and main memory together
   D. Main memory when the block is replaced
   Answer: C. Write-through updates both cache and main memory at once, so memory is always current. (Key point: Write-through)

2. What does the dirty bit in write-back caching indicate?
   A. The block has been modified in cache but not yet written to memory
   B. The block has never been used
   C. The block is invalid
   D. The block was loaded by write-allocate
   Answer: A. A write sets the dirty bit; the modified block is written to memory only when replaced. (Key point: Write-back dirty bit)

3. Which statement correctly compares the two techniques?
   A. Write-through has less bus traffic than write-back
   B. Write-back is simpler but keeps memory always current
   C. Write-through is simple but slow with high bus traffic; write-back is faster but may leave memory stale
   D. Both leave memory stale until replacement
   Answer: C. Write-through runs at memory speed for writes with high traffic; write-back is faster but memory can be stale and hardware is more complex. (Key point: Trade-offs)

## Related in Embedded System

- [Cache memory mapping techniques](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Acache-mapping-techniques) — Embedded System, chapter 4, asked 3×

## Related in other subjects

- [Cache mapping techniques](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Acache-mapping-techniques) — Computer Organization and Architecture, chapter 6, asked 7×
- [Cache write policy techniques](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Awrite-policy) — Computer Organization and Architecture, chapter 6
- [Cache read and direct-mapping demerits](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Adirect-mapping-demerits) — Computer Organization and Architecture, chapter 6
