Search This Blog

Tuesday, 4 November 2014

Input/Output (I/O)

While the heart of a computer is its central processing unit or CPU (the part that actually “computes”), a computer must also have a “circulatory system” through which data moves between the CPU, the main memory, input devices (such as a keyboard or mouse), output devices (such as a printer), and mass storage devices (such as a hard or floppy disk drive). Input/Output or I/O processing is the general term for the management of this data flow (see also bus, parallel port, serial port, and usb).

I/O processing can be categorized according to how a request for data is initiated, what component controls the process, and how the data flows between devices. In most early computers the CPU was responsible for all I/O activi-ties (see cpu). Under program control, the CPU initiated a data transfer, checked the status of the device (or area of memory) that would be sending or receiving the data, and monitored the flow of data until it was complete. While this arrangement simplified computer architecture and reduced the cost of memory units or peripheral devices  when computer hardware was hand-built and relatively costly), it also meant that the CPU could perform no other processing until I/O was complete.

In most modern computers, responsibility for I/O has largely been removed from the CPU, freeing it to concen-trate on computation. There are several ways to imple-ment such architecture. One method that has been used on microcomputers since their earliest day is interrupt-driven I/O. This means that the CPU has separate circuits on which a device requesting I/O service can “post” a request. The CPU periodically checks the circuits for an interrupt request (IRQ). If one is found, it can send a query to each device on a list until the correct one is found (the latter is called polling). Alternatively, the overhead involved in polling can be eliminated by having the IRQ include either a device identification number or a memory address that contains an interrupt service routine (this is called vectored interrupts). While interrupts alone do not free the CPU of the need to manage the I/O, they do remove the overhead of having to frequently check all devices for I/O.

The actual I/O process can also be moved out of the CPU through the use of direct memory access (DMA). Here a separate control device takes over control of the system from the CPU when I/O is requested. It then transfers data directly between a device (such as a hard disk drive) and a buffer in main memory. Although the CPU is idle dur-ing this process, the transfer is accomplished much more quickly because the full capacity of the bus can be used to move data rather than having to be shared with the flow of program instructions in the CPU.

A more sophisticated I/O control device is called a chan-nel. A channel controller can operate completely indepen-dently of the CPU without requiring that the CPU become idle during a transfer. Channels can also act as a sort of spe-cialized CPU or coprocessor, running program instructions to monitor the data transfer. There are also channels capa-ble of monitoring and controlling several devices simulta-neously (this is called multiplexing). The use of channels in mainframes such as the IBM 360 and its descendants is one reason why mainframes still perform a workhorse role in high-volume data processing.

In microcomputers the trend has also been toward offloading I/O from the CPU and the main bus to separate controllers or channels. For example, the AGP (acceler-ated graphics port) found on most modern PCs acts as a channel between main memory and the graphics control-lers (see graphics card). This means that as a program generates graphics data it can be automatically transferred from memory to the graphics controllers without any load on the CPU, and over a bus that is faster than the main system bus.

No comments:

Post a Comment