Here Write Through technique is used , for write through cache write operation is simultaneous only .
" cache memory access time is 100 ns and main memory is 10 time slower than cache memory. "
means main memory access time is 100 * 10 = 1000 ns ( due to 10 times slower )
In order to find avg time we have a formula
Tavg = hc+(1-h)M where
h = hit rate
(1-h) = miss rate
c = time to access information from cache
M = miss penalty (time to access main memory)
In Write through operation : cache and main memory is updated simultaneously.
It is given that 85% request generated by CPU is read request and 15% is write request.
Avg read time will be : 0.92 * 100 + 0.08 * (1000 + 100 ) = 92 + 88 = 180
here by default cache access is hierarchical so 100 is added with 1000 . And hit ratio for read request is 0.92 is given .
- Avg Write Time = 1000 ns (write Through use write no allocate technique means main memory and cache is updated at the same time ) so to calculate avg time for write , we took MM access time that is 1000 ns . Here we take simultaneous approach .
- It came this way ( 0 * 100 + 1 * 1000 = 1000 ) as nothing is given about hit ratio in case of write request , so we can take it as 0 and for miss it is 1-hit = 1-0 =1 .
Tavg = 0.85(avg time for read request)+ 0.15(avg time for write request)
= 0.85(0.92*100 + 0.08* 1100)+ 0.15(avg time for write request)
= 0.85 * 180 + 0.15 * 1000
= 153 + 150
= 303
The average access time is 303 ns