Project ForgeSign up free
Computer Organization & Architecture
Pipelining & Instruction Sets
GATE 2023
Hard

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 to check for a keystroke and consumes 100 μs 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 T1 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 T2 denote the fraction of a second spent in servicing the interrupt and processing a keystroke. The ratio T1/T2 is ____ (rounded off to one decimal place).

10.2(± 0.1 accepted)

Explanation

Polling: 1000ms/10ms = 100 polls per second, each costing 100μs → 100×100μs = 10,000μs = 10ms of pure polling overhead. Since exactly 1 keystroke occurs per second, exactly one poll also incurs the extra 200μs processing cost. T1 = 10ms + 0.2ms = 10.2ms = 0.0102 (as a fraction of 1 second). Interrupts: exactly 1 interrupt per second, each costing 1ms total. T2 = 1ms = 0.001 (fraction of a second). T1/T2 = 0.0102/0.001 = 10.2.

Source: GATE CS 2023 (2023)

This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.

Start revising free