Coa CH 11
Coa CH 11
Coa CH 11
I/O Bus and Interface Modules: The I/O bus connects the processor to multiple peripheral
devices. It consists of data lines, address lines, and control lines. Each peripheral device is associated
with an interface unit. The interface unit decodes the address and control signals received from the
I/O bus, interprets them for the peripheral device, and provides signals for the peripheral controller.
It also synchronizes the data flow and supervises the transfer between the peripheral and processor.
Addressing Peripheral Devices: To communicate with a specific peripheral device, the processor
places the device's address on the address lines of the I/O bus. Each interface attached to the I/O
bus contains an address decoder that monitors the address lines. When the interface detects its own
address, it activates the path between the bus lines and the device it controls. Peripheral devices
whose addresses do not match the address on the bus are disabled by their respective interfaces.
Function Codes and Commands: Simultaneously with providing the address on the address lines,
the processor sends a function code on the control lines. This function code, also known as an I/O
command, instructs the selected interface to execute a specific action. There are four types of
commands: control commands, status commands, data output commands, and data input
commands.
Control Commands: A control command activates the peripheral device and instructs it on what
action to perform. For example, a magnetic tape unit may be instructed to rewind the tape or start
moving it in a specific direction.
Status Commands: Status commands are used to check various status conditions in the interface
and peripheral device. For instance, the computer may want to verify the status of the peripheral
before initiating a data transfer.
Data Output Commands: Data output commands cause the interface to transfer data from the
bus into one of its registers. For example, when storing data on a tape unit, the processor issues a
data output command, and the interface transfers the data from the bus to its buffer register before
communicating with the tape controller.
Data Input Commands: Conversely, data input commands instruct the interface to receive data
from the peripheral device and place it in its buffer register. The processor can then retrieve the
data from the buffer register for further processing.
Isolated I/O:
1. Addressing: In isolated I/O, separate read and write control lines are used to distinguish
between memory transfers and I/O transfers.
2. Address Space: I/O addresses are isolated from memory addresses, ensuring that memory
address values are not affected by I/O address assignments.
3. Distinct Instructions: The CPU has specific input and output instructions associated with
addresses of interface registers.
4. Control Signals: When performing I/O operations, the CPU enables the I/O read or write
control line, indicating that the address on the bus is for an interface register, not for
memory.
5. Addressing Method: Addresses for interface registers are distinct from memory addresses,
allowing separate address spaces for I/O and memory.
Memory-Mapped I/O:
1. Addressing: Memory-mapped I/O uses the same address space for both memory and I/O
operations.
2. Control Signals: There are no specific input or output instructions. Memory-type
instructions are used to access I/O data.
3. Shared Address Space: Interface registers are treated as part of the memory system,
sharing the same address space with memory words.
4. Instruction Set: All instructions that refer to memory are also used for I/O operations,
enabling the use of load and store instructions for I/O data transfers.
5. Availability of Instructions: Since memory-reference instructions are more common than
specific I/O instructions, memory-mapped I/O ensures that all memory instructions can also
be used for I/O operations.
Difference:
Addressing Method: Isolated I/O uses separate address spaces for memory and I/O,
while memory-mapped I/O shares the same address space for both.
Control Signals: Isolated I/O uses distinct read and write control lines for memory
and I/O operations, while memory-mapped I/O uses memory control lines for both.
Instruction Set: Isolated I/O has specific input and output instructions, while
memory-mapped I/O uses memory instructions for I/O operations.
Address Space Management: Isolated I/O provides dedicated address spaces for
memory and I/O, ensuring no overlap, while memory-mapped I/O requires careful
management to avoid conflicts between memory and I/O addresses.
Asynchronous serial transfer is a method of transmitting data between two units where each bit of
the message is sent one at a time in sequence. This method requires only one pair of conductors or
one conductor and a common ground, making it less expensive compared to parallel transmission,
which requires multiple conductor paths.
In asynchronous serial transmission, special bits are inserted at both ends of the character code to
indicate the beginning and end of each character. The character consists of three parts: a start bit,
the character bits, and stop bits. When no characters are being transmitted, the line remains in the
1-state. The start bit, always a 0, indicates the beginning of a character, followed by the character
bits, and then one or two stop bits, always in the 1-state, to signify the end of the character and
return to the idle state.
The receiver detects the start bit when the line changes from 1 to 0 and examines the line at proper
bit times using a clock. After receiving the character bits, the receiver waits for the line to return to
the 1-state for at least one or two bit times to detect the stop bit. This ensures that both the
transmitter and receiver can resynchronize. The line remains in the 1-state until another character is
transmitted, providing a stop time to prevent the immediate transmission of a new character.
For example, in a terminal with a transfer rate of 10 characters per second, each character takes 0.1
seconds for transfer, resulting in a bit time of 9.09 milliseconds. With an 11-bit format (start bit, 8
information bits, and 1 or 2 stop bits), the transfer rate is 110 baud.
An asynchronous communication interface or universal asynchronous receiver transmitter (UART) is
often used to facilitate asynchronous serial transfer between devices. These integrated circuits are
specifically designed to handle the serial communication protocol, enabling the exchange of data
between computers and interactive terminals, such as keyboards and printers.
1. Data Transmission Preparation: The CPU checks the status register to determine if
the transmitter register is empty. If empty, it transfers a character to the transmitter
register.
2. Start Bit Generation: The interface sets the first bit in the transmitter shift register to
0 to generate a start bit.
3. Character Transmission: The character is transferred in parallel from the transmitter
register to the shift register, followed by the appropriate number of stop bits.
4. Serial Transmission: The character is transmitted one bit at a time by shifting the
data in the shift register at the specified baud rate.
5. Double Buffering: As soon as transmission starts, the CPU can load a new character
into the transmitter register, allowing for continuous transmission.
Receiver Operation:
1. Detection of Start Bit: The receiver control monitors the receive-data line for a
transition from 1 to 0, indicating the start bit.
2. Character Reception: Once a start bit is detected, the incoming bits of the character
are shifted into the shift register at the prescribed baud rate.
3. Parity and Stop Bit Check: After receiving the data bits, the interface checks for
parity and stop bits.
4. Data Transfer: The character without start and stop bits is transferred in parallel
from the shift register to the receiver register.
5. Status Flag Setting: The flag in the status register is set to indicate that the receiver
register is full.
6. Data Retrieval: The CPU reads the status register and checks the flag to retrieve the
data from the receiver register.
Error Handling:
Parity Error: Occurs if the number of 1's in the received data does not match
the correct parity.
Framing Error: Occurs if the correct number of stop bits is not detected at the
end of the received character.
Overrun Error: Occurs if the CPU fails to read the character from the receiver
register before the next one becomes available in the shift register, resulting
in a loss of characters in the received data stream
1. Initial Setup:
In programmed I/O, the I/O device (e.g., an input device) doesn't have direct
access to memory.
Transferring data from the I/O device to memory involves several CPU
instructions, including input and store instructions.
2. Data Transfer Procedure:
When data is available, the I/O device transfers it one byte at a time to the I/O
bus and enables its data valid line.
The interface accepts the byte into its data register and enables the data
accepted line.
A flag bit in the status register is set by the interface to indicate that data is
ready.
After accepting the byte, the I/O device can disable the data valid line, but it
won't transfer another byte until the data accepted line is disabled by the
interface, following a handshaking procedure.
3. CPU Program:
A program is written for the CPU to check the flag in the status register to
determine if a byte is available in the data register.
This involves reading the status register into a CPU register and checking the
value of the flag bit.
If the flag is set, indicating data availability, the CPU reads the data from the
data register.
After reading the data, the flag bit is cleared (set to 0) by either the CPU or the
interface, depending on the interface design.
Once the flag is cleared, the interface disables the data accepted line, allowing
the I/O device to transfer the next data byte.
4. Flowchart and Instructions:
A flowchart illustrates the program flow for the CPU, assuming the device
sends a sequence of bytes to be stored in memory.
Each byte transfer requires three instructions: read the status register, check
the flag status, and read the data register.
Once data is read, it's transferred to memory using a store instruction.
5. Efficiency Considerations:
Programmed I/O is suitable for small, low-speed computers or systems
continuously monitoring a device.
However, it's inefficient when the CPU must frequently check the flag for data
availability, especially if the I/O device's transfer rate is slow compared to the
CPU's processing speed.
Priority Interrupt
1. Initiation of Data Transfer: In the context of data transfer between the CPU and an
I/O device, the CPU initiates the transfer, but it can only proceed if the device is ready
to communicate. This readiness is signaled through an interrupt request.
2. Handling Interrupt Requests: When an interrupt request occurs, the CPU responds
by storing the return address from the program counter (PC) into a memory stack. It
then branches to a service routine dedicated to processing the interrupt.
3. Priority Determination: In systems with multiple interrupt sources, the priority
interrupt system plays a crucial role in determining which interrupt to service first,
especially when multiple requests arrive simultaneously. This prioritization ensures
that critical tasks are handled promptly.
4. Priority Levels: Devices and interrupt sources are assigned different priority levels
based on the urgency and importance of their tasks. For example, high-speed
devices like magnetic disks may have higher priority than slower devices like
keyboards.
5. Software vs. Hardware Implementation:
Software Method (Polling): In this approach, a polling procedure is
employed to identify the highest-priority source. The CPU sequentially checks
each interrupt source's status to determine which one requires immediate
attention. However, if there are numerous interrupts, the polling process can
become time-consuming and may exceed the available time to service the
devices.
Hardware Method: A hardware priority-interrupt unit serves as the manager
in the interrupt system. It receives interrupt requests from various sources,
determines the highest-priority request, and issues an interrupt request to the
CPU accordingly. Each interrupt source has its own interrupt vector, enabling
direct access to its dedicated service routine without the need for polling. This
hardware-based approach significantly speeds up the interrupt handling
process.
6. Hardware Priority Function: The hardware priority function can be implemented
using either serial or parallel connection of interrupt lines. In the serial connection
(daisy chaining method), interrupt signals are passed from one device to another in a
sequential manner until the highest-priority interrupt is identified.
DAISY CHAIN INTERRUPT
Interrupt Cycle
Final Operations:
CPU-lOP Communication
1. CPU Operations:
Send Instruction to Test IOP Path: The CPU initiates communication with
the IOP by sending an instruction to test the IOP path. This instruction serves
as a signal to the IOP to prepare for communication.
2. IOP Operations:
Request IOP Status: Upon receiving the instruction from the CPU, the IOP
retrieves its status information and prepares to communicate it back to the
CPU.
Transfer Status Word to Memory Location: The IOP inserts a status word
into a designated memory location. This status word contains information
about the IOP's condition and the status of connected devices, such as
overload conditions, device busy status, or readiness for data transfer.
3. CPU Response:
Check Status Word: The CPU refers to the status word stored in memory to
determine the next course of action based on the IOP's condition. If the status
indicates that the IOP and connected devices are ready for data transfer, the
CPU proceeds accordingly.
4. Data Transfer:
Send Instruction to Start I/O Transfer: If the status indicates that the IOP
and connected devices are ready, the CPU sends an instruction to start the I/O
transfer process. This instruction includes the memory address where the IOP
can find its program instructions.
5. Concurrent Operation:
CPU Continues with Another Program: While the IOP is busy executing the
I/O transfer program, the CPU can continue executing other programs
concurrently. Both the CPU and the IOP access memory using Direct Memory
Access (DMA) transfers.
6. Completion and Status Reporting:
IOP Program Termination and Interrupt Request: Once the IOP completes
the I/O transfer program, it sends an interrupt request to the CPU to notify it
of the completion.
CPU Response to Interrupt: Upon receiving the interrupt request from the
IOP, the CPU issues an instruction to read the status from the IOP.
Transfer Status Word to Memory Location: The IOP responds by placing its
status report, indicating the completion status of the transfer and any errors
encountered, into a specified memory location.
7. Final Status Check by CPU:
CPU Checks Status Word: The CPU inspects the status word stored in
memory to determine whether the I/O operation was completed satisfactorily
and without errors.
SERIAL COMMUNICATION
1. Data Communication Processor (DCP):
A DCP is an I/O processor specialized in distributing and collecting data from
remote terminals via communication lines.
It communicates directly with data communication networks, facilitating
efficient operation in a time-sharing environment.
2. Serial Communication with Terminals:
Unlike traditional I/O processors that use a common bus, a DCP
communicates with each terminal through a single pair of wires.
Data and control information are transferred serially, resulting in slower
transfer rates compared to parallel communication.
3. Terminal Connection via Telephone Lines:
Remote terminals are connected to the DCP via telephone lines or other
communication facilities.
Converters like data sets, acoustic couplers, or modems are used to convert
digital signals into audio tones for transmission over telephone lines and vice
versa.
4. Transmission Methods:
Asynchronous transmission involves framing each character with start and
stop bits, whereas synchronous transmission transmits continuous messages
without start-stop bits.
Synchronous transmission is more efficient but requires clock synchronization
between the transmitter and receiver.
5. Error Detection and Correction:
Various methods, including parity checks, longitudinal redundancy checks
(LRC), and cyclic redundancy checks (CRC), are employed for error detection.
Error detection protocols ensure that transmitted data is received accurately,
with mechanisms in place for retransmission if errors occur.
6. Transmission Modes:
Data can be transmitted in simplex (one-way), half-duplex (one direction at a
time), or full-duplex (both directions simultaneously) modes.
Full-duplex communication requires either four-wire links or frequency
division on a two-wire circuit.
7. Data Link Protocols:
Data link control protocols facilitate orderly data transfer between
interconnected computers and terminals.
These protocols establish and terminate connections, identify senders and
receivers, ensure error-free data transfer, and manage control functions.
8. Protocol Types:
Protocols can be categorized as character-oriented or bit-oriented, depending
on the framing technique used for message transmission.
Character-Oriented Protocol
1. Character Set and Encoding:
Utilizes the ASCII (American Standard Code for Information Interchange)
character set, consisting of 128 characters, including 95 graphic characters and
33 control characters.
ASCII is a 7-bit code, with an eighth bit often used for parity. Each character
has a unique 7-bit code.
2. Control Characters:
Control characters are used for routing data, formatting text, and managing
the layout of printed pages.
They include communication control characters such as SYN, SOH, STX, ETX,
EOT, ACK, NAK, ENQ, ETB, and DLE.
3. SYN Character and Synchronization:
The SYN character serves as a synchronizing agent between the transmitter
and receiver.
It has an 8-bit code (0 0010110) chosen for its property of repeating itself only
after a full 8-bit cycle.
Upon receiving a continuous string of bits, the receiver checks for the SYN
character to establish synchronization.
Continuous strings of SYN characters are sent when the transmitter is idle to
maintain synchronization.
4. Message Format:
Messages are transmitted with a defined format consisting of a header field, a
text field, and an error-checking field.
The header begins with an SOH character and contains address and control
information.
The text field follows, terminated by an ETX character, and may contain any
ASCII characters except control characters.
The error-checking field typically includes a Block Check Character (BCC),
which can be a Longitudinal Redundancy Check (LRC) or a Cyclic Redundancy
Check (CRC).
5. Error Detection and Handling:
The receiver calculates its own BCC and compares it with the transmitted BCC.
If they match, the receiver sends a positive acknowledgment (ACK) character;
otherwise, it sends a negative acknowledgment (NAK) character, indicating the
need for retransmission.
Retransmission is attempted several times before assuming a faulty line.
6. Synchronous Idle State:
In the absence of meaningful information, the transmitter sends a continuous
string of SYN characters, and the receiver recognizes them as a condition for
synchronizing the line.
Both units maintain bit and character synchronism in a synchronous idle state,
ensuring readiness for data transmission.
Bit-Oriented Protocol
1. Independence from Character Codes:
Bit-oriented protocols are not tied to any specific character code like ASCII.
They allow the transmission of serial bit streams of any length without
character boundaries.
2. Frame Format:
Messages are organized into frames, consisting of address, control,
information, and error-checking fields.
Frame boundaries are indicated by a special flag, typically an 8-bit pattern
(01111110).
3. Examples of Bit-Oriented Protocols:
Common examples include SDLC (Synchronous Data Link Control), HDLC
(High-Level Data Link Control), and ADCCP (Advanced Data Communication
Control Procedure).
4. Primary and Secondary Stations:
Bit-oriented protocols assume the presence of at least one primary station
and one or more secondary stations.
Communication occurs from the primary station to the secondary station(s) or
vice versa.
5. Frame Structure:
Begins with a flag, followed by an address field, control field, information field,
and error-checking field.
The frame ends with another flag, indicating the end of the frame.
6. Zero Insertion Technique:
To prevent flags from occurring in the middle of frames, a method called zero
insertion is used.
A '0' is inserted after every sequence of five continuous '1's, and the receiver
removes the '0' after receiving five '1's.
7. Address Field:
Specifies the destination address (for secondary stations) or the source and
destination addresses (for primary stations).
8. Control Field:
Comes in different formats: information transfer, supervisory, and
unnumbered.
Information transfer format includes send and receive counts for sequenced
frames.
Supervisory format is used for commands, acknowledgments, and error
reporting.
Unnumbered format is for initialization, procedural errors, and control
operations.
9. Poll/Final Bit:
Used by the primary station to poll secondary stations or indicate the final
transmitted frame.
Determines when data transmission from a station is finished.
10. Error Detection:
Error-checking fields, typically containing CRC sequences, are used for
detecting errors in transmission.