0
$\begingroup$

Why isn't the average access time of a cache (1-h)C and instead is hC? ,where h is the hit ratio and C is the access time of the cache? If the hit ratio is big ,then this means we have a cache hit most of the times so information(ideally) must be transfered back to the CPU in a small time. So my equation makes sense and not the one I have found online.

Thanks

$\endgroup$

1 Answer 1

1
$\begingroup$

I think that none of those equations really makes sense but maybe that would depend on how you define "average access time of a cache".

For example, if you have 100% cache miss, the formula $hC$ would result in average access time of $0$. If you have 0% cache miss, the formula $(1-h)C$ would also result in average access time of $0$.

What would makes sense is considering the average time of memory access, defined as: $$hC + (1-h)(C + M)$$ where $h$ and $C$ are defined the same way, and $M$ is the time of main memory access.

The idea is that when you have a cache hit, you access only to the cache. In case of cache miss, you have to account to the access time of the cache, and then the access time to the main memory (because you didn't find the searched value in the cache).

$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.