2,314 views
1 votes
1 votes
TLB hit rate=90%
TLB access time=1ns
Main memory access time=100ns
page fault rate=20%
Page fault service time=20 ms
2 level paging is used

Find out the effective memory access time.

General concept:
 
effective memory access time= time taken to convert VA to PA + time taken to fetch the byte from memory.

VA->PA : (0.9)(1)+(0.1)(1+2*100)

For fetching the byte from memory:(0.8)(100)+(0.2)(20x10^6)

Effective memory access time=(0.9)(1)+(0.1)(1+2*100) + (0.8)(100)+(0.2)(20x10^6)
              
                =0.9+20.1+80+4000000

                =4000101 ns

                =4.000101 ms

My idea:[ This is the same idea incase of TLB and Main memory only without pagefault]

Effective memory access time=(0.9)[1+100] + (0.1)[1+2*100+(0.8)(100)+(0.2)(20x10^6)]

                =90.9 + 0.1(201+80+4x10^6)

                =90.9 + 400028.1

                =400119 ns

                =0.4 ms

My idea explanation :

(0.9)[1+100] = whenever there is TLB hit,we can find the frame number from TLB and exactly 1 main memory
           access is required to fetch the byte.There is no page fault when there is TLB hit

(0.1)[1+2*100+(0.8)(100)+(0.2)(20x10^6)] = whenever there is TLB miss, we need to access the main memory twice
                       to get the frame number(2 level paging is used) if it present in
                       the Main memory and 1 Main memory access is required to fetch the
                       byte. Otherwise we need to access the secondary memory.

we are getting two different answers.

I want to know which answer is correct.

If my idea is wrong why it is wrong?

1 Answer

1 votes
1 votes
First of all they should mentioned in the question specifically when should a page fault occur, as nothing has been mentioned so i am assumming page fault may occur in both cases either TLB hit or TLB miss, hence

E.M.A.T = 0.9( 1 + 0.8*100ns + 0.2*20ms) + 0.1( 1 + 100ns + 100ns + .8*100ns + 0.2*20ms)

E.M.A.T = 4000101 ns = 4.0 ms

Related questions