0% found this document useful (0 votes)
8 views

5- Data Transfer

Uploaded by

rahul.whatsera
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

5- Data Transfer

Uploaded by

rahul.whatsera
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Input/Output (I/O) DevIces anD

Data transfer

1. I/O Devices: Types and Functions


I/O devices enable interaction between the computer system
and external environments like users, other devices, and
networks. They can be broadly classified into two categories:
Input devices and Output devices.
a) Input Devices
Input devices allow the user to send data to the computer
system. They provide a way for humans to interact with the
system, entering data and instructions. Common examples
include:
• Keyboard: The primary input device that allows users to
enter text and commands

• Mouse: A pointing device used to interact with graphical


elements on the screen.
• Scanner: Converts physical documents and images into a
digital format.

• Microphone: Captures audio and converts it into digital


signals for processing.

• Touchscreen: Acts as both an input and output device by


allowing users to interact directly with the screen.
b) Output Devices
Output devices allow the computer to convey information to
the user or to another system. These devices display or store
processed data from the CPU. Examples include:
• Monitor: Displays visual output, including text, graphics,
and videos.

• Printer: Produces a hard copy of documents or images.


• Speakers: Output audio signals generated by the
computer.

• Disk Drives (HDD, SSD): Provide storage and retrieval of


data, acting as output devices when writing data.
I/O devices allow the computer to communicate with the
outside world, enabling interactions between the user and
the system, and between the system and other devices.
2. I/O Ports and Controllers
a) I/O Ports
An I/O port is an interface through which data can be
transferred between the CPU and peripheral devices. Ports
serve as the physical connectors through which devices can
communicate with the computer system. They come in
various forms, including:
• Serial Ports: Send data one bit at a time over a single
channel (e.g., RS-232).
• Parallel Ports: Send multiple bits of data simultaneously
over multiple channels (e.g., printer ports).
• USB Ports: Universal Serial Bus ports for connecting a
wide range of peripherals like keyboards, mice, printers,
and external storage devices.
Each I/O port is linked to a specific address in memory, which
allows software to read from or write to a specific device.
b) I/O Controllers
An I/O controller is responsible for managing the data
transfer between the computer and its I/O devices. It acts as
an intermediary between the CPU and the I/O device,
ensuring that the correct data is transferred at the correct
time. The I/O controller handles the communication
protocols and data formatting necessary for the device to
function correctly.
Types of I/O controllers:
• Keyboard Controller: Manages input from the keyboard.
• Disk Controller: Manages the data transfer to and from
disk drives.
• Network Interface Controller (NIC): Manages data
transfer between the computer and network devices.
• Display Controller: Manages the output to a monitor or
display screen.
The controller ensures that the CPU can interact with devices
effectively without direct interaction with the hardware.
3. Data Transfer Techniques
Efficient data transfer between the CPU, memory, and I/O
devices is essential for system performance. There are three
primary techniques for data transfer between the CPU and
I/O devices: Programmed I/O (PIO), Interrupt-driven I/O,
and Direct Memory Access (DMA).

a) Programmed I/O (PIO)


Programmed I/O involves the CPU actively controlling and
monitoring the data transfer to and from I/O devices. In this
method, the CPU issues a command to the I/O device and
waits for the device to complete the task before it can
proceed with other operations. While simple, it can be
inefficient as the CPU is held up waiting for the I/O operation
to complete, reducing overall system performance.
Example: The CPU reads data from an input device by polling
the device, checking for data availability, and then
transferring the data when it is ready.
b) Interrupt-driven I/O
Interrupt-driven I/O allows the CPU to perform other tasks
while waiting for I/O operations to complete. In this method,
the I/O device sends an interrupt signal to the CPU when it
needs attention (e.g., when data is ready for reading or
writing). When the interrupt occurs, the CPU pauses its
current operations, processes the I/O request, and then
resumes normal processing. This technique allows for more
efficient use of the CPU, as it does not need to continuously
check the status of I/O devices.
Example: The keyboard sends an interrupt signal to the CPU
when a key is pressed. The CPU then processes the key press
and returns to its previous tasks.
c) Direct Memory Access (DMA)
DMA allows data to be transferred directly between memory
and I/O devices without involving the CPU. DMA controllers
(DMACs) handle data transfers, freeing up the CPU from
being involved in the I/O operations. DMA is particularly
useful for high-speed data transfers, such as in disk or
network transfers, where the CPU’s intervention would be
too slow and inefficient.
Example: When reading data from a hard drive, the DMA
controller takes over the task, moving data from the disk to
memory without CPU intervention, thus improving overall
system efficiency.
4. Bus Architecture
Bus architecture refers to the system of pathways used for
communication between the CPU, memory, and I/O devices.
Buses are essential for data transfer in modern computer
systems, allowing multiple components to communicate with
each other in an organized manner. There are three main
types of buses: data bus, address bus, and control bus.
a) Data Bus
The data bus is responsible for transferring the actual data
between the CPU, memory, and I/O devices. It is
bidirectional, meaning that data can flow in both directions.
The width of the data bus (measured in bits, e.g., 32-bit, 64-
bit) determines how much data can be transferred in a single
operation.
b) Address Bus
The address bus carries the addresses of the memory
locations that need to be accessed by the CPU. It is
unidirectional, meaning it only sends addresses from the CPU
to memory or I/O devices. The width of the address bus
determines the maximum amount of memory the system can
access. For example, a 32-bit address bus can access 2^32
addresses (4 GB of memory).
c) Control Bus
The control bus carries control signals that direct the
operations of the CPU, memory, and I/O devices. These
signals include read/write commands, clock signals, and
interrupt requests. The control bus ensures that the various
components of the computer system communicate effectively
and synchronize their operations.
Summary of Bus Architecture
Bus Type Function
Carries data between the CPU, memory, and I/O
Data Bus
devices.
Address Carries memory addresses to specify where data
Bus should be read from or written to.
Control Transmits control signals to manage read/write
Bus operations, synchronization, and interrupts.
5. Data Transfer Process in I/O
The data transfer process between the CPU, memory, and I/O
devices typically follows this general sequence:
1. Initiation: The CPU sends a command to an I/O device
through an I/O port.
2. Data Transfer: Depending on the method used (PIO,
interrupt-driven, or DMA), data is transferred between
the device and the memory.
3. Completion: After the transfer, the I/O device notifies
the CPU (e.g., through an interrupt), and the data is
available for processing.

You might also like