in CO and Architecture edited by
29,392 views
53 votes
53 votes
Consider a system with $2$ level cache. Access times of Level $1$ cache, Level $2$ cache and main memory are $1$ $ns$, $10$ $ns$, and $500$ $ns$ respectively. The hit rates of Level $1$ and Level $2$ caches are $0.8$ and $0.9$, respectively. What is the average access time of the system ignoring the search time within the cache?
  1. $13.0$
  2. $12.8$
  3. $12.6$
  4. $12.4$
in CO and Architecture edited by
29.4k views

4 Comments

Then i don't know, how they did
0
0

This is from @Ayush Upadhyaya's comment from this question.

Hierarchical Access is being used but the formula used is above is bit simplified form of what we usually see for hierachical access.
 

h1.t1+ (1-h1) h2(t1+t2) +(1-h1)(1-h2)(t1+t2+tm)

= h1.t1+ (1-h1)h2.t1 + (1-h1)(1-h2)t1
+ (1-h1)h2.t2 + (1-h1)(1-h2)t2
+(1-h1)(1-h2)tm

= h1t1 + (1-h1)t1[h2+(1-h2)]
+(1-h1)t2[h2 + (1-h2)]
+(1-h1)(1-h2)tm

=t1 [h1 + (1-h1)]
+ (1-h1)t2
+(1-h1)(1-h2)tm

= t1
+ (1-h1)t2
+(1-h1)(1-h2)tm

I hope it helps. :)

1
1

You can refer the following problems:

A cache memory needs an access time of 30 ns and main memory 150 ns, what is the average access time of CPU (assume hit ratio = 80%)?

The answer is 60 ns

What hit ratio is required to reduce the effective memory access time from 200 ns to 140 ns if the cache access time is 20 ns?

The answer is 40%

In both the problems they have given the average (or effective) memory access time as

Effective memory access time = (hit rate x cache access time) + { miss rate x (cache access time + memory access time)}

But in the present problem, they have not considered the access time of the previous levels. Why?

0
0

8 Answers

80 votes
80 votes
Best answer

By default we consider hierarchical access - because that is the common implementation and simultaneous access cache has great practical difficulty. But here the question is a bit ambiguous -- it says to ignore search time within the cache - usually search is applicable for an associative cache but here no such information given and so we can assume it is the indexing time in to the cache block.

Access time for hierarchical access, 

$ =  t_1 + (1-h_1) \times t_2 + (1-h_1) (1-h_2) t_m$
$ = 1 + 0.2 \times 10 +  0.2 \times 0.1 \times 500$
$= 13ns.$

Option A.

PS: We should follow simultaneous access only when explicitly mentioned in question as hierarchical access is the default in standard books.

edited by
by

4 Comments

@Arjun sir why we had not taken formula :-AMAT  = h1*t1 + (1-h1)*h2*(t2+t1) + (1-h1)*(1-h2)*(t1+t2+t3).

as this is the formula for hierarchical access.

 

1
1

Thanks @Abhrajyoti00 sir

1
1
20 votes
20 votes
option C

t1 * h1 + (1- h1) h2 t2 + (1-h1) (1-h2) tm

tm- main memory access time

4 Comments

Access time = Access time L1 + miss ration of L1* Access Time L2 + miss ratio of L1* miss ration of L2* Memory access time
= 1 + 0.2*10 + 0.2*0.1*500
= 1 + 2 + 10
= 13.0 ns
4
4

"ignoring the search time within the cache"

THIS  LINE MEANS SIMULTANEOUS ACCESS.

26
26
Isn’t this line regarding the search time  associated  with checking of tag directory.inside the cache?
1
1
9 votes
9 votes
given  " ignoring the search time within the cache " it is applicable for associative and set associative mapping any way we will ignore it :
hierarchical access time : h1t1 + (1−h1)×h2×(t1+t2) + (1−h1)(1−h2)(tm+t1+t2)
                                              ans  13ns
simultaneous access time :  h1t1 + (1−h1)×h2×(t1) + (1−h1)(1−h2)(tm)
                                          ans 12.6ns
2 votes
2 votes

Tavg=h1xT1+(1-h1)xh2xT2+(1-h1)(1-h2)Tm

Tavg=1x0.8+0.2*0.9*10+0.2*0.1*500=12.6ns

Answer:

Related questions