Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Write a short note on interrupts. OR Define interrupt. When a device interrupt occurs how does the processor determine which device has issued the interrupt ?

An interrupt is like a digital “Hey, listen!” from a device to the CPU, saying, “I’ve got something important to tell you!” It’s a way for devices like keyboards, mice, or network cards to grab the CPU’s attention when they need to send or receive data.

Now, imagine you’re in a busy office, and multiple people need your help at once. How do you figure out who needs you the most? That’s where identifying the source of an interrupt comes in.

There are two main ways:

  1. Polled interrupts: It’s like going around the office asking, “Hey, does anyone need me?” The CPU goes through each device, checking if any of them have something to say. Each device has a little flag that says, “Hey, I need attention!” If the flag is up, the CPU knows that device caused the interrupt, and it deals with it. But this method is slow if there are lots of devices, because the CPU has to check each one individually.
  2. Vectored interrupts: This is like having a receptionist who directs you straight to the person who needs you. Each device has its own “address,” and when it interrupts, it sends its address along with the interrupt signal. The CPU uses this address to know exactly which device needs attention and deals with it right away.It’s faster and more efficient because the CPU doesn’t waste time checking every device—it’s told directly who needs help. It’s like having a shortcut to the problem!

Leave a Comment