177k views
5 votes
A computer system has an L1 cache, an L2 cache, and a main memory unit.

The block size in L1 cache is 4 words. The block size in L2 cache is 16 words.
The memory access times are 2 nanoseconds. 20 nanoseconds and 200
nanoseconds for L1 cache, L2 cache and main memory unit respectively.
Assume processor needs 4 words. 2 word accesses are hit in L1 cache. 1 word
access is hit in L2 cache. If there is a miss in both L1 cache and L2 cache, first
a block is transferred from main memory to L2 cache, and then a block is
transferred from L2 cache to L1 cache. What is the total time taken for these
transfers using hierarchical cache access? Justify your answer with
explanation.

1 Answer

2 votes

Final answer:

The total time taken for the transfers using hierarchical cache access is 220 nanoseconds.

Step-by-step explanation:

The total time taken for the transfers using hierarchical cache access can be calculated by considering the access times for each level of the cache and the main memory unit.

From the given information, we know that the memory access time for L1 cache is 2 nanoseconds, for L2 cache is 20 nanoseconds, and for the main memory unit is 200 nanoseconds.

Since there is a miss in both L1 cache and L2 cache, a block needs to be transferred from the main memory to L2 cache first, which takes 200 nanoseconds. Then, another block is transferred from L2 cache to L1 cache, which takes an additional 20 nanoseconds.

Therefore, the total time taken for the transfers is 200 nanoseconds (transfer to L2 cache) + 20 nanoseconds (transfer to L1 cache) = 220 nanoseconds.

User Kricket
by
8.6k points