Algorithms- correctness of algorithms Flashcards
I/O interface
transfer information between internal storage and external I/O devices is known as I/O interface. The CPU is interfaced using special communication links by the peripherals connected to any computer system. These communication links are used to resolve the differences between CPU and peripheral. There exists special hardware components between CPU and peripherals to supervise and synchronize all the input and output transfers that are called interface units.
Mode of transfer in I/O:
The binary information that is received from an external device is usually stored in the memory unit. The information that is transferred from the CPU to the external device is originated from the memory unit. CPU merely processes the information but the source and target is always the memory unit. Data transfer between CPU and the I/O devices may be done in different modes. Data transfer to and from the peripherals may be done in any of the three possible ways
Programmed I/O.
Interrupt- initiated I/O.
Direct memory access( DMA).
programmed I/O
It is due to the result of the I/O instructions that are written in the computer program. Each data item transfer is initiated by an instruction in the program. Usually the transfer is from a CPU register and memory. In this case it requires constant monitoring by the CPU of the peripheral devices.
Example of Programmed I/O: In this case, the I/O device does not have direct access to the memory unit. A transfer from I/O device to memory requires the execution of several instructions by the CPU, including an input instruction to transfer the data from device to the CPU and store instruction to transfer the data from CPU to memory. In programmed I/O, the CPU stays in the program loop until the I/O unit indicates that it is ready for data transfer. This is a time consuming process since it needlessly keeps the CPU busy. This situation can be avoided by using an interrupt facility. This is discussed below.
Interrupted- initiated I/O
the CPU can be kept busy unnecessarily. This situation can very well be avoided by using an interrupt driven method for data transfer. By using interrupt facility and special commands to inform the interface to issue an interrupt request signal whenever data is available from any device. In the meantime the CPU can proceed for any other program execution. The interface meanwhile keeps monitoring the device. Whenever it is determined that the device is ready for data transfer it initiates an interrupt request signal to the computer. Upon detection of an external interrupt signal the CPU stops momentarily the task that it was already performing, branches to the service program to process the I/O transfer, and then return to the task it was originally performing.
The I/O transfer rate is limited by the
speed with which the processor can test and service a device.
The processor is tied up in managing an I/O transfer; a number of instructions must be executed for each
I/O transfer
Hardware Interrupts
Interrupts present in the hardware pins.
Software interrupts
These are the instructions used in the program whenever the required functionality is needed.
Vectored interrupts
These interrupts are associated with the static vector address.
Non-vectored interrupts
These interrupts are associated with the dynamic vector address.
Maskable interrupts
These interrupts can be enabled or disabled explicitly.
Non-maskable interrupts
These are always in the enabled state. we cannot disable them.
external interrupts
Generated by external devices such as I/O.
internal interrupts
These devices are generated by the internal components of the processor such as power failure, error instruction, temperature sensor, etc.
synchronous interrupts
These interrupts are controlled by the fixed time interval. All the interval interrupts are called as synchronous interrupts.