If an instruction takes ‘i’ microseconds and a page fault takes an additional…
2012
If an instruction takes ‘i’ microseconds and a page fault takes an additional ‘j’ microseconds, then the effective instruction time, if on the average a page fault occurs every k instructions, is
Answer: A. i + j/k — Concept — When a fixed extra cost is incurred only once in every k operations, the share of that cost carried by a single operation is the cost divided by k.…
- A.
i + j/k
- B.
i + j * k
- C.
(i + j)/k
- D.
(i + j) * k
Attempted by 70 students.
Show answer & explanation
Correct answer: A
Concept — When a fixed extra cost is incurred only once in every k operations, the share of that cost carried by a single operation is the cost divided by k. So the effective (average) time per instruction is the time of the instruction itself plus the fault penalty multiplied by the number of faults per instruction, and one fault every k instructions means 1/k faults per instruction.
Application — apply that idea to the quantities given in the stem:
Executing one instruction costs i microseconds; every instruction pays this base cost whether or not it faults.
A page fault adds j microseconds on top of that base cost, and on average it happens once in every k instructions.
Consider a block of k consecutive instructions. The k executions cost k × i microseconds in total, and at the stated rate the expected number of page faults in such a block is one, contributing an expected j microseconds.
Expected total time for the block = k × i + j microseconds.
Effective (average) time per instruction = (k × i + j)/k = i + j/k microseconds.
Cross-check — test the result at the two extremes of the fault rate:
When faults are very rare, k is large, j/k tends to 0 and the effective time tends to i — the plain instruction time, which is what a system that almost never faults should show.
When every instruction faults, k = 1 and the expression gives i + j — one instruction plus one full fault penalty.
Dividing i itself by k would shrink the instruction time as faults become rarer, and multiplying j by k would make the total penalty grow as faults become rarer; neither behaviour matches the situation described in the stem.
Result — the effective instruction time is i + j/k microseconds.
Explore the full course: Mppsc Assistant Professor Computer Science Paper 2