Unit 3 Computer Organization
Unit 3 Computer Organization
Module 4
INPUT-OUTPUT ORGANIZATION
Input-Output organization: Peripheral devices, I/O interface, Accessing I/O devices-
Modes of transfer, interrupts-daisy chaining, priority interrupt, DMA
PHERIPHERAL DEVICES: -
• The input-output subsystem of a computer, referred to as I/O,
provides an efficient mode of communication between the central
system and the outside environment.
• Input or output devices attached to the computer are also called
peripherals.
• The most common peripherals are keyboards, display units
(monitors), and printers. Peripherals that provide auxiliary storage
for the system are magnetic disks and tapes.
INPUT-OUTPUT INTERFACE: -
Why do we need interface between the peripherals and internal devices?
0 0
BBCS307 Computer Architecture Module 4
0 0
BBCS307 Computer Architecture Module 4
0 0
BBCS307 Computer Architecture Module 4
• Data transfer between the central computer and I/O devices may
be handled in a variety of modes. Some modes use the CPU as an
intermediate path; others transfer the data directly to and from
the memory unit.
• Data transfer to and from peripherals may be handled in one of three
possible modes:
1. Programmed I/O
2. Interrupt-initiated I/O
3. Direct memory access (DMA)
• Programmed I/O
o In the programmed I/O method, the I/O device does not have
direct access to memory. A transfer from an I/O device to
memory requires the execution of several instructions by the
CPU.
o In short, Programmed I/O operations are the result of I/O
instructions written in the computer program.
o Each data transfer is initiated by an instruction in the
program.
o E.g.: input instructions to transfer data from the device to the
CPU, store instructions to transfer data from the CPU to
memory, control instructions to verify the data availability and
to count number of words transferred.
• Interrupt-initiated I/O
o In the programmed I/O method, the CPU stays in a program
loop until the I/O unit indicates that it is ready for data
transfer. This is a time-consuming process since it keeps the
processor busy.
Ashalakshmi.R Page 4
0 0
BBCS307 Computer Architecture Module 4
0 0
BBCS307 Computer Architecture Module 4
Ashalakshmi.R Page 6
0 0
BBCS307 Computer Architecture Module 4
Ashalakshmi.R Page 7
0 0
BBCS307 Computer Architecture Module 4
• The device with the highest priority is placed first followed by the
second highest priority device and so on.
WORKING:
• There is an interrupt request line which is common to all the
devices and goes into the CPU.
• When no interrupts are pending, the line is in HIGH state. But if
any of the devices raises an interrupt, it places the interrupt
request line in the LOW state.
• The CPU acknowledges this interrupt request from the line and then
enables the interrupt acknowledge line in response to the request.
o This signal (Interrupt Acknowledge) is received at the PI (Priority
in) input of device 1.
o If the device has not requested the interrupt, it passes this signal
to the next device through its PO (priority out) output. (PI = 1 &
PO = 1).
o However, if the device had requested the interrupt, (PI =1 & PO =
0).
▪ The device consumes the acknowledge signal and block its
further use by placing 0 at its PO (priority out) output.
▪ The device then proceeds to place its interrupt vector
address (VAD) into the data bus of CPU.
Ashalakshmi.R Page 8
0 0
BBCS307 Computer Architecture Module 4
Ashalakshmi.R Page 9
0 0
BBCS307 Computer Architecture Module 4
0 0
BBCS307 Computer Architecture Module 4
• When the DMA terminates the transfer, it disables the Bus Request
(BR) line. The CPU disables the Bus Grant (BG), takes control of the
buses and return to its normal operation.
• DMA the transfer can be made in several ways that are:
i. DMA Burst : In DMA Burst transfer, a block sequence
consisting of a number of memory words is transferred in
continuous burst while the DMA controller is master of the
memory buses.
ii. Cycle Stealing : Cycle stealing allows the DMA controller to
transfer one data word at a time, after which it must returns
control of the buses to the CPU.
Ashalakshmi.R Page 11
0 0
BBCS307 Computer Architecture Module 4
• DMA Controller
• The DMA controller needs the usual circuits of an interface to
communicate with the CPU and I/O device.
• The DMA controller has three registers:
i. Address Register :- Address Register contains an address to
specify the desired location in memory.
ii. Word Count Register :- WC holds the number of words to be
transferred. The register is incremented/decremented by one
after each word transfer and internally tested for zero.
iii. Control Register :- Control Register specifies the mode of
transfer.
• DMA Controller communicates with the CPU via the data bus
and control lines.
• DMA Transfer
o The CPU communicates with the DMA through the address and
data buses as with any interface unit. Once the DMA receives
the start control command, it can transfer between the
peripheral and the memory.
Ashalakshmi.R Page 12
0 0