in Operating System recategorized by
565 views
0 votes
0 votes

Assume a memory access to main memory on a cache “miss” takes $30 \; \text{ns}$ and a memory access to the cache (on a cache “hit”) takes $3 \; \text{ns}.$ If $80 \%$ of the processor’s memory requests result in a cache “hit”, what is the average memory access time?

  1. $8.4 \text{ns}$
  2. $9 \text{ns}$
  3. $4.4 \text{ns}$
  4. $2.2 \text{ns}$
in Operating System recategorized by
by
565 views

4 Comments

$3 + 0.2 (30) = 9$
2
2
If we use simultaneous approach,

Then answer will be 8.4 ns
0
0
1
1
in fact both are the correct answers 8.4 ns (simultaneous access) and 9ns( hirerchical access).

in my case, i would go with 8.4ns. the answer of this question depends on what was in the mind of question setter :/
0
0

1 Answer

2 votes
2 votes

Here we have confusion that when to use given two formula

(1)  T$_{avg}$ = (hit ratio) * (Cache access time)  +  (1- h)  (Cache access time + Memory access time) 

(2) T$_{avg}$ = (hit ratio) * (Cache access time)  +  (1- h)  (Cache miss penalty)       

see, when in the question memory access time given explicitly and there is no discussion of cache miss penalty then we will for 1st formula.

and if in the question cache miss penalty is given and no memory access time then use 2nd formula.


now coming to the question, here cache miss penalty is not given rather memory access time is given after cache miss.

so we will use this formula:

(1)  T$_{avg}$ = (hit ratio) * (Cache access time)  +  (1- h)  (Cache access time + Memory access time) 

                       =  $\frac{80}{100} (3) + (1 - \frac{80}{100}) (3 + 30)$

                       =  $\frac{240}{100} + \frac{660}{100}$

                       =  $\frac{900}{100}$

                       = 9 ns.

Answer : 9 ns.

 

Answer:

Related questions