in Operating System retagged by
662 views
0 votes
0 votes
Consider a k-level paging system along with a TLB. A TLB takes 10ns, and a memory takes 100ns on average. The hit ratio of TLB is equal to 0.8. If it is known that the average memory access time is 70ns, then the value of k is?
in Operating System retagged by
662 views

4 Comments

K will be 2 .

$10+0.2*(k+1)*100=70$

So ,$k=2$
0
0
why will it be (k+1) and not k?

the question is asking for k-level no?
0
0
(k+1) because say you have k level page table so , you will look up in each k page table which reside in memory. So k*memory access time it will take. Now from the last page table (k'th) you will get the address of the memory location where actual data reside . For which you need one more extra memory access.

So total memory access needed

=K* memory access time+memory access time

=(K+1) memory access time
0
0
ok i got it thanks
0
0

1 Answer

0 votes
0 votes
TLB = t = 10ns

Memory time = m = 100ns

Hit ratio (tlb) = p = 0.8

Miss ratio = 1 – p = 0.2

Let assume there are k level for checking :

then formula for the Effective time calculation :

T effective = p( t + m ) + (1-p)(t + km + m  )

T effective  = pt + pm + t + km – pt – pkm + m – mp  → t +m(k+1) ( 1-p)

Now , we only put the value in te formula :

T effective = t + (1-p) m (k+1)

70 = 10 + ( 1 – 0.8) * (k+1)* 100

60 = 0.2 * (k+1) * 100

60 = 20 *(k+1)

k = 3 – 1 = 2

ANSWER IS 2 LEVEL WILL REQUIRE :)

Related questions