Module_4
Module_4
Output
Module-4
Organizatio
n:
Accessing I/O devices
Processor Memory
Bus
Simpler software.
address.
Accessing I/O devices
(contd..)
Address lines
Bus Data lines
Control lines
Input device
•I/O device is connected to the bus using an I/O
interface circuit which has:
- Address decoder, control circuit, and
data and status registers.
•Address decoder decodes the address placed on the
address lines thus enabling the device to recognize its
address.
i + 1
M
Interrupts (contd..)
Treatment of an interrupt-service routine is
very similar to that of a subroutine.
ground.
To request an interrupt, a device closes its
associated switch.
Interrupt Hardware:
Thus, if all interrupt-request signals INTR1 to
INTRn are inactive, that is, if all switches are
open, the voltage on the interrupt-request line
will be equal to Vdd.
This is the inactive state of the line. When a
Polling
mechanism is easy, but time consuming
to query the status bits of all the I/O devices
connected to the bus.
Interrupts (contd..)
Before the processor started executing
the interrupt service routine for a
device, it disabled the interrupts from
the device.
In general, same arrangement is used when
multiple devices can send interrupt requests to
the processor.
During the execution of an interrupt service
routine of device, the processor does not
accept interrupt requests from any other
device.
IN T R 1 INTR p
Processor
INTA1 INTA p
Priority arbitration
Interrupts (contd..)
INTR1 INTRp
Processor
Device 1 Device 2 Devicep
INTA1 INTAp
Priority arbitration
Device Device
INTA1
Processor
INTR p
Device Device
INTAp
Priority arbitration
circuit
Interrupts (contd..)
I N T R 1
Device Device
INTA1
Processor
IN T R p
Device Device
INTA p
Priority arbitration
circuit
Interrupts (contd..)
System bus
BR
Processor
DMA DMA
controller controller
BG1 1 BG2 2
Centralized Bus Arbitration(cont.,)
• Bus arbiter may be the processor or a separate
unit connected to the bus.
• Normally, the processor is the bus master,
unless it grants bus membership to one of the
DMA controllers.
• DMA controller requests the control of the bus by
asserting the Bus Request (BR) line.
• In response, the processor activates the Bus-Grant1
(BG1) line, indicating that the controller may use the
bus when it is free.
• BG1 signal is connected to all DMA controllers in a
daisy chain fashion.
• BBSY signal is 0, it indicates that the bus is busy.
T ime
BR
BG1
BG2
B BS Y
Bus
master
Processor DMA controller 2 Processor
Centralized arbitration (contd..)
DMA controller 2
asserts the BR signal. Time
Processor asserts
BR
the BG1 signal
BBSY
Bus
master
Processor DMA controller 2 Processor
Arbitration process:
Each device compares the pattern that