Unit VII: Input Output Organization - Computer Architecture - BCA Notes (Pokhara University)

Breaking

Tuesday, June 2, 2020

Unit VII: Input Output Organization - Computer Architecture

External Devices:

Input-Output operations are accomplished through a wide range of external devices that provide a means of exchanging data between the external environment and the computer. An external device is attached to the computer by a link to the input/output module. The link is used to exchange control, status, and data between the input/output module and the external device. An external device connected to the input/output module is known as peripheral device or simply a peripheral. 

The external devices can be classified as:
1. Human Readable: Suitable for communicating with the computer user. For example, Screen, Printer, etc.
2. Machine Readable: Suitable for communicating with equipment. For example, Magnetic Disk, Memory, etc.
3. Communications: Suitable for communicating with remote devices. For example, Modem, Network Interface Card (NIC).

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces

1.
 
Control Signals: Determine the function that will be performed.
2. Data: Set of bits to be sent or received.
3. Status Signals: Indicate the state of the device.
4. Control Logic: Controls the device’s operations.
5. Transducer: Converts data from electrical to other forms of energy.
6. Buffer: Temporarily holds data being transferred.

Input-Output Module Structure:

Input-Output module is a hardware interface to the system bus or central switch and controls one or more peripheral devices. The I/O module is not just a connecting module, but a device that contains logic in performing the communication function between peripherals and the computer bus.

There are several reasons why devices are not directly connected to the computer system bus, namely:

1. The various methods of operating peripheral devices, so it is not practical if the computer system must handle various kinds of peripheral device operating systems.

2. The data transfer rate of peripheral devices is generally slower than the data transfer rate on the CPU or memory.

3. The data format and length of data on peripheral devices are often different from the CPU, so modules need to be synchronized.

For some of the reasons above, the I/O module has two main functions, namely:
1. As an interface device to the CPU and memory through the system bus. 
2. As an interface device with other peripheral equipment using certain data links.  

I/O module is a component in a computer system that is responsible for controlling an external device or more and is also responsible for exchanging data between that external device with main memory or with CPU registers. In realizing this, an internal interface with the computer (CPU and main memory) is required and an interface with its external devices to carry out control functions.

The function in carrying out the tasks for the I/O module can be divided into several categories, namely:
1. Control and timing.
2. CPU communication.
3. Communication of external devices.
4. Data buffering.
5. Error detection.

Control and Timing Functions are important to synchronize the work of each computer component. At one time the CPU communicates with one or more devices with erratic patterns and the speed of transfer of data communication varies, both with internal devices such as registers, main memory, secondary memory, peripheral devices. The process can run if there are control and timing functions that govern the system as a whole.

Transferring data from peripherals to the CPU via an I/O module can include the following steps:
1. Request and check the device status from the CPU to the I/O module.
2. The I/O module provides answers to CPU requests.
3. When an external device is ready for data transfer, the CPU will send commands to the I/O module.
4. The I/O module will receive data packets of a certain length from the peripherals.
5. Then the data is sent to the CPU after synchronizing the data length and the transfer speed by the I/O module so that the data packets can be received by the CPU properly.

Data transfer will not be separated from the use of the bus system, so the CPU and I/O module interaction will involve the control and timing of a bus arbitration or more.

Communication Function between the CPU and the I/O module includes the following processes:
1. Command Decoding: I/O module receives commands from the CPU that are sent as signals to the control bus. For example, an I/O module for disks can receive commands: Read sector, Scan record ID, Format disk.
2. Data: The exchange of data between the CPU and I/O modules via the data bus.
3. Status Reporting: Reporting the status of I/O module and peripheral devices, generally in the form of Busy or Ready status. Also the status of a wide range fault condition (error).
4. Address Recognition: The equipment or components making up a computer can be contacted or called must have a unique address, as well as on peripheral devices, so that each I/O module must know the address of the controlled peripheral.

On the side of the I/O module to the peripheral device there is also communication which includes data communication, control and status.

Buffering Function: The main purpose of buffering is to get data adjustments due to differences in the rate of data transfer from peripheral devices to the processing speed on the CPU. Generally the rate of data transfer from peripheral devices is slower than the speed of the CPU or storage media.

Error Detection Function: If there are problems with the peripheral device so the process cannot be run, the I/O module will report the error. For example error information on printer peripherals such as- curled paper, out of ink, out of paper, and so on. A common technique for error detection is the use of parity bits.

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces


Input-Output Data Transfer Techniques:

There are 3 different types of data transfer techniques:

1. Programmed Input-Output:

With programmed input/output, data are exchanged between the CPU and the input/output module. The CPU executes a program that gives it direct control of the input/output operation, including sensing the device status, sending a read/write command, and transferring the data. When CPU issues a command to the input/output module, it must wait until the input/output operation is completed. If CPU is faster than the input/output module then there is wastage of CPU time.

Using programmed input/output, the input/output module will perform the requested actions and then set appropriate bits in the status register. It is the responsibility of the CPU to periodically check the status of the input/output module until it finds that the operation is completed.

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces

To carry out I/O commands, the CPU will issue an address for the I/O module and its peripheral devices so that it is specifically specified and an I/O command to be performed. There are four classifications of I / O commands, namely:

1. Control Command:

This command is used to activate the peripheral device and notify the task that was ordered to him.

2. Test Command:

This command is used by the CPU to test various I/O module status conditions and peripherals. The CPU needs to know the peripherals are active and ready to use, also to find out the IO operations that are performed and detect errors.

3. Read Command:

The command in the I/O module is to take a data packet and then place it in the internal buffer. In the next process, the data packet is sent via the data bus after data synchronization and transfer speed occur.

4. Write Command:

This command is the opposite of the read command. The CPU instructs the I/O module to retrieve data from the data bus to be given to the peripheral device for which the data is intended. 

2. Interrupt Driven Input Output:

Using programmed control input/output technique there is wastage of the time of CPU, which is overcome by interrupt-driven input/output technique. Here, CPU issues read command and when the input/output module gets data from peripheral device then it interrupts CPU. After that, CPU requests data and input/output module transfer data. The CPU reads data and store it in the main memory.

In this technique command control is still the responsibility of the CPU, both taking commands from memory and executing the contents of those commands. There is a step forward from the previous technique, the CPU multitasking several commands at once so that there is no waiting time for the CPU. There are various techniques that the CPU uses in handling this interrupt program, namely:

1. Multiple Interrupt Line:

The simplest technique is to use an interrupt line with numerous Multiple Interrupt Lines between the CPU and I/O modules. But it is not practical to use a number of bus lines or CPU pins to all interrupt channels of I/O modules.

2. Software Poll:

In this process, if the CPU is aware of an interruption, then the CPU will go to the interrupt service routine whose job is to poll all the I/O modules to determine the module that is interrupting.  The disadvantage of software polls is that it takes a long time because they have to identify all modules to find out which I/O modules are interrupting.  

3. Daisy Chain:

It is a more efficient interrupt technique, which uses hardware polls. All I/O modules are connected to a CPU interrupt channel in a chain. If there is an interrupt request, the CPU will run an acknowledgment signal that runs on the interrupt channel until it encounters the I/O module that sends the interrupt.    

4. Bus Arbitration:

In this method, the I/O module first gets the bus control before this module uses the interrupt request channel. Thus there will only be an I/O module that can interrupt. 

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces


3.
Direct Memory Access (DMA):

The technique described earlier, programmed I/O and Interrupt-Driven I/O has a weakness, namely the process that occurs in the I/O module still involves the CPU directly. This has implications for:
1. The I/O transfer rate depends on the CPU operating speed.        
2. CPU work is interrupted due to direct interruptions.      
  
Starting from the weaknesses above, moreover to handle large-volume data transfer developed a better technique, known as Direct Memory Access (DMA). 

The working principle of DMA is that the CPU will delegate the work of I / O to the DMA, the CPU will only be involved at the beginning of the process to give complete instructions on the DMA and the end of the process. Thus the CPU can run other processes without much interference with interruptions.

In carrying out data transfers independently, DMA requires the transfer of bus control from the CPU. For this reason, DMA will use the bus if the CPU does not use it, or DMA forces the CPU to temporarily stop using the bus. The last technique is more commonly used, often called cycle stealing, because the DMA module takes over the bus cycle.

Temporarily stopping the use of the bus is not a form of interruption, but only a temporary termination of the process that has implications only for CPU execution delays. 

The overall operation for the data transfer is controlled through the DMA controller.

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces


Input-Output Channels and Processor:

As computer systems have evolved, there is a pattern of complexity and sophistication of individual components. There are different characteristics of input/output channels for accomplishing complicated tasks. It has the ability to execute input/output instructions, which gives it complete control over input/output operations.

Some Tasks Are:
1. Instructions are stored in the main memory to be executed by a special-purpose processor.
2. A selector channel controls multiple high-speed devices and at any time.
3. The input/output channel selects one device and effects the data transfer.
4. Similarly, a multiplexer channel can handle multiple devices at the same time.
5. For low-speed devices, a byte multiplexer accepts or transmits characters as fast as possible to multiple devices.

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces

External Interfaces:

The interface to a peripheral from an input/output module must be tailored to the nature and operation of the peripheral. One major characteristic of the interface is whether it is serial or parallel.

In a parallel interface, there are multiple lines connecting the input/output module and the peripheral, and multiple bits are transferred simultaneously, just as all of the bits of a word are transferred simultaneously over the data bus.

In a serial, there is only one line used to transmit data, and bits must be transmitted one at a time. A parallel interface has traditionally been used for higher speed peripherals, such as tape and disk, while the serial interface has traditionally been used for printers and terminals. With a new generation of high-speed serial interfaces, parallel interfaces are becoming much less common.

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces

In either case, the input/output module must engage in a dialogue with the peripheral. In general terms, the dialogue for a write operation is as follows:
1. The input/output module sends a control signal requesting permission to send data.
2. The peripheral acknowledges the request.
3. The input/output module transfers data (one word a block depending on the peripheral).
4. The peripheral acknowledges receipt of the data.

A read operation proceeds similarly.

The key to the operation of an input/output module is an internal buffer that can store data being passed between the peripheral and the rest of the system. This buffer allows the input/output module to compensate for the differences in speed between the system bus and its external lines.

Examples:

1. SCSI:

1. Acronym for Small Computer System Interface.
2. Pronounced "scuzzy," SCSI is a parallel interface standard used by Apple Macintosh computers, PCs, and many UNIX systems for attaching peripheral devices to computers.
3. Provide for faster data transmission rates (up to 80 megabytes per second) than standard serial and parallel ports.
4. Can attach many devices to a single SCSI port, so that SCSI is really an I/O bus rather than simply an interface.
5. However, SCSI rarely used because each piece of SCSI hardware has its own host adapter, and the software drivers for the device cannot work with an adapter made by someone else.
6. Nearly all Apple Macintosh computers, excluding only the earliest Macs and the recent iMac, come with a SCSI port for attaching devices such as disk drives and printers.

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces

2. FireWire (IEEE 1394 ):

1. Fire Wire is Apple Computer's version of a standard, IEEE 1394, High Performance Serial Bus, for connecting devices to personal computer.
2. Uses for devices that need to transfer high levels of data in real-time, such as video devices.
3. Fire Wire provides a single plug-and-socket connection on which up to 63 devices can be attached with data transfer speeds up to 400 Mbps (megabits per second).
4. Like USB, it also supports both Plug-and-Play and hot plugging, and also provides power to peripheral devices.

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces

3. USB:

1. USB (Universal Serial Bus) is a plug-and-play interface between a computer and add-on devices (such as mouse, scanners, and printers).
2. With USB, a new device can be added to the computer without having to add an adapter card or even having to turn the computer off.
3. USB 1.1 supports a data speed of 12 megabits per second. This speed will accommodate a wide range of devices. 
4. It is expected to completely replace serial and parallel ports.
5. A single USB port can be used to connect up to 127 peripheral devices. 

Input-Output Organization, External Devices, Input-Output Module Structure, Input Output Data Transfer Techniques, Programmed Input-Output, Interrupt Driven Input-Output, Interrupt Handling Techniques, Review of Direct Memory Access (DMA), Input-Output Channels, Input-Output Processors, External Interfaces

No comments:

Post a Comment

If you have any doubt, then don't hesitate to drop comments.