Using one level of Cache: Average Access Time Using one level of Cache: Avg. Access Time = CacheTime*CacheHit Rate + (CacheTime+MMTime)* CacheMiss Rate Note that: Hit Rate = 1 – Miss Rate Using two levels of Cache: Avg. AT = L1Time*L1Hit Rate + (L1Time+L2Time)* L2Hit Rate + (L1Time+L2Time+MMTime)* (1- (L1Hit Rate+L2Hit Rate))
Average Access Time (Example 1) A computer system with a cache and a main memory. The access time is: 10 nano seconds for the cache and 100 nano seconds for the main memory. Find the average access time if cache hit rate is 20%? Solution: The average access time = 0.2 * 10 + 0.8 * (10 + 100) = 90 nano seconds.
Average Access Time (Example 2) Another computer system uses 2 levels of cache (L1 and L2) and the main memory. The access time is: 5 nano seconds for L1 cache, 10 nano seconds for L2 cache and 100 nano seconds for the main memory. Find the effective access time if L1 cache hit 20%, L2 cache hit is 30%? Solution: The average access time = 0.2 * 5 + 0.3 * (5 + 10) + 0.5 * (5+10+100) = 63 nano seconds.