All mock tests are FREE till 31 December — register to save your progress

Given memory access time as p nanoseconds and an additional q nanoseconds for handling a page fault, what is the effective memory access time if a page fault occurs once for every 100 instructions?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. p + q/100

Explanation

The page-fault rate is pf = 1/100 = 0.01, since one fault occurs per 100 instructions/accesses. The effective memory access time (EMAT) is a weighted average of the no-fault case and the fault case: EMAT = (1 − pf)·p + pf·(p + q). Expanding: EMAT = p − 0.01p + 0.01p + 0.01q = p + 0.01q = p + q/100. The other options either divide the whole expression by 100, drop the weighting on the page-fault term, or divide the wrong term by 100, so option (i) is correct.

More Programming Languages and Computer Graphics questions