1,816 views
In a two level hierarchy if the top level has an access time of 8ns and the bottom level has an access time of 60 ns. What is the hit ratio in top level required to give an average access time of 10 ns.

Here top level is defined in terms of access time..So if hit occurs only top level will be accessed else the top level as well as the bottom level will be consulted..

Given top level access time = 8 ms

Bottom level access time  = 60 ms

So if x is the hit rate then effective access time = x * ( top level time time) + (1 - x) * ( top + bottom level access time)

=  8x + (1-x) * 68

=  68 - 60 x

But given effective access time                       =  10 ms

So,

68 - 60 x   =  10

==>   60 x    =   58

==>   x        =   58 / 60

==>   x        = 96.67 %

Hence required hit rate  =  96.67 %

Average access time = HR * Time(Top Level) + (1 - HR) * [Time(Top Level) + Time(Bottom Level)]

Let p be the required hit ratio.

10ns = p * 8ns + (1 - p) * [8ns + 60ns]

10ns = 8p + 68ns - 68p

10ns = 68ns - 60p

p = $\frac{58}{60}$ = 0.97