806 views
2 votes
2 votes
A computer system has a page size of 1024 bytes and maintains the page table for each process in main memory. The overhead required for doing a lookup in the page table is 500 ns. To reduce this overhead, the computer has a TLB that caches 32 virtual pages to physical frame mappings. A TLB lookup requires 100ns. Which TLB hit-rate will ensure an average virtual address translation time of exactly 200ns?

3 Answers

5 votes
5 votes
Let consider, the TLB hit ratio is p.

TLB access time =100 ns

page table Access time =600 ns

now in the question they asked the time for virtual address translation.

virtual address translation time = check in the TLB for the mapping + if not found in TLB then check in page table .

now,
virtual address translation time = TLB hit ratio * TLB access time + (1- TLB hit ratio)(TLB access time + memory access time to accesss the page table)
virtual address translation time =p*100 +(1-p)(100+500)           [ assuming single level page table]

100p+600-600p=200

or,500p=400

p=0.8

So, TLB hit ratio is 0.8.
2 votes
2 votes
Time Required to translate  logical address to physical  Address =TLB hit ratio*(TLB access time)+(1-TLB hit ratio)*(TLB access time+page table acess time)

Let’s assume  TLB hit ratio=x

200=x(100)+(1-x)(100+500)

200=100x+600-600x

500x=400

x=4/5=0.80

In percentage -->4/5*100=80%
edited by
0 votes
0 votes

@LRU

Let TLB hit rate = x ..

So in case of TLB hit , only TLB will be accessed for address translation..

In case of miss , assuming one level of paging , both TLB and page table will be accessed for address translation..

 

Hence effective address translation time

= Time taken in hit + Time taken in case of miss …..

 

==> x(100) + (1-x)600 = 200

==> 600 - 500x = 200

==> x = 0.8 …

 

Hence required hit ratio of TLB = 0.8 ….

 

Related questions

0 votes
0 votes
0 answers
3
0 votes
0 votes
1 answer
4