28 Lecture
CS501
Midterm & Final Term Short Notes
Interrupt Hardware and Software
Interrupts can be classified into two categories: hardware interrupts and software interrupts. Hardware interrupts are generated by external events such as I/O devices signaling the CPU. Software interrupts, also known as traps, are generated by
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
- Which of the following is an example of a hardware interrupt?
a) System call
b) Division by zero
c) Keyboard press
d) Memory access violation
Answer: c) Keyboard press
Which of the following is an example of a software interrupt?
a) Disk read error
b) Mouse click
c) System call
d) Power outage
Answer: c) System call
Which type of interrupt is triggered by a device?
a) Hardware interrupt
b) Software interrupt
c) Both
d) None
Answer: a) Hardware interrupt
Which type of interrupt is triggered by a program instruction?
a) Hardware interrupt
b) Software interrupt
c) Both
d) None
Answer: b) Software interrupt
Which of the following is an example of a hardware interrupt controller?
a) BIOS
b) DMA controller
c) CPU
d) Memory
Answer: b) DMA controller
Which of the following is an example of a software interrupt handler?
a) Device driver
b) Interrupt service routine (ISR)
c) Interrupt vector table
d) Interrupt request (IRQ)
Answer: b) Interrupt service routine (ISR)
Which type of interrupt has higher priority?
a) Hardware interrupt
b) Software interrupt
c) Both have equal priority
d) It depends on the system design
Answer: a) Hardware interrupt
Which of the following is responsible for managing the interrupt requests in a system?
a) Interrupt service routine
b) Interrupt handler
c) Interrupt controller
d) Interrupt vector table
Answer: c) Interrupt controller
Which type of interrupt can be masked or disabled?
a) Hardware interrupt
b) Software interrupt
c) Both
d) None
Answer: a) Hardware interrupt
Which type of interrupt can be triggered by a user-level program?
a) Hardware interrupt
b) Software interrupt
c) Both
d) None
Answer: b) Software interrupt
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
What is a hardware interrupt, and how is it triggered? Answer: A hardware interrupt is a signal sent by an external device to the CPU to request its attention. It is triggered when an external event occurs, such as a keyboard press or a network packet arriving. What is a software interrupt, and how is it triggered? Answer: A software interrupt, also known as a trap, is an interrupt triggered by a software instruction. It is triggered when a program executes a specific instruction, such as a system call. What is an interrupt service routine (ISR)? Answer: An interrupt service routine (ISR) is a piece of code that handles the interrupt request when an interrupt is triggered. It is executed when the CPU receives an interrupt signal. What is an interrupt vector table, and how is it used? Answer: An interrupt vector table is a data structure that stores the memory address of the ISR for each interrupt type. It is used by the CPU to locate the appropriate ISR when an interrupt occurs. What is an interrupt controller, and what is its function? Answer: An interrupt controller is a device that manages the interrupt requests generated by external devices. Its function is to prioritize and route the interrupt requests to the appropriate processor. What is the difference between a maskable and non-maskable interrupt? Answer: A maskable interrupt is one that can be temporarily disabled by the CPU, while a non-maskable interrupt cannot be disabled. Non-maskable interrupts are typically used for critical system events, such as hardware failures. What is the priority of hardware interrupts compared to software interrupts? Answer: Hardware interrupts have higher priority than software interrupts. This is because hardware interrupts are triggered by external devices and require immediate attention. What is the purpose of an interrupt handler? Answer: An interrupt handler is responsible for managing the interrupt request and executing the ISR. It performs tasks such as saving the CPU context and restoring it after the ISR is complete. How does the CPU handle multiple interrupt requests? Answer: The CPU prioritizes interrupt requests based on their level of urgency. When multiple interrupts occur simultaneously, the CPU uses an interrupt controller to determine the highest priority interrupt and executes its ISR. What is an interrupt request (IRQ), and how is it used? Answer: An interrupt request (IRQ) is a signal sent by an external device to request the CPU's attention. It is assigned a unique number, which is used to identify the interrupt source and locate the appropriate ISR in the interrupt vector table.