145k views
25 votes
A computer has a cache, main memory, and a disk. If a referenced word is in the cache, 20ns are required to access it. If it is in main memory but not in the cache (called cache miss), 80ns are needed to load it into the cache (this includes the time to originally check the cache), and then reference is started again. If the word is not in main memory, 25ms are required to fetch the word from disk, followed by 80ns to copy it to the cache, and then the reference is started again. The cache hit ratio is 0.95 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 (state the number only without the unit, round to the closest integer -- for instance of your answer is 100.7 ns, enter: 101)

User Fudy
by
5.8k points

1 Answer

6 votes

Answer:

250,024

Step-by-step explanation:

We will have to calculate cache access, main memory access and disk access. Then add up the sum of all these to get the answer

1. Cache access

= Time x hit ratio

= 0.95 x 20 ns

= 19ns

2. Main memory access

= (1-cache hit ratio)*(memory hit ratio)*(cache time + memory time)

= (1-0.95)*0.8*(20ns + 80ns)

= 0.05 x 0.8 x 100

= 4ns

3. Disk access =

(1-cache ratio)*(1-memory ratio)*(cache time + memory time + disk time)

Disk time = 25ms = 25x1000000 = 25000000ns

= (1-0.95)*(1-0.8)*(20+80+25000000)

= 0.05x0.2x25000100

= 250001 ns

When we sum all of these values

Average time = 19ns + 4ns + 250001ns

= 250,024ns

This is the average time required to access a referenced word

User GChuf
by
5.2k points