retagged by
6,600 views
13 votes
13 votes

A 64 word cache and main memory are divided into 16 word blocks. The main memory access time is 50 ns/word and the cache access time is 10 ns/word. Hit ratio for read operation is 80% and for the write operation is 90%. Whenever a cache miss happens, associated block must be brought from main memory to cache for both read and write operation. Let there be 40% references for write operations.

1) What is the throughput of the memory system for write through policy?

2) In the above problem if write back updation is used and at any point of time 30% cache blocks are modified, What is Tavg in write back policy?

Ans for :

1) is 6.5 Million words/sec

2) is 176.4 ns

retagged by

1 Answer

Best answer
12 votes
12 votes

First part answered here: https://gateoverflow.in/10668/64-word-cache-and-main-memory-is-divided-into-16-words-block

$t_m = 16 \times 50 = 800ns$ for transferring a block to cache. 

For write-back:

In write back, only when a block is being replaced from cache it will be written back to memory. And this write-back is needed only if the block is dirty. So, for both read as well as write miss, 30% of time the block must be written back to memory.

$T_{avg_R} = h_r \times t_c+(1-h_r) \times (t_m + t_c + 0.3\times t_m) \\= 0.8 \times 10 + 0.2 \times (800 + 10 + 240) = 218 ns$

Write-back avoids a memory access during a cache hit as compared to write-through. 

$T_{avg_W} = h_w \times t_c + (1-h_w)  (t_c + t_m + 0.3\times t_m) \\= 0.9 \times 10 + 0.1 \times [810 + 240] = 114 ns$

 

So, $T_{avg} = 0.6 \times 218 + 0.4 \times 114 = 176.4 ns$

selected by

Related questions

0 votes
0 votes
1 answer
1
2 votes
2 votes
0 answers
2
Shubhanshu asked Aug 5, 2017
784 views
According to my calculation, the time required in write back is 240ns and for write through it should be 1920ns. Is it correct or not?
0 votes
0 votes
1 answer
3