We want the expected time per access. Let a single access take:
Thit if it hits (probability =1−m, where m = miss rate),
something longer if it misses (probability =m).
Key modeling decision: On every access we first look in the cache — so we always pay Thit. Only when we miss do we pay the extra trip to lower memory, Tpenalty.
State the AMAT formula and why HT isn't multiplied by miss rate.
Derive AMAT from the two-outcome expected value.
Why does adding L2 reduce AMAT even though DRAM is still slow?
Difference between local and global miss rate?
In Example 1, what fraction of AMAT came from misses?
Recall Feynman: explain to a 12-year-old
Imagine your school locker (fast) holds most of your books. Usually you grab a book instantly — that's a hit. But sometimes the book is in the far-away library (slow) — a miss. On average, how long to get a book? Almost always fast, but the rare library trips are so slow they pull the average up. AMAT is just that average waiting time. To make it small, we don't try to make the locker faster — we try to make library trips rarer (fewer misses) or add a nearer "shelf" (L2) so we rarely go all the way to the library.
Dekho, memory hierarchy ka main funda ye hai ki cache bahut fast hoti hai lekin choti, aur main memory (DRAM) badi lekin slow. Har access pe pehle cache check karte ho — agar mil gaya to hit (fast), nahi mila to miss (DRAM tak jana padta hai, bahut slow). AMAT ka matlab hai: average me ek access me kitna time lagta hai. Formula: AMAT = Hit Time + Miss Rate × Miss Penalty.
Yaha sabse important baat: Hit Time hamesha lagti hai kyunki har baar cache to check karni hi padti hai. Isliye usko miss rate se multiply nahi karte — wo flat cost hai. Sirf Miss Penalty (DRAM ka extra time) tabhi lagta hai jab miss hota hai, isliye usko miss rate se multiply karte hain. Example: HT=1ns, miss rate 5%, penalty 100ns → AMAT = 1 + 0.05×100 = 6 ns. Dekho, 6 me se 5 ns to sirf misses ki wajah se aaya — matlab thode se misses hi average ko upar khींch dete hain!
Ab multi-level: L1 miss hone pe seedha DRAM mat jao — beech me L2 laga do. To L1 ka miss penalty ab L2 ka AMAT ban jaata hai. Formula nested ho jaata hai: AMAT = HT_L1 + m_L1(HT_L2 + m_L2 × MP_L2). Iska fayda ye ki DRAM ka bada 200ns penalty ab bahut kam baar lagta hai (m_L1 × m_L2, ek tiny number), isliye overall AMAT gir jaata hai.
Yaad rakho: performance improve karni hai to hit time se zyada miss rate kam karo — kyunki misses hi average ko dominate karte hain. Locality (spatial + temporal) isliye important hai, wo hit rate badhati hai.