---
title: "Cache operation"
subject: "Computer Organization and Architecture"
chapter: 6
key: "semester_5/computer_organization_and_architecture:cache-operation"
source: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/cache-operation
site: BCT Engineering
---

# Cache operation

Computer Organization and Architecture · Chapter 6: Memory System

- Asked in: 2076 Asoj, 2 marks
- Video: [How Cache Works Inside a CPU](https://www.youtube.com/watch?v=zF4VMombo7U) — BitLemon
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/cache-operation
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_organization_and_architecture/chapter-6

## Question

Describe cache operation briefly.

## Short answer

CPU sends address; cache compares tag with stored tags. On hit, data is accessed at cache speed. On miss, the entire block is fetched from main memory into a cache line (replacing if needed), then the requested word is delivered to CPU. Locality of reference makes most accesses hits.

## Answer

The CPU puts the address on the address bus. The cache controller compares the tag part of the address with the tag stored in the cache.

- **Hit:** the block is in the cache, so the word is read from (or written to) the cache at cache speed.
- **Miss:** the block is not in the cache, so the whole block is read from main memory and stored in a cache line (replacing an old block if needed), and the requested word is given to the CPU.

Because of locality of reference most accesses are hits, so the average access time is close to the cache access time.

## Check yourself

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

1. What happens on a cache hit?
   A. Block fetched from memory
   B. Word read from or written to the cache at cache speed
   C. CPU waits
   D. Line replaced
   Answer: B. The block is already present. (Key point: Hit)

2. What happens on a miss?
   A. Only a bit is fetched
   B. Whole block is read from main memory into a line, word given to CPU
   C. Nothing
   D. Interrupt to disk
   Answer: B. A whole block is loaded. (Key point: Miss)

3. Why is average access time close to cache time?
   A. Cache is large
   B. Locality of reference makes most accesses hits
   C. Memory is fast
   D. Tags are small
   Answer: B. Most accesses hit due to locality. (Key point: Locality)

## Related in Computer Organization and Architecture

- [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
