in CO and Architecture edited by
13,791 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 ______.
in CO and Architecture edited by
13.8k views

4 Comments

@sandeep

Because of this line 

read request takes 50 nanoseconds on a cache miss

it is simultaneous access..there is no separate cache access time is given which we use in case of Hierarchical . here only cache miss time is given , that's why it is simultaneous access.

20
20
I think we don't need to think whether it is simultaneous access or hierarchical, $50ns$ will take care.

Standard Formula is : $T_{avg} = H*T_h + (1-H)*T_{missPenalty}$ ,

$T_{missPenalty}$ includes Cache access in hierarchical case and exclude cache access in simultaneous. So whether it is simultaneous or not is not our concern. The given miss penalty is taking care of that.
20
20

@Bikram sir

I think we must see access times from processor's point of view i.e after how much time the processor gets the requested data. Suppose that in a question we are explicitly given cache access time is 2ns and main memory access time is 30ns then here we will have to explicity calculate after how much time processor will get requested data. Lets say processor makes a request, now if the data is present in cache then processor will get the requested data in 2ns after cache is accessed else if it is not present then processor will get it in 30ns after main memory access (if simultaneous access) or 32ns after cache + main memory access (if hierarchichal access).

But here in the question we are directly given that processor gets requested data in 50ns in case of a cache miss, so we need not worry whether simultaneous or hierarchical access policy is used, here that information is abstracted away from us.

6
6

4 Answers

57 votes
57 votes
Best answer
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

4 Comments

@sid1221

I have same doubt. 

Someone plz. chk, if here answer should be 14ns or 15ns??

0
0

Actually I think 2nd level cache intro duces that formula.

https://gateoverflow.in/233718/two-level-of-cache?show=235325

but still I think both formula are same

0
0

a read request takes 50 nanoseconds on a cache miss

this line means that if its a cache miss the total time being taken is 50ns. We don't have to assume heirarchy or not they have directly given us total time incase of miss

1
1
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 Comments

In case of Simultaneous access:


AMAT's formula is = Hit Time X Hit Rate + Miss Penalty * Miss Rate

this formula is used here.. 

5
5

what is Simultaneous access?

0
0

 sir, how did you interpret this question as Simultaneous? Please clarify.

0
0
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

4 Comments

what is given is not the main memory access time. This is why "formula" is bad for GATE.
1
1
Ok sir
1
1
Now ok sir ??
1
1
2 votes
2 votes

*main memory access time is not given

​​​​​​​source → https://computationstructures.org/lectures/caches/caches.html

slide 23

Answer:

Related questions