Professional Documents
Culture Documents
INPUT-OUTPUT
ORGANIZATION
§ Peripheral Devices
§ Input-Output Interface
§ Asynchronous Data Transfer
§ Modes of Transfer
§ Priority Interrupt
§ Direct Memory Access
§ Input-Output Processor
§ Thunderbolt and Infinite Band
Department of CCE
Peripheral Devices
vInput Devices:
§ Keyboard
§ Screen Input Devices
§ Optical input devices • Touch Screen
• Card Reader • Light Pen
• Paper Tape Reader • Mouse
• Bar code reader § Analog Input Devices
• Digitizer
• Optical Mark Reader
§ Magnetic Input Devices
• Magnetic Stripe Reader
Department of CCE
Peripheral Devices
vOutput Devices:
§ Card Puncher, Paper Tape Puncher
§ CRT
§ Plotter
§ Analog
§ Voice
§ Printer (Impact, Ink Jet,
• Laser, Dot Matrix)
Department of CCE
Input-Output Interface
§ Provides a method for transferring information between internal storage (such as
memory and CPU registers) and external I/O devices
§ Resolves the differences between the computer and peripheral devices
• Peripherals - Electromechanical Devices
• CPU or Memory - Electronic Device
• Data Transfer Rate
• Peripherals - Usually slower
• CPU or Memory - Usually faster than peripherals
• Some kinds of Synchronization mechanism may be needed
• Unit of Information
• Peripherals – Byte, Block, …
• CPU or Memory – Word
• Data representations may differ
Department of CCE
I/O BUS AND INTERFACE MODULES
I/O bus
Data
Processor Address
Control
Keyboard
and Printer Magnetic Magnetic
display disk tape
terminal
Department of CCE
I/O BUS AND MEMORY BUS
§ Functions of Buses:
• MEMORY BUS is for information transfers between CPU and the MM
• I/O BUS is for information transfers between CPU and I/O devices through
their I/O interface
• Three ways to communicate processor bus with memory bus and I/O bus
1. Use two separate buses, one for memory and the other for I/o
2. Use one common bus but separate control lines for each function
3. Use one common bus with common control lines for both functions
Department of CCE
ISOLATED vs MEMORY MAPPED I/O
§ Isolated I/O:
• Separate I/O read/write control lines in addition to memory read/write control lines
• Separate (isolated) memory and I/O address spaces
• Distinct input and output instructions
• Memory-mapped I/O:
• A single set of read/write control lines
(no distinction between memory and I/O transfer)
• Memory and I/O addresses share the common address space
-> reduces memory address range available
• No specific input or output instruction
-> The same memory reference instructions can be used for I/O transfers
• Considerable flexibility in handling I/O operations
Department of CCE
Virtual memory
§ .. Port A I/O data
register
Bidirectional Bus
data bus buffers
Port B I/O data
register
Internal bus
Chip select CS
Register select RS1 Control Control
Timing register
Register select RS0 and
I/O read Control
RD Status Status
I/O write WR register
Department of CCE
ASYNCHRONOUS DATA TRANSFER
§ Synchronous and Asynchronous Operations:
• Synchronous: All devices derive the timing information from common clock line.
• Asynchronous: No common clock.
• Asynchronous Data Transfer:
Asynchronous data transfer between two independent units requires that
control signals to be transmitted between the communicating units.
Department of CCE
STROBE CONTROL
§ Employs a single control line at the time each transfer
§ The strobe may be activated by either the source or the destination unit
Source-Initiated Strobe Destination-Initiated Strobe
for Data Transfer for Data Transfer
Strobe Strobe
Department of CCE
HANDSHAKING
§ Dis advantage of Strobe Method:
• Source-Initiated: The source unit that initiates the transfer has no way of knowing
whether the destination unit has actually received data.
§ To solve this problem, the HANDSHAKE method introduces a one more signal i.e
acknowledge signal to provide a Reply to the unit that initiates the transfer.
Department of CCE
SOURCE-INITIATED TRANSFER USING HANDSHAKE
Data bus
§. Source Data valid Destination
Block Diagram unit Data accepted unit
Valid data
Data bus
Timing Diagram
Data valid
Data accepted
Department of CCE
DESTINATION-INITIATED TRANSFER USING
HANDSHAKE
Data bus
§. Block Diagram Source Data valid Destination
unit Ready for data unit
Data valid
Valid data
Data bus
Department of CCE
HANDSHAKING
§ Handshaking provides a high degree of flexibility and reliability because the
successful completion of a data transfer relies on active participation by both
units.
§ If one unit is faulty, data transfer will not be completed
-> Can be detected by means of a timeout mechanism
Department of CCE
ASYNCHRONOUS SERIAL TRANSFER
§ Employs special bits which are inserted at both ends of the character code
§ Each character consists of three parts; Start bit; Data bits; Stop bits.
1 1 0 0 0 1 0 1
Start Stop
Character bits
bit bits
(1 bit) (at least 1 bit)
Department of CCE
MODES OF TRANSFER
• 3 different Data Transfer Modes between the central computer (CPU or Memory) and
peripherals -
1. Program-Controlled I/O
2. Interrupt-Initiated I/O
3. Direct Memory Access (DMA)
Department of CCE
MODES OF TRANSFER : Program-Controlled I/O
§. Program-Controlled I/O
Data bus Interface I/O bus
Address bus Data register
Data valid I/O
CPU I/O read device
I/O write Status Data accepted
register F
Department of CCE
MODES OF TRANSFER : Interrupt Initiated I/O
§ Interrupt Initiated I/O:
• I/O interface, instead of the CPU, monitors the I/O device.
• When the interface determines that the I/O device is ready for data
transfer, it generates an Interrupt Request to the CPU.
• Upon detecting an interrupt, CPU stops momentarily the task it is doing,
branches to the service routine to process the data transfer, and then
returns to the task it was performing.
Department of CCE
MODES OF TRANSFER : DMA (Direct Memory Access)
Department of CCE
DIRECT MEMORY ACCESS (DMA)
§ Block of data transfer from high speed devices, Drum, Disk, Tape
§ DMA controller - Interface which allows I/O transfer directly between Memory and
Device, freeing CPU for other tasks
§ CPU initializes DMA Controller by sending memory address and the block size(number of
words)
CPU bus signals for DMA transfer
ABUS Address bus High-impedence
Bus request BR DBUS Data bus (disabled)
CPU when BG is
Bus granted BG RD Read
WR Write enabled
Department of CCE
DIRECT MEMORY ACCESS (DMA)
§ Block diagram of DMA controller:
Address bus
Internal Bus
DMA select DS Address register
Register select RS
Read RD Word count register
Write WR Control
logic
Bus request BR Control register
Bus grant BG
Interrupt Interrupt DMA request
DMA acknowledge to I/O device
Department of CCE
DMA I/O OPERATION
§ Starting an I/O: CPU executes instruction to
1. Load Memory Address Register (The starting address of memory word)
2. Load Word Counter (No. of words in memory block)
3. Load Function(Read or Write) to be performed
4. Issue a GO command
• Upon receiving a GO Command DMA performs I/O operation as follows independently
from CPU
§ Input:
[1] Input Device <- R (Read control signal)
[2] Buffer(DMA Controller) <- Input Byte; and
assembles the byte into a word until word is full
[4] M <- memory address, W(Write control signal)
[5] Address Reg <- Address Reg +1; WC(Word Counter) <- WC - 1
[6] If WC = 0, then Interrupt to acknowledge done, else go to [1]
Department of CCE
DMA I/O OPERATION
§ Output:
[1] M R<- M Address, M Address R <- M Address R + 1, WC <- WC - 1
[2] Disassemble the word
[3] Buffer <- One byte; Output Device <- W, for all disassembled bytes
[4] If WC = 0, then Interrupt to acknowledge done, else go to [1]
DMA TRANSFER
§.
Interrupt
Random-access
BG
CPU memory unit (RAM)
BR
RD WR Addr Data RD WR Addr Data
Read control
Write control
Data bus
Address bus
Address
select
RD WR Addr Data
DS DMA ack.
RS DMA I/O
Controller Peripheral
BR device
BG DMA request
Interrupt
CYCLE STEALING
§ Memory Bus Controller:
• Coordinating the activities of all devices requesting memory access
• Priority System
Memory accesses by CPU and DMA Controller are inte, with the top priority given to DMA
Controller.
§ Cycle Steal
• CPU is usually much faster than I/O(DMA), thus CPU uses the most of the memory
cycles.
• DMA Controller steals the memory cycles from CPU
• For those stolen cycles, CPU remains idle
INPUT/OUTPUT PROCESSOR
§.
Central
processing
unit (CPU)
Peripheral devices
Memory Bus
Memory
unit PD PD PD PD
Input-output
processor
I/O bus
(IOP)
CPU / CHANNEL (IOP) COMMUNICATION
§. CPU operations IOP operations
Send instruction
to test IOP.path
Transfer status word
to memory
If status OK, then send
start I/O instruction
to IOP. Access memory
for IOP program
Continue
THANKS MUCH
Department of CCE