7.2 I/O Modules
COS2621 - Computer Organisation · 7. Input/Output
I/O Modules
An I/O module is a crucial component in a computer system that facilitates communication between the CPU and external devices. It manages data transfer between the computer and peripherals such as keyboards, mice, printers, and disk drives. The I/O module is responsible for converting the data formats used by the CPU into formats that external devices can understand.
Functions of I/O Modules
The primary functions of an I/O module include:
- Data Transfer: Moving data between external devices and the computer's memory. This is essential for the system to operate effectively.
- Control: Managing the timing and control signals for data transfer, ensuring that data is sent and received correctly.
- Data Formatting: Converting data between different formats as necessary for compatibility between the CPU and peripherals.
- Error Detection: Identifying and handling errors that may occur during data transfer, ensuring data integrity.
Types of I/O Modules
I/O modules can be classified based on their functionality:
- Programmed I/O: The CPU actively waits for the I/O operation to complete. This method can be inefficient as it wastes CPU time while waiting.
- Interrupt-Driven I/O: The CPU is notified via interrupts when an I/O operation is complete, allowing it to perform other tasks in the meantime. This method improves efficiency.
- Direct Memory Access (DMA): Allows devices to transfer data directly to and from memory without continuous CPU intervention, enhancing overall system performance.
Example of I/O Module Functionality
Consider a scenario where a keyboard sends input to a computer. The I/O module connected to the keyboard performs the following steps:
- It receives the keystroke signal from the keyboard.
- It converts the signal into a binary format that the CPU can understand.
- It sends the formatted data to the CPU, often triggering an interrupt to notify the CPU that new data is available.
Watch out: Do not confuse the functions of I/O modules with those of the CPU. I/O modules handle external communication, while the CPU processes data internally.
Data Transfer Methods
Data can be transferred using various methods:
- Memory-Mapped I/O: I/O devices are treated as part of the memory address space. The CPU can read from or write to these addresses as if they were memory locations.
- Port-Mapped I/O: Uses separate address spaces for I/O devices. The CPU uses specific instructions to access these devices.
Data Transport Mechanism
The I/O module plays a vital role in moving data between the computer and its external environment. This process is often referred to as data transport. The I/O module facilitates this by managing the communication protocols and ensuring that data is correctly formatted and transmitted.
Summary
- I/O modules enable communication between the CPU and external devices.
- They perform essential functions such as data transfer, control, and error detection.
- Data transfer can occur through programmed I/O, interrupt-driven I/O, or DMA.
Check your understanding
- What is the main function of an I/O module?
- Explain the difference between programmed I/O and interrupt-driven I/O.
- What are the advantages of using DMA for data transfer?
- Two addresses are dedicated to keyboard input from a particular terminal. Address 516 refers to the data register and address 517 refers to the __________.
Test yourself
5 quick questions on this lesson. Pick an answer to see if you're right.
1. Which method allows devices to transfer data directly to and from memory without continuous CPU intervention?
2. Two addresses are dedicated to keyboard input from a particular terminal. Address 516 refers to the data register and address 517 refers to the __________.
3. What is the primary function of an I/O module?
4. The major functions or requirements for an I/O module fall into the following categories except ________.
5. What is the main advantage of using Interrupt-Driven I/O over Programmed I/O?