2

In numerous questions for calculating average access times, in some cases I am provided with the Hit Ratio(H), Miss Penalty(M) and Cache access time(C).

The formula therefore is

T = HC + (1-H)M

But on some other cases instead of miss penalty the main memory access time (say X) is provided.

According to my logic, the data has to be searched in cache before proceeding to Main Memory, so technically, M = C + X

But in many sources, I can see that the cache access time is ignored and the formula is directly written as

T = HC + (1-H)X instead of T =HC + (1-H)(X+C)

Is this logic right or am I the one who's correct?

tirtha2shredder
  • 105
  • 1
  • 7
  • The cache miss penalty is the time that it will take to retrieve the data from the resource that is cached. – Robert Harvey Jun 05 '14 at 19:39
  • Can you tell us where you found these equations? – Robert Harvey Jun 05 '14 at 19:46
  • The cache is so much faster than main memory that there's practically no difference. A chip that ran cache-lookup and memory-access prep in parallel, cancelling the memory access on cache hit, would use the HC+(1-H)X calculation. – jthill Jun 05 '14 at 19:48
  • @jthill Consider the situation that cache access time is 40ns and Main Memory Access time of 100ns and a hit ratio of 0.8. Would either calculation make any difference? By HC + (1-H)X T= 52 ns By HC + (1-H)(X+C) T = 60 ns – tirtha2shredder Jun 05 '14 at 19:59
  • Point is, you'll have to consult the chip manual. Your sample cache latency is a bit off, those are measured in clock cycles -- on Ivy Bridge I believe it's 4. On a 3GHz chip clock ... – jthill Jun 05 '14 at 20:06
  • [yup](http://stackoverflow.com/questions/4087280/approximate-cost-to-access-various-caches-and-main-memory). So for your 80% rate it's 20ns average one way or 21ns the other. – jthill Jun 05 '14 at 20:31

0 Answers0