Lect 11
Lect 11
Memory
I/0 I/0 I/0 I/0
Device Device Device Device
I/O Bus
I/O Controller
Bus
Device
– Master Device
» Acquires the right to use the bus
» Performs control operation for actual data transmission
– Slave Device
» Perform data transmit operation required by the master device
• Data Bus
• Address Bus
• Control Bus
– Master sends Control signals and receives status
signals
In an economical system,
Master Slave One bus can be multiplexed
to send Data and Address
Control Bus
Address Bus
Data Bus
CPU I/O
CPU
Dev
I/O
Dev Memory-I/O Common Bus
Memory Bus
...
I/O
Memory I/O I/O I/O
Dev Memory Dev Dev Dev
I/O Bus
Protocol
Communication between devices with widely different
characteristics require a communication rule called Protocol
– Synchronous Protocol
– Asynchronous protocol
Data
R/W
WAIT
0 1 0 1 1 1 0 0 1 1 1 ...
Request Acknowledge
1
Address Address Next Address
2
Data Data Next Data
Req 4
5
Ack
Req 3
5
Ack
BR BB BG BR BB BG BR BB BG
Data Bus
BR
BB
Data Bus
BR
BB
Polling Count
Polling Count Order is the Priority order
Data Bus
When a bus requesting device gets its device number through polling count,
it send BB to arbiter and use the bus.
Input Dev
Clock Output Dev
Bit Counter
Output from Memory(or CPU)
Set when 7
Flag
• Echo Back
• Retry and Timeout
• EDC/ECC
b0b1b2b3b4b5b6 b7
Odd
Parity
Odd Error
Parity
Even
Even Parity
Parity Error
MCR DMAR
MCG DMAG
CPU
INT
DMAC
R/W ADR DATA
data CPU initialize DMAC
... I/O Device Address
Memory Function(R/W)
Bus Memory Starting Address
Number of words
I/O Dev to M connection for
I/O Dev Cycle Steal by
I/O Dev sends DMAR to DMAC
Control Addr Data
DMAC sends MCR to CPU
Bus Bus Bus
I/O Bus CPU sends MCG to DMAC
DMAC send DMAG to I/O Dev
Memory MCR: Memory Cycle Request DMAC send Addr and Func to
MCG: Memory Cycle Grant M
DMAR: DMA Request
DMAG: DMA Grant
CS311-Computer Organization Input Output Systems Lecture 11 - 26
DMAC:
Cycle Steal
• CPU is continuously accessing memory, i.e., using memory
cycles during program execution
• When a MCR is received, CPU gives the next memory cycle
to DMAC so that the requesting I/O Device can use the
memory cycle without significant delay that may cause lost
data
DMAR DMAR
CPU FET EXE FET EXE FET EXE FET EXE FET ...
M Cycle
Interrupt
FET EXE FET EXE FET …
Interrupt Routine
DMAC DMAC
Input SL 8 8
Data Buffer(32) Memory
Clock
LDB/RDB
Output LDB for output
SR 8
Byte Counter RDB for input
I/O Data(32) Resets Byte Counter
=3
Reset Data Buffer
Memory Bus Buffer Full when 4B
Byte Counter = 3
Data Buffer Logic SL for input from I/O bus
SR for output to I/O bus
F LDB/RDB
Control Logic
R/W MCR MCG
Memory Data Bus(32)
CPU Memory Control Bus
Memory
Address Buffer
Address Buffer Logic +1 Receiving MCG form CPU, either
=0 Word Counter RDB to move Data Buffer to M, or
LDB to move M to Data Buffer
Word Counter Logic -1 When a word in the block is done
for input/output,
LDB/RDB
Control Logic Increment the address
INT MCG Decrement the word counter
When WC = 0
Implies Completion of I/O
CPU Request Interrupt CPU
Channel
CPU CPU Channel I/O
I/O I/O
Channel Channel I/O
Memory I/O I/O DC
Memory Channel
I/O I/O I/O
Sub-channel I/O
Sub-channel I/O
Multiplexer
Channel
Sub-channel I/O
I/O
Dev 89
n-1
• Instruction
– Output instruction if programmed I/O system is used
– ST instruction if memory mapped I/O system is used
CCW0
CCW
CCW
CCW
n
1
2
CAW ...
• Instruction
– START Cn, Dn
• CAW
• CCW
– Information provided to DMAC about data block and direction of transfer
Input/Output Processor
– Handling of Data to be input/output
– Editing, Debugging, Validating, …
– 2 kinds of I/O Processors(computers)
» Off-line I/O computers
» On-line I/O computers
Off-line
Main Computer Dedicated I/O Computer
Mag Tape Mag Tape
Printer
CPU CPU
Graphics
Dev
Memory Memory
On-line Computer
Disk Disk
CPU CPU
Graphics
Dev
CPU CPU
Graphics
Dev