Skip to main content

Identifying the interrupting device

Short answer

A device identifies itself via vectored interrupt (supplying a vector), separate interrupt lines, or software polling. For multiple interrupts, priorities are enforced by daisy chaining (nearest device wins), parallel priority encoder with mask register, or polling in priority order; a higher‑priority device can preempt a lower one.

How does a computer know which device issued the interrupt? If multiple devices interrupt, how does the selection take place?

When an interrupt request reaches the CPU, the CPU must find which device raised it, and when several interrupt together, which one to serve first.

Identifying the interrupting device

  1. Software polling: the CPU jumps to a common routine that reads the status flag of each device in turn. The first device with its flag set is the source. It is simple but slow.
  2. Vectored interrupt: the device supplies a vector (an address or number) after the CPU acknowledges the interrupt. The CPU uses it to jump to that device's service routine directly. This is fast.
  3. Separate interrupt lines: each device has its own request line, so the line itself identifies the device (used for few devices).

Selection among multiple interrupts

  • Daisy chain (serial priority): devices are connected in series on the interrupt acknowledge line. The nearest device to the CPU has the highest priority. The first device with a pending request blocks the signal and sends its vector address.
  • Parallel priority: an interrupt register and a mask register go to a priority encoder, which outputs the vector of the highest-priority unmasked request.
  • Software priority: the polling routine tests devices in the order of priority.

A higher-priority device can interrupt the service routine of a lower-priority one, while lower-priority requests wait.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Organization and Architecture chapter 7 questions →