- Asked 2/19
- 2078 Baisakh · 3 marks
Which cache is better (4KB vs 12KB)
Short answer
Average access time = hit_rate × hit_cost + miss_rate × miss_cost. Cache A: 0.85×3 + 0.15×25 = 6.30 cycles. Cache B: 0.95×6 + 0.05×25 = 6.95 cycles. Cache A is better with lower average access time.
Determine which cache memory is better:
| Size | Miss Rate | Hit Cost | Miss Cost | |
|---|---|---|---|---|
| Cache A | 4KB | 15% | 3 cycles | 25 cycles |
| Cache B | 12KB | 5% | 6 cycles | 25 cycles |
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 (4KB): miss rate 15 %, hit rate 85 %
= 0.85 x 3 + 0.15 x 25
= 2.55 + 3.75
= 6.30 cycles
Cache B (12KB): miss rate 5 %, hit rate 95 %
= 0.95 x 6 + 0.05 x 25
= 5.70 + 1.25
= 6.95 cycles
Answer: Cache A is better, with an average access time of 6.30 cycles against 6.95 cycles.
The larger cache B has a slower hit time, but its much lower miss rate does not compensate for it here; the smaller cache A 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.75, B = 7.25; the conclusion is the same.)
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Which cache is better (2KB vs 8KB) · Embedded System, chapter 4 · asked 2×
- Cache memory mapping techniques · Embedded System, chapter 4 · asked 3×
- LRU replacement with hit and miss · Computer Organization and Architecture, chapter 6
- Process to determine wire size · Basic Electrical and Electronics Engineering, chapter 4
- Direct mapping with 32-block memory, 8-block cache · Computer Organization and Architecture, chapter 6 · asked 3×