Input Output9 6 2021
Input Output9 6 2021
CPU
Main Memory
Computer
CPU
Computer
I/O
Unit
I/O
devices Control Unit
Peripherals
S/W
For I/O operation
I/O organization is
Function of (computer size, devices connected to this computer)
Computer
Peripheral (CPU)
In order to resolve the differences between the CPU & these peripherals
Q// what are the major differences betn CPU & peripheral and how
It can be solved?
There are three ways in which the computer buses can be used
to communicate with memory & I/O:
1- use 2 separate buses (separate I/O processor).
2- use 1 common bus (Two separated Control lines).
3- use 1 common bus (one control line i.e. common control line).
There are 2 types of I/O
Add.
space I/O I/O
Add.
bus
One
Add.
space
Add.
Add. M M bus
space
Add.
bus
Assignment// Compare betn I/O isolated & Memory mapped I/O?
Data Transfer
serial parallel
Synchronous Asynchronous
Data Transfer
Common clock
Digital System
CPU M.M.
Registers I/O
Data Transfer
Synchronous Asynchronous
CPU ck CPU
ck4
ck5
1) Strobe pulse.
2) Handshaking control signal.
ck R1 P (control line)
R2
Handshaking
Data valid
Therefore, the two handshaking lines are:
Data accepted
Note: Time out
error
Serial Communication
Telephone line
modem
Digital signal audio tones
synch
This serial communication
Asynch
Computer
External devices
Memory
Therefore, the transfer of data betn computer and external I/O device can be done through:
NOTE
(( In this method a constant monitoring of the peripheral by the CPU is required))
The transfer of data from I/O device to the interface is as follows:
1) When data is available, the device places it in the I/O bus and enables its
data valid line.
2) The interface accepts data place it in data register and enable the data accepted line.
3) The interface sets a bit in the status register.
4) The device disables the data valid line, but it will not transfer any data until data
accepted is disabled by the interface.
A flowchart of the program must be written for the CPU is shown below:
Therefore, the transfer of each byte require three instructions:
1) Read the status reg.
2) Check the status of the flag bit.
3) Read the data register.
DISADVANTAGES
Device
Interface
Interface
Device
Interface keeps monitoring the device & when device is ready it (interface)
will send Interrupt to CPU
WHAT is the difference betn interrupt initiated data & transfer under program control?
Release the CPU from continuous monitoring & allow it (CPU) to do another work.
There are 2 interrupts method to chose the branch address
Dev1
Computer Dev2
(CPU)
Dev3
H/W S/W
Polling ((TEST the devices in sequence
Serial From the high to low priority))
Parallel
(Daisy
chain)
Polling Procedure (S/W)
INT 1 Service
Dev1 Routine 1
Service
INT 2 Routine
Dev2 Service
(check the Routine 2
INT Sources
in sequence)
INT 3
Service
Dev3 Routine 3
H/W priority-interrupt unit
Dev1 Computer
H/W
determine INT Request Service
Dev2 which device Routine 1
has the highest
priority
Service
Routine 2
Dev3
Service
Routine 3
Daisy-Chain priority
DMA
HERE:
•CPU is IDLE (i.e. has no control).
• while DMA controller takes over the buses to manage the transfer directly
Betn the I/O devices & memory.
HOW we can make the CPU idle
WR Write
BG
idle
CPU
4. When the DMA finish the data transfer then the DMA disables the BR signal.
5. After that CPU disable BG & take the control.
Transfer using DMA
(Cycle stealing)
Move entire block of Transfer one data word
Memory words At a time
(burst transfer) (CPU delay its operation
Therefore, need To allow the DMA to “steal”
Fast devices One memory cycle)
4- Input-output Processor (IOP)
interface keyboard
C
P interface printer
U
interface scanner
CPU
PD PD PD PD
Memory Unit
IOP
DMA controller must be setup by the CPU while, IOP can fetch and execute
Its own instructions, and can perform another tasks such as arithmetic, logic
………..