---
title: "Which cache is better (2KB vs 8KB)"
subject: "Embedded System"
chapter: 4
key: "semester_6/embedded_system:cache-comparison-2kb-8kb"
source: https://www.bctengineer.com/q/semester_6/embedded_system/cache-comparison-2kb-8kb
site: BCT Engineering
---

# Which cache is better (2KB vs 8KB)

Embedded System · Chapter 4: Memory

- Asked in: 2076 Baisakh, 3 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/embedded_system/cache-comparison-2kb-8kb
- Whole chapter: https://www.bctengineer.com/md/semester_6/embedded_system/chapter-4

## Question

Determine which cache memory is better:

| | Size | Miss Rate | Hit Cost | Miss Cost |
|---|---|---|---|---|
| Cache A | 2KB | 15% | 2 cycles | 30 cycles |
| Cache B | 8KB | 5% | 4 cycles | 30 cycles |

## Short answer

Average access time = hit_rate × hit_cost + miss_rate × miss_cost. Cache A: 0.85×2 + 0.15×30 = 6.20 cycles. Cache B: 0.95×4 + 0.05×30 = 5.30 cycles. Cache B is better with lower average access time.

## Answer

The better cache is the one with the smaller **average memory access time**.

**Formula:** average access cost = (hit rate x hit cost) + (miss rate x miss cost)

#### Cache A (2KB): miss rate 15 %, hit rate 85 %
```text
 = 0.85 x 2 + 0.15 x 30
 = 1.70 + 4.50
 = 6.20 cycles
```
#### Cache B (8KB): miss rate 5 %, hit rate 95 %
```text
 = 0.95 x 4 + 0.05 x 30
 = 3.80 + 1.50
 = 5.30 cycles
```
**Answer: Cache B is better,** with an average access time of 5.30 cycles against 6.20 cycles.

The larger cache B has a slower hit time, but its much lower miss rate more than compensates, so B wins. (If miss cost is taken as an extra penalty on top of the hit time, the cost is hit cost + miss rate x miss cost: A = 6.50, B = 5.50; the conclusion is the same.)

## Check yourself

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

1. Which formula gives the average access cost?
   A. hit rate x hit cost + miss rate x miss cost
   B. hit cost + miss cost
   C. miss rate x hit cost
   D. size / miss rate
   Answer: A. Average cost = (hit rate x hit cost) + (miss rate x miss cost). (Key point: Formula)

2. Average cost of Cache A (miss 15%, hit cost 2, miss cost 30)?
   A. 6.20 cycles
   B. 5.30 cycles
   C. 4.50 cycles
   D. 3.80 cycles
   Answer: A. 0.85 x 2 + 0.15 x 30 = 1.70 + 4.50 = 6.20 cycles. (Key point: Cache A calculation)

3. Cache B gives 0.95 x 4 + 0.05 x 30 = 5.30 cycles. Which cache is better?
   A. A, because its hit cost is lower
   B. B, because 5.30 < 6.20
   C. Neither
   D. A, because it is smaller
   Answer: B. B's much lower miss rate more than compensates for the slower hit, so B wins. (Key point: Cache B and conclusion)

## Close variants set in other exams

- [Which cache is better (4KB vs 12KB)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Acache-comparison-4kb-12kb) — Embedded System, chapter 4, asked 2×

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

- [LRU replacement with hit and miss](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Alru-replacement) — Computer Organization and Architecture, chapter 6
- [Process to determine wire size](https://www.bctengineer.com/question.md?key=semester_1%2Fbasic_electrical_and_electronics_engineering%3Awire-size-determination) — Basic Electrical and Electronics Engineering, chapter 4
- [Direct mapping with 32-block memory, 8-block cache](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Adirect-mapping-example) — Computer Organization and Architecture, chapter 6, asked 3×
