SME
Computer Organization & Architecture · Problem type
Average memory access time
Use this for “L1 hits in 1 cycle and misses 5% of the time; L2 hits in 10 cycles and misses 20% locally; memory takes 100 cycles. What is the AMAT?”
This is an example. Type your own values to start a new problem.
AMAT (cycles)
=
t₁ (cycle)
+
(
m₁ (%)
×
P₁ (cycles)
)
P₁ (cycles)
=
t₂ (cycles)
+
(
m₂ (%)
×
tₘₑₘ (cycles)
)
Formulas
AMAT
=
t₁
+
m₁
×
P₁
100
2.5
=
1
+
5
×
30
100
P₁
=
t₂
+
m₂
×
tₘₑₘ
100
30
=
10
+
20
×
100
100
Assumptions
•
Every time is in clock cycles; ns work too when every time on the page is in ns.
•
The L2 miss rate is local: the share of L1’s misses that also miss in L2.
•
With one cache level, type the memory time as the L1 miss penalty.
Step-by-step
WE KNOW
t₁ = 1 cycle, m₁ = 5%, t₂ = 10 cycles, m₂ = 20%, tₘₑₘ = 100 cycles
FIND
L1 miss penalty (P₁), average access time (AMAT)
Step 1 · Find L1 miss penalty (P₁)
Use P₁ = t₂ + m₂ × tₘₑₘ ÷ 100
Every access pays the L2 hit time; the share that misses also waits for memory (÷ 100 turns the percent into a fraction).
P₁
=
10
+
20
×
100
100
P₁
=
10
+
2,000
100
P₁ = 10 + 20
P₁ = 30 cycles
Step 2 · Find average access time (AMAT)
Use AMAT = t₁ + m₁ × P₁ ÷ 100
Every access pays the L1 hit time; the share that misses also waits for the next level (÷ 100 turns the percent into a fraction).
AMAT
=
1
+
5
×
30
100
AMAT
=
1
+
150
100
AMAT = 1 + 1.5
AMAT = 2.5 cycles
Check
Put the numbers back in. Both sides should match.
2.5
=
1
+
5
×
30
100
✓
30
=
10
+
20
×
100
100
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.