CPUs and architecture

Which CPU mechanism temporarily suspends the current task to give priority to handling requests such as those from external devices?

  1. AInterrupt
  2. BPipeline
  3. CCache
Show answer and explanation

Answer: A. Interrupt

An interrupt lets the CPU pause its current work when an event such as a keypress, timer tick or incoming data occurs, save its state, run the corresponding handler and then resume. When events are infrequent, it wastes far less CPU time than polling, in which the CPU repeatedly checks device status, while still responding quickly; for very frequent events, polling can be more efficient. Interrupts are prioritized so important requests are handled first.

Interrupt handling flow ① Device requests interrupt (IRQ) Timer, RX done, etc. ② Finish current instruction Not mid-instruction ③ Save PC and status Return address & mode ④ Look up vector table IRQ no. → handler addr. ⑤ Run handler (ISR) Saves regs it uses ⑥ Clear interrupt source Else it fires again ⑦ Restore state and return Return instr. (e.g. mret) Device CPU (auto) Software CPU Execution resumes after the interrupted instruction
Interrupt handling flow · View in diagrams

Related calculators

Books on CPUs and architecture Ad

As an Amazon Associate I earn from qualifying purchases.

More CPUs and architecture questions

  1. Which mechanism transfers data directly between peripherals and memory without going through the CPU?
  2. Which IC integrates a CPU, memory and peripherals such as timers and ADCs on one chip and is used to control appliances and equipment?
  3. In a multicore CPU, which mechanism keeps data consistent when the caches of several cores hold data for the same address?
  4. Which technique reduces CPU power consumption by dynamically changing operating frequency and supply voltage according to the load?
  5. Which is an example of vulnerabilities revealing attacks that exploit traces of speculative execution left in the cache to infer data that should not be accessible?

Comparisons in this topic