Skip to content
Official PYQ · 2023

GATE CS 2023 Q24 — I/O Interface: Interrupt and DMA Mode

Explain with AI
A keyboard connected to a computer is used at a rate of 11 keystroke per second. The computer system polls the keyboard every 10 ms10 \mathrm{~ms} (milli seconds) to check for a keystroke and consumes 100  μs100\; \mu \mathrm{s} (micro seconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes an additional 200  μs200\; \mu \mathrm{s} to process the keystroke. Let T1T_{1} denote the fraction of a second spent in polling and processing a keystroke.

In an alternative implementation, the system uses interrupts instead of polling. An interrupt is raised for every keystroke. It takes a total of 1 ms1 \mathrm{~ms} for servicing an interrupt and processing a keystroke. Let T2T_{2} denote the fraction of a second spent in servicing the interrupt and processing a keystroke.

The ratio T1T2\dfrac{T_{1}}{T_{2}} is _____________. (Rounded off to one decimal place)
View worked solution

Answer: 10.2

To find the ratio T1T2\dfrac{T_1}{T_2}, we calculate the fraction of time spent by the CPU in both the polling and interrupt-driven implementations over a duration of 11 second.

1. Polling Implementation (T1T_1)

  • Polling frequency: The system polls every 10 ms10\text{ ms}.
    Number of polls per second=1 s10 ms=1000 ms10 ms=100 polls\text{Number of polls per second} = \frac{1\text{ s}}{10\text{ ms}} = \frac{1000\text{ ms}}{10\text{ ms}} = 100\text{ polls}
  • Time spent in polling: Each poll takes 100 μs100\ \mu\text{s}.
    Total polling time per second=100×100 μs=10,000 μs=10 ms\text{Total polling time per second} = 100 \times 100\ \mu\text{s} = 10,000\ \mu\text{s} = 10\text{ ms}
  • Processing time: There is 11 keystroke per second. Processing this keystroke takes an additional 200 μs200\ \mu\text{s}.
    Processing time per second=1×200 μs=0.2 ms\text{Processing time per second} = 1 \times 200\ \mu\text{s} = 0.2\text{ ms}
  • Total time spent (T1T_1):
    T1=10 ms+0.2 ms1 s=10.2 ms1000 ms=0.0102T_1 = \frac{10\text{ ms} + 0.2\text{ ms}}{1\text{ s}} = \frac{10.2\text{ ms}}{1000\text{ ms}} = 0.0102

2. Interrupt-driven Implementation (T2T_2)

  • Interrupt frequency: An interrupt is raised for every keystroke. Since there is 11 keystroke per second, there is 11 interrupt per second.
  • Time spent servicing and processing: It takes 1 ms1\text{ ms} to service and process each keystroke.
    Total interrupt time per second=1×1 ms=1 ms\text{Total interrupt time per second} = 1 \times 1\text{ ms} = 1\text{ ms}
  • Total time spent (T2T_2):
    T2=1 ms1 s=1 ms1000 ms=0.001T_2 = \frac{1\text{ ms}}{1\text{ s}} = \frac{1\text{ ms}}{1000\text{ ms}} = 0.001

3. Ratio T1T2\dfrac{T_1}{T_2}

T1T2=0.01020.001=10.2\frac{T_1}{T_2} = \frac{0.0102}{0.001} = 10.2

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore I/O Interface: Interrupt and DMA Mode questions