I know how to calculate the CPI or cycles per instruction from the hit and miss ratios, but I do not know exactly how to calculate the miss ratio that would be 1 - hit ratio if I am not wrong. I know that the hit ratio is calculated dividing hits / accesses, but the problem says that given the number of hits and misses, calculate the miss ratio.

My reasoning is that having the number of hits and misses, we have actually the number of accesses = hits + misses, so the actual formula would be:

hit_ratio = hits / (hits + misses)

So the miss ratio would be

miss_ratio = 1 - hit_ratio

If my reasoning is correct, right?

What is the hit and miss latencies? Because I need them to calculate the mean access time using the hit and the miss ratios and the hit and the miss latencies (in cycles)...


1 Answer 1


Yes. The hit ratio is the fraction of accesses which are a hit. The miss ratio is the fraction of accesses which are a miss. It holds that $$ \text{miss rate} = 1-\text{hit rate}.$$

The (hit/miss) latency (AKA access time) is the time it takes to fetch the data in case of a hit/miss. If the access was a hit - this time is rather short because the data is already in the cache. But if it was a miss - that time is much linger as the (slow) L3 memory needs to be accessed. The latency depends on the specification of your machine: the speed of the cache, the speed of the slow memory, etc.

  • $\begingroup$ mean access time == the average time it takes to access the memory. If it takes X cycles for a hit, and Y cycles for a miss, and 30% of the time is a hit (thus 70% is a miss) -> what is the average (mean) time it takes to access ?? $\endgroup$
    – Ran G.
    Commented Nov 2, 2014 at 14:26
  • $\begingroup$ @RanG. Can you take a look at my caching hit/miss question? cs.stackexchange.com/questions/43235/… $\endgroup$ Commented Jun 4, 2015 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.