A computer has a cache, main memory, and a disk used for virtual memory. If a word is in the cache, 30 ns are required to access it. If it is in main memory, but not in cache, 50 ns are needed to load it into the cache. And then the reference is started again. If the word is not in main memory, 15 milliseconds (1 millisecond = 106 ns) are required to fetch it from disk, followed by 50 ns to get it into the cache. If the cache hit ratio is 0.9, and the main memory hit ratio is 0.8, what is the average time in ns required to access a referenced word on this system?
Solution:
There will be three cases that needs to be considered:
Reference word Location |
Probability |
Access time in total (ns) |
In the cache |
0.9 |
30 ns |
In the main memory, but not in cache. |
(0.1)(0.8) = 0.08 |
50 + 30 = 80 ns |
Neither in cache nor in main memory |
(0.1)(0.2) = 0.02 |
15ms + 50 + 30 = 15,000,080 ns |
Therefore, the average access time would be computed as follows:
Average_access_time = (0.9)*30 + 0.08*(80)+0.02 * (15000080)
= 300035
Thus, the average time in ns required to access a referenced word on this system is 300035 ns.
Get Answers For Free
Most questions answered within 1 hours.