Coa Unit-4 Notes
Coa Unit-4 Notes
Coa Unit-4 Notes
INPUT-OUTPUT ORGANIZATION
• Peripheral Devices
• Input-Output Interface
• Modes of Transfer
• Priority Interrupt
• Input-Output Processor
• Serial Communication
PERIPHERAL DEVICES
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
– Unit of Information
» Peripherals – Byte, Block, …
» CPU or Memory – Word
Keyboard
and Printer Magnetic Magnetic
display disk tape
terminal
Interface
- Decodes the device address (device code)
- Decodes the commands (operation)
- Provides signals for the peripheral controller
- Synchronizes the data flow and supervises
the transfer rate between peripheral and CPU or Memory
Typical I/O instruction
Op. code Device address Function code
(Command)
I/O INTERFACE
Port A I/O data
register
Bidirectional Bus
data bus buffers
Port B I/O data
register
Internal bus
CPU Chip select CS
I/O
Register select RS1 Control Control Device
Timing register
Register select RS0 and
I/O read Control
RD Status Status
I/O write WR register
Handshaking
- A control signal is accompanied with each data
being transmitted to indicate the presence of data
- The receiving unit responds with another control
signal to acknowledge receipt of the data
Computer Organization Computer Architectures Lab
Input-Output Organization 8 Asynchronous Data Transfer
STROBE CONTROL
* Employs a single control line to time each transfer
* The strobe may be activated by either the source or
the destination unit
Strobe Strobe
HANDSHAKING
Strobe Methods
Source-Initiated
Destination-Initiated
Valid data
Data bus
Timing Diagram
Data valid
Data accepted
Data valid
Valid data
Data bus
1. Start Bit- First bit, called start bit is always zero and used to indicate the
beginning character.
2. Stop Bit- Last bit, called stop bit is always one and used to indicate end of
characters. Stop bit is always in the 1- state and frame the end of the
characters to signify the idle or wait state.
3. Character Bit- Bits in between the start bit and the stop bit are known as
character bits. The character bits always follow the start bit.
1 1 0 0 0 1 0 1
Start Character bits Stop
bit bits
(1 bit) (at least 1 bit)
Internal Bus
and clock
Chip select
CS
Register select Status Receiver Receiver CS RS Oper. Register selected
RS Timing clock
register control 0 x x None
I/O read and and clock 1 0 WR Transmitter register
RD Control 1 1 WR Control register
I/O write Receive 1 0 RD Receiver register
WR Receiver Shift data
1 1 RD Status register
register register
Transmitter Register
- Accepts a data byte(from CPU) through the data bus
- Transferred to a shift register for serial transmission
Receiver
- Receives serial information into another shift register
- Complete data byte is sent to the receiver register
Status Register Bits
- Used for I/O flags and for recording errors
Control Register Bits
- Define baud rate, no. of bits in each character, whether
to generate and check parity, and no. of stop bits
Interrupt-Initiated I/O
• When the I/O interface finds that the device is ready for data
transfer it generates an Interrupt Request and sends it to the
computer.
Interrupt-Initiated I/O
PRIORITY INTERRUPT
Priority
- Determines which interrupt is to be served first
when two or more requests are made simultaneously
- Also determines which interrupts are permitted to
interrupt the computer while another is being serviced
- Higher priority interrupts can make requests while
servicing a lower priority interrupt
2
Interrupt
to CPU
3
INTACK
from CPU
IEN: Set or Clear by instructions ION or IOF
IST: Represents an unmasked interrupt has occurred. INTACK enables
tristate Bus Buffer to load VAD generated by the Priority Logic
Interrupt Register:
- Each bit is associated with an Interrupt Request from
different Interrupt Source - different priority level
- Each bit can be cleared by a program instruction
Mask Register:
- Mask Register is associated with Interrupt Register
- Each bit can be set or cleared by an Instruction
Computer Organization Computer Architectures Lab
Input-Output Organization 22 Priority Interrupt
Inputs Outputs
I0 I1 I2 I3 x y IST Boolean functions
1 d d d 0 0 1
0 1 d d 0 1 1
0 0 1 d 1 0 1 x = I 0' I 1'
0 0 0 1 1 1 1 y = I 0' I 1 + I 0’ I 2’
0 0 0 0 d d 0 (IST) = I0 + I1 + I2 + I3
INTERRUPT CYCLE
ABUS Address bus High-impedence
Bus request BR DBUS Data bus (disabled)
CPU when BG is
Bus granted BG RD Read
WR Write enabled
Bus grant BG
Interrupt Interrupt DMA request
DMA acknowledge to I/O device
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]
Output
[1] M <- M Address, R
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]
Computer Organization Computer Architectures Lab
Input-Output Organization 27 Direct Memory Access
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
DMA Registers
• Address Register – start address of memory (1000)
• Word Count Register (10 then 9 …)
• Control Register (Read or Write operation)
1000
DMA
• Burst transfer mode – all the words of the block is
transferred in one burst.
• Cycle stealing mode – DMA controller transfer each
word by stealing a cycle
from CPU that is DMA
controller always use
BR -> BG -> Interrupt
signal for
transferring each word.
CYCLE STEALING
While DMA I/O takes place, CPU is also executing instructions
DMA Controller and CPU both access Memory -> Memory Access Conflict
Cycle Steal
Peripheral devices
Memory
unit PD PD PD PD
Input-output
processor
(IOP) I/O bus
Continue
Serial Communication
Modem
– Full Duplex
– Half Duplex
Protocols:
Character-Oriented Protocol
Bit-Oriented Protocol
Computer Organization Computer Architectures Lab
Input-Output Organization 34
Serial Communication
Data Communication Processor:
• A data communication processor is an I/O processor that distributes and
collects data from numerous remote terminals connected through
communication lines to the computer.
• It is a specialized I/O processor designed to communicate with data
communication networks.
• The data communication processor communicates with each terminal
through a single pair of wire.
• It also communicates with CPU and memory in the same manner as any
I/O processor does.
Serial Communication
Modem:
• Modem stands for Modulator and Demodulator.
• It is a device that modulates signals to encode
digital information for transmission and
demodulates signals to decode the transmitted
information.
• It is necessary for communication between digital
devices and Analog devices.
• It converts the digital signal to Analog and vice
versa to communicate between devices.
• It encodes the signal and decodes at the other
end and vice versa between the devices.
Serial Communication
Modes Of Transmission:
Data can be transmitted between 2 points by three different
modes:
• Simplex:
A simplex line carries information in one direction only. In this
mode receiver cannot communicate with the sender to indicate
the occurrence of errors that means only sender can send data but
receiver cannot. For example: Radio and Television
Broadcasting.
Modes Of Transmission
Half Duplex:
• In half duplex mode, system is capable of transmitting data in
both directions but data can be transmitted in one direction
only at a time. A pair of wires is needed for this mode. For
example: Walkie - Talkie.
Modes Of Transmission
Full Duplex:
• In this mode data can be send and received in both directions
simultaneously. In this four wire link is used. For
example: Video Calling, Audio calling etc.
Protocols
• The communication lines, modems and other devices used in
any transmission are collectively called a Data Link. The
orderly transmission of data in a data link can be accomplished
by a protocol.
• A Protocol is a set of rules that are followed by
interconnecting devices to ensure that all data is passed
correctly without any error.
Character-oriented Protocol: