In a two-level cache system, the level one cache has a hit time of 1 ns (inside the CPU), hit rate of 90%, and a miss penalty of 20 ns. The level two cache has a hit rate of 95% and a miss penalty of 220 ns. What is the average memory access time?

What is a two-level cache system and how to calculate the time required? Since the hit time of level two cache is missing...


First Let's define all given things

  • L1 Cache hit: 90% & Time: 1ns

L2 and RAM has hit rate 10% out of which 95% which is 9.5% in total

  • L2 Cache hit: 9.5% & Time 20ns

RAM has hit rate 5% of 10% = 0.5%

  • RAM hit: 0.5% & Time 220ns

Formula Avg Memory Access Time

AMAT = L1_hit * L1_T + L2_hit * L2_T + RAM_hit * RAM_T

AMAT = 0.9*1 + 9.5*20 + 0.5*220

AMAT = 300.9ns

What is 2 level cache system:

First cache called L1 is reside on CPU is too fast. When CPU needs data, it checks in L1 cache but if it is not there it will go to L2. L2 cache is sometimes on CPU or outside CPU it depends on architecture of CPU. It does similarly and here also it missed then it fetch data from RAM which is expensive process.


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.