The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+35 votes
6.8k views

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 \hspace{0.1cm} \text{nanoseconds}$, $20 \hspace{0.1cm} \text{nanoseconds}$ and $200 \hspace{0.1cm} \text{nanoseconds}$ for $L1$ cache, $L2$ cache and the main memory unit respectively.

 

When 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?

  1. $222 \hspace{0.1cm} \text{nanoseconds}$
  2. $888 \hspace{0.1cm} \text{nanoseconds}$
  3. $902 \hspace{0.1cm} \text{nanoseconds}$
  4. $968 \hspace{0.1cm} \text{nanoseconds}$
asked in CO & Architecture by Veteran (116k points)
edited by | 6.8k views
0
Does anyone knows what was the answer in official answer key? there seems to be a lot of different arguments.
+1
In 2010 they didnt release answer keys
+1
968 is the correct answer because as data line between L1 ,L2 , main memory=4 words

L2 block size  size=16 words . so we need to bring 16 words from main memory to L2 and then 16 words to L1 . for this

4 acces to main memory for loading 16 words of data into L2 =4*200=800

4 acces to L2 for storing 16 words of data into L2=4*20=80

4 acces to L2  for loading 16 words of data to L1=4*20=80

4 access to L1 cache for storing 4 words of data=4*2=8

total=800+80+80+8=968
0

memory access time is what? 

time to access one WORD or time to access one BLOCK ?

0

4 acces to L2  for loading 16 words of data to L1=4*20=80

4 access to L1 cache for storing 4 words of data=4*2=8

Only 1 access is required

7 Answers

+71 votes
Best answer
The transfer time should be $4*200 + 20 = 820$ ns. But this is not in option. So, I assume the following is what is meant by the question.

$L2$ block size being $16$ words and data width between memory and $L2$ being $4$ words, we require $4$ memory accesses(for read) and $4$ $L2$ accesses (for store). Now, we need to send the requested block to $L1$ which would require one more $L2$ access (for read) and one $L1$ access (for store). So, total time

$= 4 * (200 + 20) +  (20 + 2)$

$= 880 + 22$

$= 902 \ ns$

Correct Answer: $C$
answered by Veteran (399k points)
edited ago by
+2
VeryCorrect
0
@Arjun Sir shall we send (16 or 4 words) to L1 from L2.

I think we sud send 4 word as block size for L1=4 word and
processor here requested to L1 Cache.

Plz clarify sir .
+6
What does time to store specify?
I reached the answer as follows

1) access L1 -miss -. 2ns
2)check in L2 -miss - 20ns
3)access main memory- a block of 16 words in main memory(assuming)- 200 *4 = 800 ns
4)now transfer the word received in L2 to l1 --  will take 4 cycles- 4*20 =80

now the tranfer is complete, time taken= 2+20+800+80 =902ns
0
Now it makes more sense that only one block should be transferred to L1 from L2 cache..
+12
@ arjun sir, how to guess that when question means only access time for transfer or when it means access+store time as transfer time. No matter how many questions we solve, these things are alwys so ambiguous. :(. Disheartening
0
@Arjun sir, sir why do we require 4 memory access from main memory to L2? L1 cache size is 4 word so finally, the required block is with 4 words and that 4 words can be distinguished by word offset in main memory,  in the worst case that 4 words may be present in 4 different blocks of main memory. so L2 will have to access main memory 4 times and then it will be stored in L1.

so, is that the correct reason of 4 memory reference by l2?
0

The transfer time should be 4*200 + 20 = 820 ns.

Looks good to me.

0
Using 20ns as the store in L2 is almost senseless. Access time means how much time it takes to move from one location to another (request + response). Store and access time has no relation. But there's no other way to solve it, is there? :(
0

https://gateoverflow.in/user/sushmita  when he asks for the average access time we generally don't consider store but when we are asked the total time taken for the transfer of the missing data in L1 to be in its position we have to consider store time also 

0
Even data width between L1 and L2 is also 4 words, why are we considering only one memory access for all 4 words. If Yes, even we should consider for L2 and L3, then access time from L3 to L1 would be 200 + 20 = 220ns.

Please correct me if i am wrong.
0
what is the answer given in the official gate answer key..?
+3
Before 2011 there were no official answer keys -- it was British raj for central level exams then ;)
+1

This is a very confusing question .... this one also ... https://gateoverflow.in/2352/gate2010-48 ....

0
@arjun sir great explanation ,,,sir you remove lots of doubts regarding these types of questions
0
nice arjun sir dil khush ho gaya
+16 votes

scene 1

  • L2 block size is 16 words
  • Data width between l2 and Main Memory is 4 words
    $\Rightarrow$ We need 4 access to Read from Memory and 4 access to store to L2
     To Read from MM require 200ns and To Store in L2 require 20 ns
     Total Time spent : 220 ns

scene 2

  • stored information from L2 is read and stored on L1
  •  Read from L2 takes 20ns and store on L1 takes 2 ns
     $\Rightarrow$  Total time spent in scene - 2 is  22ns

scene 1 and scene 2 can occur simultaneously which is depicted in the following figure

So , Total time spent
(220 *4 ) + 22 = 902 ns

answered by Boss (22.6k points)
edited by
+1
you are right almost but i have one dout ... suppose L1 cache having only 2 blocks so what is need to transfer all 4 blocks from L2 to L1 ... ??
0
Why u want to transfer 4 blocks from L2 to L1.
0
As in question it is asked that's y we need to transfer from l2 to l1
0
@Gabbar ,

When L1 is 2 blocks then will we transfer 4B still  from l2 ? or is there any ways we can transfer 2Blocks alone ?
0
@pc sir great explanation ,,,sir you remove lots of doubts regarding these types of questions
+6 votes

Miss in L1 cache and L2 cache results in the:

(200+20) for one word to get from main memory to l2 cache
(20+2) for one word to get from L2 cache to L1 cache

So total Time Needed is:   (200+20)*4  + (20+2)*4   = 968 

answered by Active (4.6k points) 1 flag:
✌ Edit necessary (Divy Kala “Wrong”)
0
Transfer is done word by word or block by block ? Transfer time which is given for a block or for a word ?
0
this answer i more correct as i also get the same answer and answer given on geeks for geeks is also 968
+3 votes

The size to transfer a block is always decided by source(Do not confuse yourself by looking "a block is transferred from L2 cache to L1 cache). In this case first 16 world will be transferred from main memory to L2 cache then only 4 words will be transferred from L2 to L1 not whole block of L2. Now the only confusion is "This whole process of transferring block is concurrent process or serial?".

If nothing is mentioned in the question then take serial transfer of block (in computer science we always strive for Worst case) so 200ns to access main memory and 20ns to store in L2 cache,again 20ns to access or read L2 cache and 2ns to place or write it into L1 cache. so answer would be

4*(200+20) + 20 + 2 = 902.

answered by Active (1.7k points)
edited by
+1 vote

answer is 902.

answered by (263 points)
–2 votes
Access time from main memory is 200. So total time to access is is 200+20 nanoseconds Similarly for L1 cache to access from L2 cache is 20+2 nanoseconds So total time is 4*(220 + 22) = 968 nanoseconds.
 
answered by (49 points)
+4
only the requested block will be sent from L2 to L1.
–2 votes
Answer is A

Time for transferring from main memory to L2 is 200ns . time for transferring from L2 to L1 is 20ns. Time needed to write into L1 is 2ns. The total time taken is 200 + 20 + 2 = 222ns.
answered by Active (3.9k points)
0
In single time, data bus can carry only 4 words so for transfer 16 words (1 block) u have to 4 times access memory and L2 cache. Then 4*(200+20) = 880ns.

And in between L2 and L1 the block size is 4 word that would take (20 + 2)ns.

So totel time is 902ns.
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,397 questions
53,563 answers
185,727 comments
70,837 users