Garrick
Garrick

Reputation: 689

Calculation of the average memory access time based on the following data?

Consider the following information

What will be the Average memory access time based on the following information ?

My Approach => I am giving my approach of how i understood this question. Please check it.

Average memory access time

==>

Probability of NO page fault (Memory access time) 
+ 
Probability of page fault (Page fault service time)

==>

0.99 ( TLB hit (TLB access time + cache hit + cache miss) + TLB miss (TLB access time + Page table access time + cache hit + cache miss) )

+

0.01 (TLB access time + page table access time + Disk access time)

==>

0.99 ( 0.95 (1 + 0.90(1) + 0.10(1 + 5)) + 0.05(1 + 5 + 0.90(1) + 0.10(1 + 5)))

+

0.01 (1 + 5 + 100)

Is the given expression correct ?

Please let me know, that, is my approach right or have i committed some mistakes?

Can Anyone help me ?

PS : I am having my mid term next week and need to practice such questions

Upvotes: 3

Views: 4309

Answers (1)

Ivan
Ivan

Reputation: 3836

In your case the tricky line is cache is physically addressed meaning before hitting it we must perform the translation (as programs use virtual addresses)

I build the following probability tree to compute the average. We will be reducing it from leaves to calculate the whole average. Rules are super easy: we calculate branch costs and multiply them by the probability pretty much like you did in your calc. The value I get is 2.7225

Tree

complete tree

1st leave reduction, page fault

reduction 1

after the reduction

after the reduction

cost for cache hit scenario

Note: that we pay 1 cycle for cache access anyway

cache hit scenario cost

before last reduction

Note: we pay 1 cycle for TLB anyway

before last reduction

1 + 0.95*1.5 + 0.05*5.95 = 1 + 1.425 + 0.2975 = 2.7225

Upvotes: 1

Related Questions