CalcWorldHub
Computer science · CalcWorldHub

Average Memory Access Time: Combine Cache Hits and Misses

Average memory access time (AMAT) combines a cache hit time with the expected cost of misses. With a 1 ns hit time, a 5% miss rate, and a 60 ns miss penalty, AMAT = 1 + 0.05×60 = 4 ns. The result is an average under a one-level model, not a complete processor performance estimate.

Open calculator
A cache hit path is short while a miss follows a longer path to lower memory.

Share this article

AMAT equals cache hit time plus the miss-rate fraction multiplied by incremental miss penalty.
Convert the miss-rate percentage to a fraction before weighting the penalty.

Define each timing input

The calculator accepts Cache hit time (ns), Miss rate (%), and Miss penalty (ns). Hit time is the access cost paid for each reference in this simplified model. Miss rate is the fraction of references that miss, entered as a percentage. Miss penalty is the additional time charged when a miss occurs, in nanoseconds.

Use times measured or estimated on the same basis. A miss penalty is not automatically the total time for a miss if that total already includes the hit lookup; adding a total miss service time on top of hit time can double-count. The calculator’s equation is hit time + miss rate × miss penalty, so provide the incremental penalty intended by that convention.

Apply the weighted average

Convert the percentage m% to a fraction m = m%/100, then compute AMAT = h + m×p, where h is hit time and p is miss penalty. Hits contribute h; misses incur the base lookup plus the extra penalty. The compact expression is the expected time per access for this one-level representation.

For h = 1 ns, m = 5% = 0.05, and p = 60 ns, AMAT = 1 + 0.05×60 = 4 ns. Do not enter 5 as a fraction: the interface expects 5 percent and performs the division by 100. A 100% miss rate gives h+p; a 0% miss rate gives h.

Worked examples

One-level cache with 5% misses

Inputs: Hit time h = 1 ns; miss rate = 5%; miss penalty p = 60 ns

Calculation: AMAT = 1 + (5/100)×60 = 1 + 3

Estimated average access time is 4 ns under the calculator’s one-level convention.

Ten-percent miss rate

Inputs: Hit time h = 2 ns; miss rate = 10%; miss penalty p = 40 ns

Calculation: AMAT = 2 + (10/100)×40 = 2 + 4

Estimated average access time is 6 ns.

At a fixed one-nanosecond hit time and sixty-nanosecond penalty, reducing miss rate from five to two percent lowers AMAT from four to 2.2 nanoseconds.
A miss-rate change is multiplied by the miss penalty.

Read the average in context

AMAT can help compare cache configurations when the definitions and workload are held constant. A smaller hit time may be offset by a higher miss rate or penalty. Conversely, a modestly slower cache may still have a lower mean access time if it avoids enough expensive misses. The metric compresses these effects into one expected latency.

It does not describe the full distribution of access times. Most references may hit quickly while a small fraction wait much longer; the mean hides tail latency. It also does not directly account for out-of-order overlap, memory-level parallelism, write behavior, prefetching, multiple cache levels, or CPU work unrelated to memory. Use a detailed model or measured workload for those questions.

Check measurements and assumptions

Miss rate should be misses divided by references over the workload being analyzed, expressed from 0% to 100%. Use a rate from the relevant cache level and access type. A local miss penalty should represent the extra service cost specified by the model; mixing an L1 miss rate with an unrelated main-memory latency can distort the estimate.

The page accepts nonnegative hit time and miss penalty and a miss rate between 0 and 100%. A zero penalty or a zero hit time is mathematically accepted but should be checked against the system being described. The output is formatted to four decimal places in ns; that precision does not imply timing measurements are accurate to 0.0001 ns.

Use AMAT to compare one change at a time

Suppose a cache optimization changes miss rate while hit time and penalty stay fixed. At h = 1 ns and p = 60 ns, reducing misses from 5% to 2% changes the estimate from 4 ns to 2.2 ns. The 1.8 ns reduction follows directly from 0.03×60; it is useful for understanding sensitivity before a full benchmark.

For a defensible comparison, state the workload, reference count, cache level, and exact definitions of hit time and miss penalty. If a change affects more than one input, update all affected values rather than attributing the result to a single cause. Validate predicted improvements with representative traces or hardware measurements because cache behavior depends on access patterns and interactions among levels.

A percentage-point change matters in proportion to the miss penalty: reducing a 5% rate to 4% at a 60 ns penalty lowers this model by 0.6 ns, not by 1 ns. If the penalty itself changes between configurations, calculate both configurations with their own measured values rather than carrying the old penalty forward.

Sources and further reading

Share this article

Browse all articles · Calculator: Average memory access time calculator