5.4.10 · D3 · HinglishMemory Hierarchy & Caches

Worked examplesAverage memory access time (AMAT)

2,741 words12 min read↑ Read in English

5.4.10 · D3 · Hardware › Memory Hierarchy & Caches › Average memory access time (AMAT)


Scenario matrix

Har AMAT problem in cells mein se ek (ya blend) hoti hai. Neeche har worked example ko us cell ke saath tag kiya gaya hai jis par woh land karta hai.

Cell Kya cheez ise special banati hai Example
A. Baseline single-level plain , ordinary numbers Ex 1
B. Degenerate perfect cache, kabhi miss nahi karta Ex 2
C. Degenerate har access miss karta hai (limiting worst case) Ex 2
D. Unit mismatch formula ke sabhi terms ek hi unit share karni chahiye combine karne se pehle — cycles aur ns mix karna classic trap hai Ex 3
E. Two-level nesting (local rates) L1 ka penalty = L2 ka AMAT Ex 4
F. Global-vs-local trap global rate diya hai, convert karna padega Ex 5
G. Solve backwards AMAT pata hai, unknown ya dhundho Ex 6
H. Real-world word problem ek story ko formula mein translate karo Ex 7
I. Exam twist — design tradeoff bada cache ko lower karta hai par raise karta hai; kaun jeetha? Ex 8

Hum inhe order mein walk karenge. Yahan har numeric answer verify block mein machine-checked hai.


Woh picture jo poore page ko chalati hai

Figure 1 — AMAT ki anatomy.

Figure — Average memory access time (AMAT)

Figure 1 mein split dekho: har access left mein flat green "hit" bar pay karta hai. Sirf fraction of accesses hi lambe coral "penalty" bar mein continue karte hain. AMAT green bar plus coral bar hai se scale down karke. Yeh image dimag mein rakhho — har example bas un dono bars ke liye numbers choose karna hai.


Worked examples








Figure — Average memory access time (AMAT)

Figure 2 Ex 8 ko visible banata hai: Cache B ka green (hit) bar taller hai, par uska coral (penalty) bar kahin zyada shrink karta hai — total stack chhoti hai.


Recall

Recall Cover karke answer do

Jab ho, AMAT kya equal hota hai? ::: Exactly hit time (band ka lower end). Jab ho, AMAT kya equal hota hai? ::: — worst case, har access dono pay karta hai (upper end). AMAT hamesha kin do values ke beech bounded hota hai? ::: . Global L2 miss rate aur diye hone par, local L2 rate kaise nikalen? ::: Divide karo: . Ex 8 mein, bada, slow cache phir bhi kyun jeeta? ::: Usne jo penalty save ki ( ns) woh extra hit time se zyada thi jo usne cost ki ( ns).


Connections