edited by
40,943 views
80 votes
80 votes

A computer system has an $L1$ cache, an $L2$ cache, and a main memory unit connected as shown below. 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 the main memory unit respectively.

 

When there is a miss in $L1$ cache and a hit in $L2$ cache, a block is transferred from $L2$ cache to $L1$ cache. What is the time taken for this transfer?

  1. $2$ nanoseconds
  2. $20$ nanoseconds
  3. $22$ nanoseconds
  4. $88$ nanoseconds
edited by

8 Answers

1 votes
1 votes

….…………………………………………………………………...

0 votes
0 votes

The block size of L2 is 16 words and of L1 is 4 words.The data bus between L1 and L2 can carry 4 words. 

It means that L2 needs to be accessed 4 times.

4*(Read access L2 + store it in L1) = 4*(20+2) = 4 * (22)  =  88 ns.

Answer is (D).

0 votes
0 votes

The correct answer is 88ns.

When there is a miss in L1 then entire block is going to move from L2 to L1. Block Size of L2 is 16 Words but system bus is capable of 4 words at a time. Hence, 4 times transfer operation will perform. here will also add the latency of L1 along with transfer time i.e. 

1. (20+2)=22

2. (20+2)=22

3. (20+2)=22

4. (20+2)=22

​​​​​​Total = 88ns.

Here the only trick is, although we know that the entire block is transferred from L2 to L1 of size 16 words. But system bus limited to 4 words at a time. Thats a confusion part of the question but has been defined clearly in the diagram. Diagram need to be considered seriously. 

If the diagram is not given, or its not been mentioned that the system bus is limited to 4 words at a time, then the answer could be 22ns. 

yes, in ideal case the answer could also be 20ns where stalls/instructions are negligible i.e stalls created when miss occurs is neglected. But question does not say anything ideal, hence we should go with counting L1 latency too. 

 

 

–5 votes
–5 votes
A block to access in L2 cache requires 20 nanoseconds, and 2 seconds to place in L1-cache. The block size in L1 cache is 4 words and there are total 16 words, so total time is 4*(20+2) = 88.
Answer:

Related questions

47 votes
47 votes
3 answers
2
37 votes
37 votes
5 answers
3
73 votes
73 votes
10 answers
4
go_editor asked Apr 21, 2016
26,927 views
A hash table of length $10$ uses open addressing with hash function $h(k) = k \: \mod \: 10$, and linear probing. After inserting $6$ values into an empty hash table, the...