retagged by
6,671 views
19 votes
19 votes

64 word cache and main memory is divided into 16 words block.The access time of cache is 10ns/word and for main memory is 50ns/word. The hit ratio for read operation is .8 and write operation is.9. Whenever there is a miss in cache, associated block must be brought from main memory to cache for read and write operation. 40% reference is for write operation. Avg access time if write through is used.

retagged by

2 Answers

Best answer
25 votes
25 votes
Cache access time = 10 ns
1 block main memory access time $= 50\times 16 = 800 ns$ (as from main memory, entire cache block is retrieved)

Then use this formula
$T_{avg_R} = h_r \times t_c+(1-h_r)\times (t_m + t_c) = 0.8 \times 10 + 0.2 \times (800 + 10) = 170 ns$ (Hierarchical access is default in case of read)

Whenever cache is missed, data (entire cache block) must come from main memory for write as per question. Also for all write operations, one word of data is written to main memory as cache is WRITE THROUGH. In WRITE THROUGH cache since main memory is always updated, memory arrangement is simultaneous and hence cache access time need not be considered (as it should be smaller than main memory access time and both happens in parralel).

$T_{avg_W} = h_w\times t_m + (1-h_w)  (t_m + 800 )$

$= 0.9 \times 50 + 0.1 \times 850 = 130 ns$

$T_{avg}= f_r\times T_{avg_R}+ f_w\times T_{avg_W} = 0.6 \times 170 + 0.4 \times 130 = 154 ns.$
edited by
Answer:

Related questions

0 votes
0 votes
0 answers
4