retagged by
4,225 views
6 votes
6 votes

Consider a two level memory hierarchy. L1 (cache) has an accessing time of 10 ns and main memory has an accessing time of 20 ns. Writing or updating contents into their memory takes 20 ns and 30 ns for L1 and main memory respectively. Assume L1 gives misses 80% of the time.
The average writing time for system (in ns) if it uses WRITE-THROUGH technique is ______.

------------------------------------------------------------------------------------------------------------------------------------------------------------------

Here I think answer should be 30, as in write Through Main Memory is updated no matter what !

Made Easy FLT 6- Practice Test 14

retagged by

2 Answers

Best answer
11 votes
11 votes
Answer should be 30, as in write Through Main Memory is updated no matter what !

Ignoring the access times as writing time is directly given in question.

All memory access for write operations goes to main memory and cache simultaneously (as there is no need to wait to see if cache hit/miss occur).

So, average access time here is given by

$T_{avg} = 0.2 \times \max(20,30) + 0.8 \times \max(20,30) = 30$
edited by
5 votes
5 votes

 In Write - Through Technique , every write operation to the CACHE is repeated to the main memory AT THE SAME TIME.  That means  cache write / update and memory write/ update is done paralley means both have done at the same time .

[when cache miss occurs before updating the main memory block, we need to first find that block in the memory , is it available or not . That's why need to add main memory access time in case of cache miss .] // ambiguous part, need not to consider due to practicality though in question it is given access time and writing/updating time separately 

Update: 

The question implicitly assumes that all the blocks required are contained within the main memory hence no need for extra search time . we no need to check whether a block exists or not because, if it doesn't exist then we have to go to secondary storage but that is not mentioned in the question .

As they mention " Consider a two level memory hierarchy " in the question itself .

Write-Through Technique use Write No Allocate Policy . Where the missed Main memory block is updated while residing in the main memory and not brought to the cache.  

Now, H = hit rate in cache 
Tc = cache access time 
Tm = memory access time

memory update time = 30 ns

here H = 20% , Tc= 10 ns Tm = 20 ns 

for this problem formula used is  : 

TAvg writing Time  = H * T mem update time + ( 1 - H ) * ( T mem update time ) .

TAWT = 0.2 * 30  +  0.8 * ( 30 ) 

         = 6 + 24

         = 30 

so  answer is 30 ns. 

edited by
Answer:

Related questions

1 votes
1 votes
1 answer
1
1 votes
1 votes
1 answer
3
0 votes
0 votes
1 answer
4