GATE / CS ARCHIVE

GATE CSE 1993 / QUESTION 6.8

CPU time retained by the main program

Computer Organization & Architecture · Input/Output, DMA & Interrupts · Full GATE CSE 1993 paper

GATE 1993, Q6.8 2 marks · Other
Report issue

Input/Output, DMA & Interrupts

Question 6.8, GATE 1993: Interrupts arrive every 1 ms. The diagram shows 10 μs response delay while main code still runs, then 10 μs save,80 μs service,10 μs restore. What fraction remains for main execution?
Tap to enlarge
Answer & solution

Answer: 90% (no official key was published)

Only saving, servicing and restoring displace main-program execution: 10+80+10=100 μs per interrupt. Each arrival period is 1000 μs, leaving 900 μs for the main program, or 90%. The initial 10 μs response delay is drawn while main execution continues, so it must not be subtracted again. Doing so would give 89% and double-count time not actually lost. This assumes the depicted nonoverlapping periodic service and no extra overhead beyond the labeled intervals.

Original paper, page 5