Find the average access time experienced by the CPU in a system with t...
The secondary cache can be considerably slower, but it should be much larger to ensure a high hit rate. If the speed is less critical, it only affects the miss penalty of the primary cache. A workstation computer may include a primary cache with the capacity of tens of kilobytes and a secondary cache of several kilobytes and several megabytes.
tavg = h1c1 + (1 - h1) h2c2 + (1 - h1)(1 - h2) M
The number of misses in the secondary cache is given by the term (1 - h1) (1 - h2) .
Find the average access time experienced by the CPU in a system with t...
To find the average access time experienced by the CPU in a system with two levels of caches, we need to consider the hit rates and access times of each cache level and the main memory.
Let's break down the given options and analyze each one:
a) h1c1 + h2c2 + (1 - h1h2)M
In this option, we are considering the access time in the primary cache (h1c1), the access time in the secondary cache (h2c2), and the access time in the main memory (M) for cache misses. The term (1 - h1h2) represents the cache miss rate for both the primary and secondary caches. However, this option does not take into account the possibility of a cache hit in the secondary cache after a miss in the primary cache.
b) h1c1 - h2c2 + (1 - h1h2)M
This option is similar to the previous one, but it subtracts the access time in the secondary cache (h2c2) from the access time in the primary cache (h1c1). It also considers the cache miss rate for both caches and the access time in the main memory for cache misses. However, it does not consider the case where a miss in the primary cache is followed by a hit in the secondary cache.
c) h1c1 + (1 - h2)h1c2 + (1 - h1)(1 - h2)M
In this option, we consider the access time in the primary cache (h1c1), the access time in the secondary cache after a miss in the primary cache ((1 - h2)h1c2), and the access time in the main memory for cache misses ((1 - h1)(1 - h2)M). This option takes into account the possibility of a cache miss in the primary cache followed by a hit in the secondary cache.
d) h1c1 + (1 - h1)h2c2 + (1 - h1)(1 - h2)M
This option is similar to the previous one, but it considers the access time in the secondary cache after a miss in the primary cache ((1 - h1)h2c2) instead of considering the access time in the secondary cache after a miss in the primary cache ((1 - h2)h1c2). This option also takes into account the possibility of a cache miss in the primary cache followed by a hit in the secondary cache.
The correct answer is option 'd'. It correctly considers the access times and hit rates of both cache levels and the main memory, including the possibility of a cache miss in the primary cache followed by a hit in the secondary cache.
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).