retagged by
680 views
2 votes
2 votes

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

I think answer should be

Cachehit  * Tcache + (1-cachehit) (Tcache + Memoryhit*TMemory +( 1- Memoryhit) (TMemory+Tsec. memory ) )

retagged by

1 Answer

0 votes
0 votes
cache access time = tc

cache_load_time(from main memory)= tm

cache_load_time(from secondary memory)= tsec

fetch from secondary memory time = ts*10^6 ns (as it is in milisecond)

refrence time(cache access time) = tr

tavg time = cache hit ratio( tc ) + (1-cache hit ratio)( memory hit ratio( tm + tr + ) + (1-memory hit ratio)(ts + tsec + tr))

= 0.9(20)+0.1(0.6(60+20)+0.4(12000000 + 60 + 20))

= 18 + 0.1(0.6*80 + 0.4(12000080))

= 18 + 0.1(48 + 4800032)

= 18 + 0.1(4800080)

= 18+ 480008

= 480026 ns

Related questions

2 votes
2 votes
2 answers
1
0 votes
0 votes
0 answers
3