Download U 3 part 1 notes and more Lecture notes Computer Architecture and Organization in PDF only on Docsity!
COMPUT
ER
ORGANI
ZATION
UNI
T-
INPUT-OUTPUT ORGANIZATION
3.1 EXTERNAL DEVICES:
♦ I/O, provides an efficient mode of communication between the central
system and the outside environment.
♦ Programs and data must be entered into computer memory for processing
and results obtained from computations must be recorded or displayed for the user
♦ Input or output devices attached to the computer are also called peripherals.
♦ Among the most common peripherals are keyboards, display units, and
printers
♦ We can broadly classify peripheral devices into three categories:
✓ Human Readable : Communicating with the computer users, e.g. video
display terminal, printers etc.
✓ Machine Readable : Communicating with equipments, e.g. magnetic
disk, magnetic tape, sensor, actuators used in robotics etc.
✓ Communication : Communicating with remote devices means
exchanging data with that, e.g. modem, NIC (network interface Card) etc.
Fig: BLOCK DIAGRAM OF EXTERNAL DEVICE
♦ Control signals determine the function that the device will perform such as
send data to I/O module, accept data from I/O module.
♦ Status signals indicate the state of the device i.e. device is ready or not.
♦ Data bits are actual data transformation.
♦ Control logic associated with the device controls the device's operation in
response to direction from the I/O module.
♦ The transducer converts data from electrical to other forms of energy
during output and from other forms to electrical during input.
♦ Buffer is associated with the transducer to temporarily hold data being
transferred between the I/O module and external devices i.e. peripheral environment.
Input Device
1. Keyboard
2. Optical input devices
- Card Reader
- (^) Paper Tape Reader
- Optical Character Recognition (OCR)
- Optical Bar code reader (OBR)
- Digitizer
- Optical Mark Reader
3. Magnetic Input Devices
- If the device is operational and ready to transmit, the processor requests the transfer of data by means of a command to I/O module.
- The I/O module obtains the unit of data from the external device.
- The data are transferred from the I/O module to the processor.
- Processor Communication : I/O module communicates with the processor which involves:
- Command decoding : I/O module accepts commands from the processor.
- Data: Data are exchanged between the processor and I/O module over the bus.
- Status reporting: Peripherals are too slow and it is important to know the status of I/O module.
- Address recognition: I/O module must recognize one unique address for each peripheral it controls.
3. Device Communication : It involves commands, status information and
data.
4. Data Buffering : I/O module must be able to operate at both device and
memory speeds. If the I/O device operates at a rate higher than the memory access rate, then the I/O module performs data buffering. If I/O
devices rate slower than memory, it buffers data so as not to tie up the memory in slower transfer operation.
- Error Detection : I/O module is responsible for error detection such as mechanical and electrical malfunction reported by device e.g. paper jam, bad ink track & unintentional changes to the bit pattern and transmission error.
I/O Module Structure
Fig: Block diagram of I/O Module
The I/O bus from the processor is attached to all peripheral interfaces
- To communicate with the particular devices, the processor places a device address on the address bus.
- Each interface contains an address decoder that monitors the address line. When the interface detects the particular device address, it activates the path between the data line and devices that it controls.
- At the same time that the address is made available in the address line, the processor provides a function code in the control way, includes control command, output data and input data.
I/O Module Decisions
♦ Hide or reveal device properties to CPU
- Support multiple or single device
♦ Control device functions or leave for CPU
- Also O/S decisions ,e.g. Unix treats everything it can as a file
3.3. Modes of transfer
♦ Data Transfer between the central computer and I/O devices may be handled
in a variety of modes.
♦ Some modes use CPU as an intermediate path, others transfer the data
directly to and from the memory unit.
♦ Data transfer to and from peripherals may be handled in one of three
possible modes.
I. Programmed I/O
II. Interrupt Driven I/O
III. Direct Memory Access (DMA)
Question: Explain in detail the programmed I/O and Interrupt driven I/O operations(10 M)(a). Question:Explain the method of programmed I/O(5 M)
I. Programmed I/O :(a)
♦ Programmed I/O operations are the result of I/O instructions
written in the computer program
♦ In programmed I/O, each data transfer in initiated by the
instructions in the CPU and hence the CPU is in the continuous monitoring of the interface.
♦ Input instruction is used to transfer data from I/O device to
CPU, store instruction is used to transfer data from CPU to memory and output instruction is used to transfer data from CPU to I/O device.
♦ This technique is generally used in very slow speed computer
and is not a efficient method if the speed of the CPU and I/O is different.
♦ I/O device places the data on the I/O bus and enables its data valid signal
- The interface accepts the data in the data register and sets the F bit of status register and also enables the data accepted signal.
modules as memory locations and uses the same machine instructions to access both memory and I/O devices
- for example, with 10 address lines, a combined total of 2^10= 1024 memory locations and I/O addresses can be supported, in any combination. ii. Isolated:
- In this mode the I/O gets isolated from the memory hence it’s called isolated I/O. The command line specifies whether the address refers to a memory location or an I/O device. The full range of addresses may be available for both.
- With 10 address lines, the system now supports both 1024 memory locations and 1024 I/O addresses.
II. INTERRUPT DRIVEN I/O: (a) ♦ The problem with programmed I/O is that the processor has to wait a long time for the I/O module of concern to be ready for transmission of data. ♦ In Interrupt driven I/O the processor issues an I/O command to a module and then go on to do some other useful work. ♦ The I/O module will then interrupt the processor to request service when it is ready to exchange data with processor.
♦ The processor then executes the data transfer, and then resumes its former processing. The interrupt can be initiated either by software or by hardware.
- Interrupt Driven I/O basic operation
a. CPU issues read command
b. I/O module gets data from peripheral whilst CPU does other work
c. I/O module interrupts CPU
d. CPU requests data
e. I/O module transfers data
- Interrupt Processing from CPU viewpoint i. Issue read command ii. Do other work iii. Check for interrupt at end of each instruction cycle iv. If interrupted:- a. Save context (registers) b. Process interrupt c. Fetch data & store (a)
- Interrupt Design Issues:
♦ First, because of multiple I/O modules, how does the processor determine which device issued the interrupt? ♦ And second, if multiple interrupts have occurred, how does the processor decide which one to process? ♦ Four general categories of techniques are in common use: a. Multiple interrupt lines b. Software poll c. Daisy chain (hardware poll, vectored) d. Bus arbitration (vectored) a. Multiple interrupt lines:
- Provide multiple interrupt lines between the processor and the I/O modules
- The problem in this technique is even if multiple lines are used, each line will have multiple I/O modules attached to it.
- So any one of the other three techniques are used. b. Software Poll:
- Priority is established by the order of polling the devices (interrupt sources), (i.e)identify the highest-priority source by software means
- One common branch address is used for all interrupts
- Program polls the interrupt sources in sequence
- The highest-priority source is tested first
- Flexible since it is established by software
- Low cost since it needs a very little hardware
- Very slow c. Daisy Chain:
- I/O modules share a common interrupt request line.
- The interrupt acknowledge line is daisy chained through the modules.
- The processor senses an interrupt, it sends out an interrupt acknowledge.
- This signal propagates through a series of I/O modules until it gets to a requesting module.
- The requesting module typically responds by placing a word(vector) on the data lines.
- The processor may also use the vector as a pointer to the appropriate device-service routine. This avoids the need to execute a general interrupt-service routine first. This technique is called a vectored interrupt d. Bus Arbitration (vectored):
- Bus arbitration uses vector technique
- An I/O module must first gain control of the bus before it can raise the interrupt request line.
- So, only one module can raise the line at a time.
- When the processor detects the interrupt, it responds on the interrupt acknowledge line.
- The requesting module then places its vector on the data lines.
✓ Separate I/O bus
- Bus supports all DMA enabled devices
- Each transfer uses bus once – DMA to memory
- Processor suspended once Question: Write a brief note on I/O channel architecture.(5 M)
III.4. I/O Channels and Processors: ♦ The Evolution of the I/O Function
- Processor directly controls peripheral device
- Addition of a controller or I/O module – programmed I/O
- Same as 2 – interrupts added
- I/O module direct access to memory using DMA
- I/O module enhanced to become processor like – I/O channel
- I/O module has local memory of its own – computer like – I/O processor
- More and more the I/O function is performed without processor involvement.
- The processor is increasingly relieved of I/O related tasks – improved performance.
- Characteristics of I/O Channels: ♦ Extension of the DMA concept ♦ Ability to execute I/O instructions – special-purpose processor on I/O channel – complete control over I/O operations
♦ Processor does not execute I/O instructions itself – processor initiates I/O transfer by instructing the I/O channel to execute a program in memory ♦ Program specifies
- Device or devices
- Area or areas of memory
- Priority
- Error condition actions
- Two type of I/O channels: ♦ Selector channel:
- Controls multiple high-speed devices
- Dedicated to the transfer of data with one of the devices
- Each device handled by a controller, or I/O module
- I/O channel controls these I/O controllers
♦ Multiplexor channel:
- Can handle multiple devices at the same time
- Byte multiplexor – used for low-speed devices
- Block multiplexor – interleaves blocks of data from several devices.