+14 votes
3.5k views
Assume that for a certain processor, a read request takes $50$ $nanoseconds$ on a cache miss and $5$ $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 _____.
asked
edited | 3.5k views
+8

In case of Simultaneous access:

average read access time formula is = Hit Time X Hit Rate + Miss Penalty * Miss Rate

here it is given Hit time  5 ns

Hit rate  80 %

Miss penalty 50 ns

Miss Rate  20 %

so average read access time  = 0.8(5) + 0.2(50) = 14

0
Why you are considering as simultaneous access? @Bikram
+10

@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.

+2
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.
0

@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.

## 3 Answers

+27 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}$$
answered by Boss (13.7k points)
edited by
+2
When to use formula T = h*C + (1- h) (C+M) while calculating avg access time ?
+36
question explicitly says if cache miss then it ll take 50 ns..
if only cache hit time and memory access time given then use that farmula..
but here complete memory access time given for both cache hit as well as cache miss..
0
Why $0.8*5 + 0.2*(5 +50)$ is wrong?
0
Do we consider hierarchial access or parallel access by default?
0
Arjun Sir, why are we considering simultaneous access here?By default we take hierarchical access right ?
+5

read request takes 50 nanoseconds on a cache miss

here, time taken when a cache miss occurs is given directly and not the time for accessing main memory.

+3
why not like 5 + .20(50) = 15 , which is wrong , if i do 5+ .20(50-5) = 14, mean 50 is total time not second level access time then how we identify

@arjun sir , @bikram sir
+5 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

answered by Active (1.6k points)
+5

In case of Simultaneous access:

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

this formula is used here..

0

what is Simultaneous access?

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

answered by Boss (11k points)
edited
0
How did you get $T_m = 50?$
0
It is given in question sir
0
what is given is not the main memory access time. This is why "formula" is bad for GATE.
0
Ok sir
0
Now ok sir ??
Answer:

+24 votes
2 answers
1
+12 votes
1 answer
2
+45 votes
4 answers
4
+20 votes
4 answers
6
+14 votes
3 answers
7