The cache is always checked first (5 ns). On a miss (10% of accesses) main memory is accessed in addition (80 ns more).
\(\text{AMAT} = t_{cache} + (1 - h) \times t_{mem} = 5 + 0.1 \times 80 = 5 + 8 = 13\ \text{ns}\)
Check, counting hits and misses separately:
\(0.9 \times 5 + 0.1 \times (5 + 80) = 4.5 + 8.5 = 13\ \text{ns}\)
Average memory access time = 13 ns.
— rhs