Similar questions 3 more →
Cache Memory

Answer & solution
Official answer: 4.0
Always pay the 1-ns L1 lookup. With probability 1−0.9=0.1, an L1 miss adds 10 ns for the next level. Of those L1 misses, a fraction 1−0.8=0.2 also miss L2 and incur the additional 100 ns. Therefore
AMAT=1+0.1[10+0.2·100]=1+0.1·30=4.0 ns.
An equivalent path-probability calculation makes the nesting clear. L1 hits occur with probability 0.9 and cost 1 ns. L1 miss/L2 hit occurs with probability 0.1·0.8=0.08 and costs 1+10=11 ns. Misses in both levels occur with probability 0.1·0.2=0.02 and cost 1+10+100=111 ns. Their weighted sum is 0.9·1+0.08·11+0.02·111=4.0 ns.
The L2 hit rate is conditional on an L1 miss, not a separate 80% of all requests. Also, the stated miss penalties are additional times; treating them as inclusive complete-path times would describe a different model. Answer: 4.0.