Input-Output Organization
Input-Output Organization
ORGANIZATION
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
PERIPHERAL DEVICES
• Input or output devices attached to a
computer.
– Examples:
• Monitor
– Cathode Ray Tube (CRT) based
– Plasma Display Panel (PDP)
– Liquid Crystal Display (LCD)
– Light Emitting Diode (LED)
• Keyboard
• Mouse
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Peripheral Devices Cont.
• Printer
– Daisywheel printer
– Dot Matrix printer
– Inkjet printer
– Laser printer
– 3D printer
• Plotter
• Magnetic Tape
• Magnetic Disk
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Peripheral Devices Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Peripheral Devices Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
INPUT-OUTPUT INTERFACE
• I/O interface helps in synchronizing transfer of data between CPU
and peripheral devices.
• Need of I/O Interface:
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Input-Output Interface Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Input-Output Interface Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
ASYNCHRONOUS DATA TRANSFER
• Asynchronous mode of data transfer is used
when the source unit and destination unit
have different clocks.
• Methods of Asynchronous Data Transfer:
I. Strobe Control
II. Handshaking
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Asynchronous Data Transfer Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Asynchronous Data Transfer Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Asynchronous Data Transfer Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Asynchronous Data Transfer Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Asynchronous Data Transfer Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Asynchronous Data Transfer Cont.
QUESTION:
SOLUTION:
a. 1200/8 = 150 characters per second
b. 1200/11 = 109 characters per second
c. 1200/10 = 120 characters per second
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Asynchronous Data Transfer Cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
MODES OF DATA TRANSFER BETWEEN THE
CENTRAL COMPUTER AND I/O DEVICES
• Ultimate source or destination of data is
memory.
• Data transfer between the central computer
and I/O devices may be handled in three ways
(modes):
1. Programmed I/O
2. Interrupt Initiated I/O
3. Direct Memory Access (DMA)
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
• Programmed Input-Output:
– Programmed I/O operations are the result of I/O
instructions written in the computer program.
– The transfer is usually to and from a CPU register and
peripheral.
– Other instructions are needed to transfer the data to and
from CPU and memory.
– The CPU has to continuously execute a program to check
the status of interface registers.
– Keeps processor needlessly busy.
– Useful in computers that are dedicated to monitor a device
continuously.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
• Priority Interrupt:
– A system that establishes a priority over the various
interrupt sources.
• Software-based system -- Polling
• Hardware-based system – Daisy Chaining
– When two devices interrupt the computer at the same
time, the computer services the device with the higher
priority first.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
• Polling:
– Software-based method
– One common branch address for all interrupts
– The routine polls the interrupt sources in
sequence (highest priority first, 2nd highest priority
second, 3rd highest priority third and so on)
– Then branches to one of many possible service
routines.
– Disadvantage: Slow as compared to hardware
method
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
PI: Priority In
PO: Priority Out
VAD: Interrupt Vector Address
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
QUESTION:
SOLUTION:
a. Size of FIFO buffer = k bytes
Bytes inserted into the buffer in 1 second = m
Bytes deleted from the buffer in 1 second = n
m>n
=> Net bytes added to the buffer in 1 second = m-n
=> To fill an empty buffer, it will take = mk n sec onds
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
b. m<n
=> Net bytes removed from the buffer in 1 second = n-m
=> To empty a full buffer, it will take = n k m sec onds
c. No.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
– The CPU initializes the DMA transfer by sending the following
information to the DMA Controller through the data bus:
1. The starting address of the memory block where data are available
(for read) or where data are to be stored (for write)
2. The word count - how many words to read or write
3. Control to specify the mode of transfer such as read or write
4. Control to start the DMA transfer
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
Modes of Transfer cont.
QUESTION:
It is necessary to transfer 256 words from a magnetic disk to a
memory section starting from address 1230. The transfer is by
means of DMA. Give the initial values that the CPU must
transfer to the DMA controller.
SOLUTION:
CPU must transfer
256 to the DMAC Word Count Register
1230 to the DMAC Address Register
Bits to the Control Register to specify a Write Operation.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
INPUT-OUTPUT PROCESSOR
STUDY BY YOURSELF
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST
• For reference see your textbook:
– Mano, M. Morris. Computer system architecture.
Prentice-Hall of India, 2003.
Slides prepared by: Dr. Zubair Ahmad Shah, Dept. of CSE, IUST