Coa 03 Function Interconnection
Coa 03 Function Interconnection
Chapter 3
1440
March 2019
Implementing Function
Hardwired vs. Software based
Memory containing:
Instructions and Data
Instruction format:
Opcode + Address
[email protected] 13
Instruction Cycle State Diagram
Interrupts
Interrupts
Mechanism by which other modules may
interrupt normal sequence of processing in
CPU. (provide the way to improve
processing efficiency)
Interrupts from Program
— Overflow, division by zero, illegal instruction
Interrupts from Timer
— Generated by internal processor timer
— Used in pre-emptive multi-tasking
Interrupts from I/O
— From I/O controller for some I/O event
Interrupts from Hardware failure
— Power failure, memory parity error
Types of Interrupts
Program Flow Control
Transfer of Control via Interrupts
Interrupt Cycle
Added to instruction cycle
Processor checks for interrupt
—Indicated by an interrupt signal
If no interrupt, fetch next instruction
If interrupt pending:
—Suspend execution of current program
—Save context
—Set PC to start address of interrupt handler
—Process the interrupt
—Restore context and resume interrupted
program
Instruction Cycle with Interrupts
Instruction Cycle (with Interrupts)
Handling Multiple Interrupts
Sequential
—Processor will ignore further interrupts while
processing one interrupt
—Interrupts remain pending and are checked
after first interrupt has been processed
—Interrupts handled in sequence as they occur
Priority Based
—Low priority interrupts can be interrupted by
higher priority interrupts
—When higher priority interrupt has been
processed, processor returns to previous
interrupt
Multiple Interrupts – Sequential
Multiple Interrupts – Nested
Time Sequence of Multiple Interrupts