- Asked 2/19
- 2076 Baisakh · 3 marks
Which cache is better (2KB vs 8KB)
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.
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 |
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 %
= 0.85 x 2 + 0.15 x 30
= 1.70 + 4.50
= 6.20 cycles
Cache B (8KB): miss rate 5 %, hit rate 95 %
= 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.)
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Which cache is better (4KB vs 12KB) · 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×