Comp-Arch-Lect05
Comp-Arch-Lect05
WILLIAM STALLINGS
COMPUTER ORGANIZATION
AND ARCHITECTURE
INSTRUCTION FETCH AND EXECUTE
Execution cycle for a particular instruction
may involve more than one reference to
memory.
Also, an instruction may specify I/O
States in the upper part of the figure involve an exchange between the
processor and memory/IO module.
States in the lower part of the fig involve only internal processor
operations.
INTERRUPTS
Mechanism by which other modules (e.g.
I/O) may interrupt normal sequence of
processing. Common classes of
interrupts(table 3.1)
Program
e.g. overflow, division by zero
Timer
Generated by internal processor timer- allows
OS to perform certain functions on a regular
basis.
I/O
Generated by an I/O controller
Hardware failure
Interrupts are provided primarily as a way
to improve processing efficiency.
Example: Most external devices are much
generated then user program will wait for the I/O device
to perform the function.
A sequence of instructions labeled 5, to complete the
from the processor, the I/O module for that external device
sends an interrupt signal to the processor. The processor respond
by suspending the current program and branching off to a
program to service that particular device, known as interrupt
handler and resuming to the original execution after the device
is serviced.
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
routine
Process interrupt
Restore context and continue interrupted
program
TRANSFER OF CONTROL VIA
INTERRUPTS
INSTRUCTION CYCLE WITH
INTERRUPTS
PROGRAM TIMING SHORT I/O WAIT
PROGRAM TIMING LONG I/O WAIT
INSTRUCTION CYCLE (WITH
INTERRUPTS) - STATE DIAGRAM
MULTIPLE INTERRUPTS
Drawback
It does not take into account relative priority or time-critical needs.
Example: when input arrives from communication line, it may need to
be absorbed rapidly to make room for more input. If the first batch
of input has not been processed before the second batch arrives, data
may be lost.
Define priorities
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
INTERCONNECTION STRUCTURES
A computer consists of a set of components
or modules of three basic types(processor,
memory, I/O)that communicate with each
other.
The collection of paths connecting the
various modules is called the
interconnection structure.
COMPUTER MODULES
MEMORY CONNECTION
Receives and sends data
Receives addresses (of locations)