edited by
9,844 views
3 votes
3 votes

A computer has a cache, main memory, and a disk used for virtual memory. If a referenced word is in the cache, 20 ns are required to access it. If it is in main memory but not in the cache, 60 ns are needed to load it into the cache, and then the reference is started again. If the word is not in main memory, 12 ms are required to fetch the word from disk, followed by 60 ns to copy it to the cache, and then the reference is started again.The cache hit ratio is 0.9 and the main memory hit ratio is 0.6.What is the average time in nanoseconds required to access a referenced word on this system


ans

tavg=Hit_cache*time_cache+(1-Hitcache)(hit_main)[60+20]+(1-hit_cache)(1-hit_mainmmry)[60+12+20]

edited by

1 Answer

Best answer
11 votes
11 votes
Question shows a hierarchical memory system

$T_{avg}=hit_{cache} \times time_{cache}\\+\left(1-hit_{cache}\right)  \left(hit_{memory}\right) \left[time_{cache}+time_{memory}\right]\\+\left(1-hit_{cache}\right)\left(1-hit_{memory}\right)\left[time_{cache}+time_{memory}+time_{disk}\right]$

$= 0.9 \times 20 \\+ 0.1 \times 0.6 \times 80 \\ + 0.1 \times .4 \times 12000080$

We can also use the formula

$T_{avg}= time_{cache}\\+\left(1-hit_{cache}\right)  \left[time_{memory}\right]\\+\left(1-hit_{cache}\right)\left(1-hit_{memory}\right)\left[time_{disk}\right]$

$= 20 + 0.1 \times 60 + 0.1 \times 0.4 \times 12000000$
selected by
Answer:

Related questions

0 votes
0 votes
0 answers
1
1 votes
1 votes
1 answer
3
4 votes
4 votes
2 answers
4
rahul sharma 5 asked Nov 7, 2017
846 views
A computer has 170 different instructions.Word size is 4B and one word instruction has 2 address fields.One adress for register and one address for memory.If there are 37...