GATE 2023 CS – Question 34
A keyboard connected to a computer is used at a rate of 1 keystroke per second. The computer system polls the keyboard every 10 ms (milli seconds) to check for a keystroke and consumes 100 μs (micro seconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes an additional 200 μs to process the keystroke. Let $T_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 ms for servicing an interrupt and processing a keystroke. Let $T_2$ denote the fraction of a second spent in servicing the interrupt and processing a keystroke. The ratio $T_1/T_2$ is ______. (Rounded off to one decimal place)
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 10.2
Explanation
Polling happens 100 times per second: 100 × 100 μs = 10 ms, plus 200 μs processing gives T1 = 10.2 ms. T2 = 1 ms, so the ratio is 10.2.