For a system with two levels of cache, define:

  • $T_{c_1}$ is the first-level cache access time
  • $T_{c_2}$ is the second-level cache access time
  • $T_m$ is the memory access time
  • $H_1$ is the first-level cache hit ratio
  • $H_2$ is the combined first/second level cache hit ratio

Provide an equation for the average access time $T_a$ of a read operation.

  • $\begingroup$ I'm not sure but is Ta = Tc1(H1) + (Tc2+Tc1)(H2) + (Tc1+Tc2+Tm)(1-H2) the way to solve it? @YuvalFilmus $\endgroup$ Mar 19, 2017 at 15:42
  • $\begingroup$ Unfortunately I'm not your TA. If you can justify this formula, then it is probably true. You don't need us for that. $\endgroup$ Mar 19, 2017 at 15:43
  • $\begingroup$ This is the exact problem I have (copied straight from the Stallings book), and I know posting HM is distasteful, but this post (the OP's comment specifically) helped me think about how to write an equation for such a question. I had no idea how to do it otherwise. Whether it's correct, I guess I need to figure this out. So...1+ $\endgroup$
    – Mote Zart
    Mar 8, 2021 at 3:42

1 Answer 1


Here is the algorithm for a read operation:

  1. Check if the cell is in the first-level cache.
  2. If not, check if it is in the second-level cache.
  3. If not, access it from main memory.

The data you are given allow you to calculate how much time each operation takes, and what is the probability that each of the steps is being taken. Using this, you can calculate the average time of a read operation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.