GateAI
I/O Interface, Interrupts and DMA

GATE CSE 2011 · Q28

MCQ2 marksMedium

Time

On a non-pipelined sequential processor, a program segment, which is a part of the interrupt service routine, is given to transfer 500 bytes from an I/O device to memory.Initialize the address register Initialize the count to 500 LOOP: Load a byte from device Store in memory at address given by address register Increment the address register Decrement the count If count != 0 go to LOOPAssume that each statement in this program is equivalent to a machine instruction which takes one clock cycle to execute if it is a non-load/store instruction. The load-store instructions take two clock cycles to execute. The designer of the system also has an alternate approach of using the DMA controller to implement the same transfer. The DMA controller requires 20 clock cycles for initialization and other overheads. Each DMA transfer cycle takes two clock cycles to transfer one byte of data from the device to the memory. What is the approximate speedup when the DMA controller based design is used in place of the interrupt driven program based input-output?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) 3.4

I/O Interface, Interrupts and DMA

To calculate the speedup, we compare the execution time (in clock cycles) of both approaches for transferring 500 bytes:

  1. Interrupt Service Routine (ISR) Approach:

    • Initialization:

      • Initialize the address register: 1 cycle

      • Initialize the count to 500: 1 cycle

      • Initialization overhead = 1+1=21 + 1 = 2 cycles

    • Loop body (executed 500 times):

      • Load a byte from device (load instruction): 2 cycles

      • Store in memory at address... (store instruction): 2 cycles

      • Increment the address register (non-load/store): 1 cycle

      • Decrement the count (non-load/store): 1 cycle

      • If count != 0 go to LOOP (non-load/store): 1 cycle

      • Cycles per loop iteration = 2+2+1+1+1=72 + 2 + 1 + 1 + 1 = 7 cycles

    • Total cycles for ISR =2+(500×7)=2+3500=3502= 2 + (500 \times 7) = 2 + 3500 = 3502 clock cycles.

  2. DMA Controller Approach:

    • Initialization and overheads = 2020 cycles

    • Transfer time for 500 bytes =500×2=1000= 500 \times 2 = 1000 cycles

    • Total cycles for DMA =20+1000=1020= 20 + 1000 = 1020 clock cycles.

  3. Speedup Calculation:

    Speedup=TimeISRTimeDMA=35021020≈3.433\text{Speedup} = \frac{\text{Time}_{\text{ISR}}}{\text{Time}_{\text{DMA}}} = \frac{3502}{1020} \approx 3.433

Thus, the approximate speedup is 3.4, which corresponds to option (A) [p1].

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 Q28 of the GATE CSE 2011 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 2-mark MCQs like this one, and GATE CSE 2011 has 2.

How GATE tests I/O Interface, Interrupts and DMA

More from GATE CSE 2011

Share this solution

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

GateAI solution cardGATE CSE 2011 · Q28 · MCQ

On a non-pipelined sequential processor, a program segment, which is a part of the interrupt service routine, is given to transfer 500 bytes from an I/O device to memory. Initialize the address register Initialize the count to 500 LOOP: Load a byte from device Store in memory at address given by address register Increment the address register Decrement the count If count != 0 go to LOOP Assume that each statement in this program is equivalent to a machine instruction which takes one clock cycle to execute if it is a non-load/store instruction. The load-store instructions take two clock cycles to execute. The designer of the system also has an alternate approach of using the DMA controller to implement the same transfer. The DMA controller requires 20 clock cycles for initialization and other overheads. Each DMA transfer cycle takes two clock cycles to transfer one byte of data from the device to the memory. What is the approximate speedup when the DMA controller based design is used in place of the interrupt driven program based input-output?

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.