2.1.5
Interrupts
Interrupts
Interrupts
Interrupts are an essential part of modern computer systems that tell the CPU when something needs attention.
![Illustrative background for Interrupts](https://image-v2.cdn.app.senecalearning.com/2018-11/5ba7904e-90e6-4cca-8e5f-bd6069a8fa39/old-computer-,h_400,q_80,w_640.jpg)
![Illustrative background for Interrupts ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-11/5ba7904e-90e6-4cca-8e5f-bd6069a8fa39/old-computer-,h_400,q_80,w_640.jpg)
Interrupts
Interrupts
- An interrupt is a signal from a piece of software or hardware that tells the CPU that it needs some attention.
- Interrupts are an efficient way of telling a computer when a job needs to be completed.
![Illustrative background for Hardware interrupts](https://image-v2.cdn.app.senecalearning.com/courseImages/physics/Edexcel/7 electricity/photocopying,h_400,q_80,w_640.jpg)
![Illustrative background for Hardware interrupts ?? "content](https://image-v2.cdn.app.senecalearning.com/courseImages/physics/Edexcel/7 electricity/photocopying,h_400,q_80,w_640.jpg)
Hardware interrupts
Hardware interrupts
- Hardware interrupts can occur when an input or output operation completes.
- Hardware interrupts can also involve errors, like when a printer runs out of paper.
![Illustrative background for Software interrupts](https://image-v2.cdn.app.senecalearning.com/2018-11/2b9b970c-9a7e-480f-81c1-ff0dddd1948e/review-ipad-,h_400,q_80,w_640.png)
![Illustrative background for Software interrupts ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-11/2b9b970c-9a7e-480f-81c1-ff0dddd1948e/review-ipad-,h_400,q_80,w_640.png)
Software interrupts
Software interrupts
- Software interrupts come from pieces of software that need to terminate or request services from the OS to complete a task.
- For example, opening a document.
![Illustrative background for Alternatives to interrupts](https://image-v2.cdn.app.senecalearning.com/courseImages/chemistry/2.3.4 Nanotechnology/question-mark-2492009_640-min,h_400,q_80,w_640.jpg)
![Illustrative background for Alternatives to interrupts ?? "content](https://image-v2.cdn.app.senecalearning.com/courseImages/chemistry/2.3.4 Nanotechnology/question-mark-2492009_640-min,h_400,q_80,w_640.jpg)
Alternatives to interrupts
Alternatives to interrupts
- One alternative to using interrupts is polling.
- Polling is when the CPU polls (asks) every piece of software and hardware if it needs anything doing.
- This would be a very inefficient process.
Interrupt Service Routine (ISR)
Interrupt Service Routine (ISR)
An interrupt service routine is a set of instructions that need to be done as part of an interrupt.
![Illustrative background for ISR](https://image-v2.cdn.app.senecalearning.com/2018-09/e3c8609f-7236-42a4-a382-a937041982bf/stop-sign-,h_400,q_80,w_640.jpg)
![Illustrative background for ISR ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-09/e3c8609f-7236-42a4-a382-a937041982bf/stop-sign-,h_400,q_80,w_640.jpg)
ISR
ISR
- An interrupt service routine is a set of instructions that need to be done as part of an interrupt.
- When an interrupt service routine has been completed, the CPU will go back to the set of instructions it was doing before.
![Illustrative background for Process](https://image-v2.cdn.app.senecalearning.com/courseImages/chemistry/3.1.2 Moles/stop-min,h_400,q_80,w_640.jpg)
![Illustrative background for Process ?? "content](https://image-v2.cdn.app.senecalearning.com/courseImages/chemistry/3.1.2 Moles/stop-min,h_400,q_80,w_640.jpg)
Process
Process
- As an interrupt arrives at the CPU it comes with a flag to indicate the priority of the interrupt.
- This interrupt could be higher importance than the set of instructions it is currently working.
- The interrupt pushes the current instruction and all the contents of the registers in the CPU to a stack.
![Illustrative background for Process cont.](https://image-v2.cdn.app.senecalearning.com/courseImages/physics/AQA New Modules/6.1.3/thumbs up,h_400,q_80,w_640.jpg)
![Illustrative background for Process cont. ?? "content](https://image-v2.cdn.app.senecalearning.com/courseImages/physics/AQA New Modules/6.1.3/thumbs up,h_400,q_80,w_640.jpg)
Process cont.
Process cont.
- The CPU will then complete the interrupt service routine and then load the registers back in from the stack and continue where it left off.
- At the end of each fetch, decode, execute cycle, the CPU checks for interrupts and their priorities before continuing on.
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
Jump to other topics
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
![Go student ad image](/en-GB/revision-notes/_next/image?url=%2Fen-GB%2Frevision-notes%2Fimages%2Fgo-student-uk-ad.jpg&w=640&q=100)
Unlock your full potential with GoStudent tutoring
Affordable 1:1 tutoring from the comfort of your home
Tutors are matched to your specific learning needs
30+ school subjects covered