Input-Ouput Interface
Input-Ouput Interface
I/O I/O
CPU Interface Devices
A Method for transferring
information between internal
storage(memory and
registers) & external I/O
devices.
Purpose of an I/O Interface:
1.Facilitate Communication: Ensures that data and control signals are properly exchanged
2.Device Compatibility: Allows devices with different data formats, speeds, and electrical
3.Control Operations: Handles synchronization, error detection, and data buffering during
communication.
I/O Interface
I/O Interface Cont…
Key Functions of an I/O Interface:
1.Data Transfer:
1. Manages the movement of data between the CPU and peripherals.
2. Uses various techniques like programmed I/O, interrupt-driven I/O, or Direct Memory
Access (DMA).
2.Address Decoding:
1. Determines whether a specific command or data is meant for a particular I/O device by
decoding the address issued by the CPU.
3.Control Signals:
1. Sends control signals (like read/write) to initiate or terminate communication with a device.
4.Status Monitoring:
1. Tracks the readiness of devices (e.g., busy, idle, or error states) and informs the CPU.
5.Error Detection:
1. Identifies communication errors, such as parity errors or transmission issues, and handles
them appropriately.
Key Components of an
I/O Interface
OVERVIEW AND EXAMPLES
Control Logic
Manages data and control signals between the CPU and devices.
(Manages the communication between CPU and Peripheral Devices).
Interprets commands from CPU and generates appropriate control signal for peripheral.
Example:
Keyboard interface detects key presses and sends signals to the CPU.
Data Buffer
Temporarily stores data being transferred between the CPU and devices.
Helps in handling difference in speed( CPU is much faster than I/O devices.
Example:
Printer interface stores characters before sending them to be printed.
Control and Status Register
Control Register holds commands from the CPU for the I/O device( start, Stop or Reset ).
Status register Indicates the current status of the I/O device (e.g., ready, busy, error).
Example:
Hard disk interface shows 'busy' while processing a read/write operation.
Example Scenario:
Consider the following interaction between the control register and the status register for a
hard disk interface:
1.The CPU writes a "start" command to the control register to initiate a read operation on
the hard disk.
2.The hard disk begins reading data, and the status register shows a "busy" flag, indicating
that the device is currently in use.
3.Once the read operation completes, the status register clears the "busy" flag and sets the
"ready" flag to indicate that the device is ready for the next operation.
4.If there’s an issue during the operation, such as a bad sector, the status register sets the
"error" flag to inform the CPU.
Address Decoder
Identifies whether a command or data is for a specific I/O device.
In other words, It identifies the I/O devices being accessed using the address
provided by the CPU.
Example:
USB interface responds to the address assigned by the CPU (e.g.,
0xFFFF0000).
Data Bus
Transports data between the CPU, memory, and peripherals.
Data lines in data bus connect the CPU to I/O device for transferring data.
Example:
Transfers file content from RAM to a hard disk.
Control Bus
Sends control signals to manage communication (e.g., read/write).
Example:
Signals USB devices to perform a write operation.
Buffering Mechanism
Temporarily stores data to resolve speed mismatches between devices.
This mechanism is essential for improving performance and efficiency in data
transfer, especially when the producer (sender) and the consumer (receiver) of
the data have different processing speeds.
Example:
Printing a Document
How Buffering Works:
The computer (sender) sends the document to the printer buffer
(temporary storage).
The buffer holds the data temporarily.
The printer (receiver) reads the data from the buffer when it's ready to
print, without needing to wait for the entire document to be transferred at
once.
Interface Logic
Convert data between formats or protocol used by CPU and devices
Process:
- The CPU sends a read command to the device.
- The device places data on the data bus.
- The CPU reads and processes the data.
Example:
- Reading a character from a keyboard.
- Fetching a file from a hard disk.
2. Write Command
Purpose: Sends data from the CPU or memory to an I/O device.
Process:
- The CPU sends a write command with data to the device.
- The device stores or processes the data.
Example:
- Sending a document to a printer.
- Writing data to a USB drive.
3. Control Command
Purpose: Configures or manages the operation of an I/O device.
Process:
- The CPU sends a control command specifying the operation.
- The device updates its configuration.
Example:
- Resetting a printer.
- Setting a network card to start data transmission.
4. Status Command
Purpose: Queries the current status of an I/O device.
Process:
- The CPU sends a status command to the device.
- The device returns its operational state (ready, busy, or error).
Example:
- Checking if a printer is ready to print.
- Verifying if a USB drive is ready to receive data.
Interface Unit Diagram
Selection of interface unit
I/O Mapping
OVERVIEW AND TYPES
Overview
When Computer use one common bus to transfer information between memory or I/O
device or CPU
There are 2 ways that computer programs communicate with I/O devices or 2 technique
for addressing the I/O device by the CPU.
Add
Data
MEMR
MEMW
IOR
IOW
•In Memory-Mapped I/O, both memory and I/O devices are assigned addresses in the
same address space. This means that the I/O devices are accessed using the same
instructions (such as LOAD and STORE) as memory.
•The CPU doesn't distinguish between memory and I/O devices when performing
operations; it uses memory control signals to read from or write to both memory and I/O
devices.
•Single set of read/write control lines for both I/O & memory .
Disadvantages:
•Consumes Address Space: Uses part of the system’s address space, reducing available
memory.
•Potential Conflicts: Address overlap between memory and I/O can cause issues.
•Security Risks: Direct access to I/O devices can be a security concern.
•Complex Hardware: Requires more complex hardware for mapping and access control.
Data Transfer
Transmission of data from one unit to another
1.Serial Transmission
1.1 Synchronous data transfer
1.2 asynchronous data transfer
2. Parallel Transmission (synchronous )
Feature Synchronous Data Transfer Asynchronous Data Transfer
Clock Two units share a common clock. Two units are independent, each with its
own private clock.
Data Synchronization Data transfer between sender and receiver Data transfer between sender and receiver is
is synchronized with the same clock not synchronized with the same clock pulse.
pulse.
Usage Used between devices that match in Used between devices that do not match in
speed. speed.
Bit Transmission Bits are transmitted continuously to keep Bits are sent only when available, and the
the clock frequency synchronized in both line remains idle when there is no data to
units. transmit.
Meaning Synchronous means at the same time (due Asynchronous means at regular intervals
to common clock). (due to no common clock).
Speed Fast. Slow.
Cost Costly Economical.
Thank you for your patience.
Any Question!!!!!!