Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Here are six events on a computer.
How many are hardware interrupts and how many are software interrupts?
An interrupt is a signal to the processor that something needs attention now. A hardware interrupt comes from a device: pressing a key, moving the mouse. A software interrupt comes from a program: division by zero, two processes trying to access the same memory location.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Step 1. Hardware interrupts. A (the keyboard), C (the mouse) and E (the printer). These are 3 hardware interrupts.
Step 2. Software interrupts. B and F (division by zero) and D (two processes and one memory location). These are 3 software interrupts.
Answer: 3 hardware and 3 software interrupts.
Watch out. It does not matter which program then uses the key or the mouse movement. The signal starts at the device.
Log in to join the discussion.
Loading…