edited by
13,743 views
35 votes
35 votes
Assume that for a certain processor, a read request takes $50\:\text{nanoseconds}$ on a cache miss and $5\:\text{nanoseconds}$ on a cache hit. Suppose while running a program, it was observed that $80\%$ of the processor's read requests result in a cache hit. The average read access time in nanoseconds is ______.
edited by

4 Answers

Best answer
57 votes
57 votes
Answer is: $14 \ ns$ $= 0.8(5) + 0.2(50)$

PS: Here instead of cache and main memory access times, time taken on a cache hit and miss are directly given in question. So, $$\text{Average Access Time} = \text{Hit Rate} \times \text{Hit Time} + \text{Miss Rate} \times \text{Miss Time}$$
edited by
6 votes
6 votes

Given time to read request on a cache miss=50ns

Time to read cache Hit= 5ns

it was observed that 80% of the processor's read requests result in a cache hit. 

The average read access time will be

50*0.2+5*0.8 =>14ns

3 votes
3 votes

$\text{Read Hit}:$ The main memory is not involved when there is a cache hit in a Read operation

$\text{Read Miss}:$ In this situation There are two cases :

  •  The block of words which containing the requested word copied from the main memory to cache and when block loaded into cache then requested word sent to the processor.
  • Requested word may be sent to the processor as soon as it reads from the main memory.

In this question time given when cache miss so no need to think about cases.

The average read access time :

Assuming there are $100$ read requests and $80\%$ of it results into cache hit and remaining cache miss so,

                                  $t_{avg} =\frac{ \frac{80}{100}\times100 \times 5ns + \frac{20}{100}\times100 \times 50ns}{100}= 14ns $

so $14ns$ should be the right answer

Reference : $\text{Hamacher Sixth Edition : P.no 290-91}$

edited by
Answer:

Related questions

35 votes
35 votes
4 answers
3