Lecture 4 Interfacing and Communication
Lecture 4 Interfacing and Communication
I/O Fundamentals
Lecture 4
• Interfacing and communication are critical aspects of computer
systems, where Input/Output (I/O) fundamentals play a vital role in
facilitating data exchange between the processor, memory, and
peripheral devices.
• It ensures that both the sender and receiver are synchronized during
data transmission, preventing data loss or overflow.
• Two-Way Communication: Involves signals between the sender and
receiver to acknowledge data readiness and successful transmission.
• Synchronization: Ensures that the sender sends data only when the
receiver is ready to accept it.
• Internal Buffer area. This is an area of main store set aside to hold
data awaiting output or data recently input but not yet processed.
• The CPU actively checks the status of an I/O device and initiates data
transfers.
• The simplest form of I/O is to have the CPU do all the work. This method is
called programmed I/O.
• In the simplest method, a user program issues a system call, which the
kernel then translates into a procedure call to the appropriate driver.
• The driver then starts the I/O and sits in a tight loop continuously polling
the device to see if it is done (usually there is some bit that indicates that
the device is still busy).
• When the I/O has completed, the driver puts the data where it is needed (if
any), and returns. The operating system then returns control to the caller.
This method is called busy waiting.
• CPU Control: The CPU polls the I/O device to check if it's ready for
data transfer.
• Example: A simple printer interface where the CPU sends data to the
printer and waits for it to be printed before continuing.
4. Interrupt-Driven I/O
• Interrupt-driven I/O is a method where the CPU is alerted by an
interrupt signal from an I/O device when it is ready for data transfer.
The CPU can perform other tasks until it receives the interrupt.
• Efficient Use of CPU: Allows the CPU to perform other tasks instead
of busy-waiting.
• Vectored Interrupts:
• Mechanism: When an interrupt occurs, the CPU does not have to poll each
device to find out which one needs attention. Instead, the interrupting
device provides a vector, which is an address that directly points to its ISR.
• Advantages:
• Efficiency: Reduces the time the CPU spends identifying the
interrupting device.
• Specific Handling: Each device can have its own ISR, allowing for
more precise and efficient interrupt handling.
• Prioritized Interrupts:
• System Stability: Ensures that interrupt requests are not lost and that
devices are informed that their request is being handled.
• Physical Organization:
• Data Access Speed: SSDs are preferable for speed, while HDDs offer
more storage at a lower cost.
• Use Cases: HDDs are often used for bulk storage, while SSDs are
favored for applications requiring fast data access, such as operating
systems and frequently used programs.
Buses
• 1. Bus Protocols
• Bus protocols are the rules and standards that govern data
transmission between components within a computer system, such
as the CPU, memory, and peripherals. They ensure orderly
communication and data transfer.
• Bus Types:
• Data Bus: Carries data between components.
• Address Bus: Carries memory addresses where data is to be read or
written.
• Control Bus: Carries control signals, such as read/write commands.
• Bus Width: The number of bits that can be transferred simultaneously,
affecting data transfer speed.
• Bus Timing: Refers to the synchronization of data transfers, often managed
by a clock signal.
• Examples:
• PCIe (Peripheral Component Interconnect Express): High-speed
serial bus used for connecting high-performance peripherals like
graphics cards and SSDs.
• USB (Universal Serial Bus): Widely used for connecting external
devices like keyboards, mice, and storage devices.
• I2C (Inter-Integrated Circuit): A low-speed bus used for
communication between chips on a motherboard.
2. Arbitration
• Arbitration is the process by which a system determines which component
has control of the bus when multiple devices request access
simultaneously.
• Centralized Arbitration: A single arbiter (usually the CPU or a dedicated
arbitration circuit) decides which device gets bus access. Common methods
include:
• Priority-Based Arbitration: Devices are assigned priority levels; the
device with the highest priority wins.
• Round-Robin Arbitration: Access is granted in a rotating order to
ensure fair sharing.
• Decentralized Arbitration: Devices participate in deciding who gets
access without a central controller. An example is the daisy-chain
method, where the closest device to the CPU has the highest priority.
• Operation:
• Burst Mode: DMA takes full control of the bus to transfer a block
of data all at once.
• Cycle Stealing: DMA takes control of the bus for a single data transfer,
allowing the CPU to use the bus in between these transfers
• Advantages:
• Efficiency: Reduces CPU workload by allowing it to perform other
tasks while data is being transferred.
• Speed: Increases data transfer rates, especially useful for high-
speed devices like disk drives and network cards.
Introduction to Networks
• A network is a collection of computers and devices interconnected by
communication channels that facilitate data exchange and resource
sharing.
• Network Types:
• LAN (Local Area Network): A network covering a small geographic
area, like a home or office.
• WAN (Wide Area Network): A network covering a broad
geographic area, such as the internet.
Networks………
• Network Topologies:
• Star: All devices are connected to a central hub.
• Bus: All devices share a common communication line.
• Ring: Devices are connected in a circular fashion.
• Protocols
• TCP/IP (Transmission Control Protocol/Internet Protocol): The
foundational protocol suite for the internet, governing how data is
transmitted and received.
• Ethernet: A widely used LAN protocol that controls how data is
transmitted on wired networks.
• Wi-Fi: A wireless networking protocol based on IEEE 802.11
standards, enabling devices to connect to a network wirelessly.
Network applications:
• File Sharing: Networks enable the sharing of files and resources like
printers.
• Multimedia Hardware:
• Graphics Cards: Specialized hardware for rendering images and video,
essential for gaming and video editing.
• Sound Cards: Hardware that processes audio inputs and outputs,
improving sound quality.
• Video Capture Devices: Used to record video from external sources.
Multimedia Support applications:
• Software:
• Codecs: Software that encodes or decodes digital data streams,
crucial for compressing and playing audio and video files.
• Media Players: Software that allows users to play multimedia
content.
• Performance Requirements:
• Processor Speed: Fast processors are required to handle intensive
multimedia tasks like video rendering.
• Memory: Sufficient RAM is needed to manage large multimedia
files.
• Storage: High-capacity storage devices are essential for storing
media files, especially in uncompressed formats.
• Drawback: Requires at least three disks; rebuilding data after a disk failure
can be time-consuming.
• RAID 6 (Striping with Dual Parity):
• Enhanced Redundancy: Similar to RAID 5 but with additional parity, allowing for the
failure of two disks without data loss.
• Drawback: Requires at least four disks; slightly reduced performance compared to
RAID 5 due to extra parity calculations.
• RAID 10 (Combination of RAID 0 and RAID 1):
• High Performance and Redundancy: Combines the striping of
RAID 0 with the mirroring of RAID 1, providing both speed and
fault tolerance.
• Drawback: Expensive, as it requires a minimum of four disks and
uses half the storage capacity for redundancy.
Applications
• RAID 0: Used in scenarios where performance is critical, and data loss
is acceptable, such as in gaming or video editing.