GateAI
I/O Interface, Interrupts and DMA

GATE CSE 2023 · Q34

NAT1 markEasy

Time

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 μ\mus (micro seconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes an additional 200 μ\mus 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 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\frac{T_1}{T_2} is __________. (Rounded off to one decimal place)

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 10.2

I/O Interface, Interrupts and DMA

To find the ratio T1T2\frac{T_1}{T_2}, calculate the total CPU time spent per second in both implementations:

### 1. Polling Implementation (T1T_1):

  • Polling frequency: The keyboard is polled every 10 ms10\text{ ms}, meaning there are:

    Number of polls per second=1 s10 ms=1000 ms10 ms=100 polls/s\text{Number of polls per second} = \frac{1\text{ s}}{10\text{ ms}} = \frac{1000\text{ ms}}{10\text{ ms}} = 100\text{ polls/s}
  • Time spent in polling alone:

    100×100 μs=10000 μs=10 ms100 \times 100\ \mu\text{s} = 10000\ \mu\text{s} = 10\text{ ms}
  • Time spent processing the keystroke (1 keystroke per second):

    1×200 μs=0.2 ms1 \times 200\ \mu\text{s} = 0.2\text{ ms}
  • Total time spent per second (T1T_1):

    T1=10 ms+0.2 ms=10.2 ms=0.0102 sT_1 = 10\text{ ms} + 0.2\text{ ms} = 10.2\text{ ms} = 0.0102\text{ s}

### 2. Interrupt Implementation (T2T_2):

  • Keystroke rate: 1 keystroke per second1\text{ keystroke per second}, which raises 1 interrupt per second1\text{ interrupt per second}.

  • Time taken to service the interrupt and process the keystroke:

    T2=1 ms=0.001 sT_2 = 1\text{ ms} = 0.001\text{ s}

### 3. Calculating the Ratio T1T2\frac{T_1}{T_2}:

T1T2=10.2 ms1 ms=10.2\frac{T_1}{T_2} = \frac{10.2\text{ ms}}{1\text{ ms}} = 10.2

Thus, the ratio is 10.2.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This I/O Interface, Interrupts and DMA previous year question is Q34 of the GATE CSE 2023 paper. Find more GATE CSE PYQs on I/O Interface, Interrupts and DMA in Computer Organization and Architecture, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related I/O Interface, Interrupts and DMA PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

I/O Interface, Interrupts and DMA in GATE CSE

I/O Interface, Interrupts and DMA has 13 GATE CSE PYQs across 12 papers from 2011 to 2026. 2 of them are 1-mark NAT questions like this one, and it is the only one in GATE CSE 2023.

How GATE tests I/O Interface, Interrupts and DMA

More from GATE CSE 2023

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2023 · Q34 · NAT

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 (micro seconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes an additional 200 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)

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.