IAE Academy

ISRO CS 2023 Q.51: solution and answer

ISRO 2023 · CSQ.51 · 1 mark · MCQ

Which of the following is false about interrupts ?

  1. (A)

    Interrupts can be triggered by a hardware or by a software

  2. (B)

    Hardware interrupts may be triggered by sending a signal to CPU through a system bus

  3. (C)

    Software interrupts may be triggered by executing system calls

  4. (D)

    Trap is a hardware generated interrupt

See the question in the paper

Answer and solution

ANSWER

Option (D) is the false statement: a trap is a software-generated interrupt, not a hardware-generated one.

Official answer: DSource: ISRO's revised and final answer key of 16 February 2024

  1. An interrupt is a request that makes the CPU suspend the program it is running and execute a handler routine. Interrupts have two broad origins: external hardware devices, and the executing software itself.

  2. Option (a) is true. A device can raise a hardware interrupt, and an instruction such as INT n or a system-call instruction can raise a software interrupt.

  3. Option (b) is true. A device signals the CPU through an interrupt line or the system bus, and the CPU checks for pending requests at the end of each instruction.

  4. Option (c) is true. A system call is made by executing a special instruction (a software interrupt or trap instruction), which switches the CPU to kernel mode and runs the operating system service.

  5. Option (d) is false. A trap is a synchronous, software-generated interrupt. It is caused by an exception inside the running program (divide by zero, invalid memory access, breakpoint) or by a deliberate trap instruction. It does not come from an external hardware device.

  6. So the false statement is (d).

KEY IDEA

Hardware interrupts are asynchronous and come from external devices. Traps, exceptions and system calls are synchronous and are raised by the running program (software).

WATCH OUT FOR

Because a trap forces the CPU into a handler just as a device interrupt does, it is easy to call it a hardware interrupt. What matters is the source: a trap is caused by the instruction being executed, not by an external device.

From the ISRO CS 2023 paper. Every question of this paper · The full paper (PDF, ISRO) · All 2 ISRO I/O, interrupts & DMA questions, with notes