Input Output Organization, Lecture notes of Computer Architecture and Organization

Lecture Notes from Computer Architecture Morris Mano

Typology: Lecture notes

2016/2017

Uploaded on 02/19/2017

ANKIT.GOYAL19
ANKIT.GOYAL19 🇮🇳

3.5

(2)

1 document

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CH-11: INPUT-OUTPUT ORGANIZATION
Peripheral Devices
The input-output subsystem of a computer, referred to as I/O, provides an efficient mode of
communication between the central system and the outside environment.
A computer serves no useful purpose without the ability to receive information from an outside source and
to transmit results in a meaningful form.
The most familiar means of entering information into a computer is through a typewriter like keyboard that
allows a person to enter alphanumeric information directly. Every time a key is depressed, the terminal
sends a binary coded character to the computer.
The fastest possible speed for entering information this way depends on the person’s typing speed. On the
other hand, the central processing unit is an extremely fast device capable of performing operations at very
high speed.
When input information is transferred to the processor via a slow keyboard, the processor will be idle most
of the time while waiting for the information to arrive. To use a computer efficiently, a large amount of
programs and data must be prepared in advance and transmitted into a storage medium such as magnetic
tapes or disks. The information in the disk is then transferred into computer memory at a rapid rate. Results
of programs are also transferred into a high-speed storage, such as disks, from which they can be
transferred later into a printer to provide a printed output of results.
Devices that are under the direct control of the computer are said to be connected on-line. These devices
are designed to read information into or out of the memory unit upon command from the CPU and are
considered to be part of the total computer system.
Input or output devices attached to the computer are also called peripherals.
The input-output organization of a computer is a function of the size of the computer and the devices
connected to it.
ASCII ALPHANUMERIC CHARACTERS
Input and output devices that communicate with people and the computer are usually involved in the
transfer of alphanumeric information to and from the device and the computer is ASCII It uses seven bits
to code 128 characters. The seven bits of the code are designated by b1 through b7 being the most
significant bit. The letter A, for example, is represented in ASCII as 1000001 (column 100, row 0001).
The ASCII code contains 94 characters that can be printed and 34 nonprinting characters used for various
control functions. The printing characters consist of the 26 uppercase letters A through Z, the 26 lowercase
letters, the 10 numerals 0 through 9, and 32 special printable characters such as %, *, and $.
The 34 control characters are designated in the ASCII table with abbreviated names.
The control characters are used for routing data and arranging the printed text into a prescribed format.
There are three types of control characters: format effectors, information separators, and communication
control characters.
Format effectors are characters that control the layout of printing. They include the familiar typewriter
controls, such as backspace (BS), horizontal tabulation (HT), and carriage return (CR). Information
separators are used to separate the data into divisions like paragraphs and pages. They include characters
such as record separator (RS) and file separator (FS).
The communication control characters are useful during the transmission of text between remote terminals.
Examples of communication control characters are STX (start of text) and ETX (end of text), which are
used to frame a text message when transmitted through a communication medium.
INPUT-OUTPUT INTERFACE
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Input Output Organization and more Lecture notes Computer Architecture and Organization in PDF only on Docsity!

CH-11: INPUT-OUTPUT ORGANIZATION

Peripheral Devices

The input-output subsystem of a computer, referred to as I/O, provides an efficient mode of communication between the central system and the outside environment.

A computer serves no useful purpose without the ability to receive information from an outside source and to transmit results in a meaningful form.

The most familiar means of entering information into a computer is through a typewriter like keyboard that allows a person to enter alphanumeric information directly. Every time a key is depressed, the terminal sends a binary coded character to the computer.

The fastest possible speed for entering information this way depends on the person’s typing speed. On the other hand, the central processing unit is an extremely fast device capable of performing operations at very high speed.

When input information is transferred to the processor via a slow keyboard, the processor will be idle most of the time while waiting for the information to arrive. To use a computer efficiently, a large amount of programs and data must be prepared in advance and transmitted into a storage medium such as magnetic tapes or disks. The information in the disk is then transferred into computer memory at a rapid rate. Results of programs are also transferred into a high-speed storage, such as disks, from which they can be transferred later into a printer to provide a printed output of results.

Devices that are under the direct control of the computer are said to be connected on-line. These devices are designed to read information into or out of the memory unit upon command from the CPU and are considered to be part of the total computer system.

Input or output devices attached to the computer are also called peripherals.

The input-output organization of a computer is a function of the size of the computer and the devices connected to it.

ASCII ALPHANUMERIC CHARACTERS

Input and output devices that communicate with people and the computer are usually involved in the transfer of alphanumeric information to and from the device and the computer is ASCII It uses seven bits to code 128 characters. The seven bits of the code are designated by b 1 through b 7 being the most significant bit. The letter A, for example, is represented in ASCII as 1000001 (column 100, row 0001).

The ASCII code contains 94 characters that can be printed and 34 nonprinting characters used for various control functions. The printing characters consist of the 26 uppercase letters A through Z, the 26 lowercase letters, the 10 numerals 0 through 9, and 32 special printable characters such as %, *, and $.

The 34 control characters are designated in the ASCII table with abbreviated names.

The control characters are used for routing data and arranging the printed text into a prescribed format. There are three types of control characters: format effectors, information separators, and communication control characters.

Format effectors are characters that control the layout of printing. They include the familiar typewriter controls, such as backspace (BS), horizontal tabulation (HT), and carriage return (CR). Information separators are used to separate the data into divisions like paragraphs and pages. They include characters such as record separator (RS) and file separator (FS).

The communication control characters are useful during the transmission of text between remote terminals. Examples of communication control characters are STX (start of text) and ETX (end of text), which are used to frame a text message when transmitted through a communication medium.

INPUT-OUTPUT INTERFACE

Input-output interface provides a method for transferring information between internal storage and external I/O devices.

Peripherals connected to a computer need special communication links for interfacing them with the central processing unit.

The purpose of the communication link is to resolve the differences that exist between the central computer and each peripheral. The major differences are:

  1. Peripherals are electromechanical and electromagnetic devices and their manner of operation is different from the operation of the CPU and memory, which are electronic devices. Therefore, a conversion of signal values may be required.
  2. The data transfer rate of peripherals is usually slower than the transfer rate of the CPU, and consequently, a synchronization mechanism may be need.
  3. Data codes and formats in peripherals differ form the word format in the CPU and memory.
  4. The operating modes of peripherals are different from each other and each must be controlled so as not to disturb the operation of other peripherals connected to the CPU.

To resolve these differences, computer systems include special hardware components between the CPU and peripherals to supervise and synchronize all input and output transfers.

These components are called interface units because they interface between the processor bus and the peripheral device. In addition, each device may have its own controller that supervises the operations of the particular mechanism in the peripheral.

I/O BUS AND INTERFACE MODULES

The I/O bus from the processor is attached to all peripheral interfaces. To communicate with a particular device, the processor places a device address on the address lines.

Each interface attached to the I/O bus contains an address decoder that monitors the address lines. When the interface detects its own address, it activates the path between the bus lines and the device that it controls.

At the same time that the address is made available in the address lines, the processor provides a function code in the control lines. The interface selected responds to the function code and proceeds to execute it.

The function code is referred to as an I/O command and is in essence an instruction that is executed in the interface and its attached peripheral unit.

There are four types of commands that an interface may receive. They are classified as control, status, status, data output, and data input.

A control command is issued to activate the peripheral and to inform it what to do.

A status command is used to test various status conditions in the interface and the peripheral.

A data output command causes the interface to respond by transferring data from the bus into one of its registers.

The data input command is the opposite of the data output. In this case the interface receives an item of data from the peripheral and places it in its buffer register. The processor checks if data are available by means of a status command and then issues a data input command.

The interface places the data on the data lines, where they are accepted by the processor.

I/O VERSUS MEMORY BUS

In addition to communicating with I/O, the processor must communicate with the memory unit.

One way of achieving this is by means of a strobe pulse supplied by one of the units to indicate to the other unit when the transfer has to occur.

Another method commonly used is to accompany each data item being transferred with a control signal that indicates the presence ofdata in the bus. The unit receiving the data item responds with another control signal to acknowledge receipt of the data. This type of agreement between two independent units is referred to as handshaking.

STROBE CONTROL

The strobe control method of asynchronous data transfer employs a single control line to time each transfer. The strobe may be activated by either the source or the destination unit.

The data bus carries the binary information from source unit to the destination unit.

The strobe is a single line that informs the destination unit when a valid data word is available in the bus

In this case the destination unit activates the strobe pulse, informing the source to provide the data. The source unit responds by placing the requested binary information on the data bus. The data must be valid and remain in the bus long enough for the destination unit to accept it.

In many computers the strobe pulse is actually controlled by the clock pulses in the CPU.

The CPU is always in control of the buses and informs the external units how to transfer data.

HANDSHAKING

The disadvantage of the strobe method is that the source unit that initiates the transfer has no way of knowing whether the destination unit has actually received the data item that was placed in the bus.

Similarly, a destination unit that initiates the transfer has no way of knowing whether the source unit has actually placed the data on the bus.

The handshake method solves this problem by introducing a second control signal that provides a reply to the unit that initiates the transfer.

The basic principle of the two-write handshaking method of data transfer is as follows:

One control line is in the same direction as the data flow in the bus from the source to the destination. It is used by the source unit to inform the destination unit whether there are valued data in the bus. The other control line is in the other direction from the destination to the source. It is used by the destination unit to inform the source whether it can accept data. The sequence of control during the transfer depends on the unit that initiates the transfer.

The source unit initiates the transfer by placing the data on the bus and enabling its data valid signal. The data accepted signal is activated by the destination unit after it accepts the data from the bus. The source unit then disables its data valid signal, which invalidates the data on the bus. The destination unit then disables its data accepted signal and the system goes into its initial state. The source dies not send the next data item until after the destination unit shows its readiness to accept new data by disabling its data accepted signal.

MODES OF TRANSFER

Data transfer between the central computer and I/O devices may be handled in a variety of modes. Some modes use the CPU as an intermediate path; other 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:

  1. Programmed I/O
  2. Interrupt-initiated I/O
  3. Direct memory access (DMA)

PRIORITY INTERRUPT

Data transfer between the CPU and an I/O device is initiated by the CPU. However, the CPU cannot start the transfer unless the device is ready to communicate with the CPU. The readiness of the device can be determined from an interrupt signal.

The CPU responds to the interrupt request by storing the return address from PC into a memory stack and then the program branches to a service routine that processes the required transfer.

A priority interrupts is a system that establishes a priority over the various sources to determine which condition is to be serviced first when two or more request arrive simultaneously.

The system may also determine which conditions are permitted to interrupt the computer while another interrupt is being serviced.

Higher-priority interrupt levels are assigned to request which, if delayed of interrupted, could have serious consequences. Devices with high-speed transfers such as keyboards receive low priority. When two devices interrupt the computer at the same time, the computer services the devices interrupt the computer at the same time, the computer services the device, with the higher priority first.

Establishing the priority of simultaneous interrupts can be done by software or hardware.

A polling procedure is used to identify the highest-priority source by software means.

In this method there is one common branch address for all interrupts.

The order in which they are tested determines the priority of each interrupt. The highest-priority source is tested first, and if its interrupt signal is on, control branches to a service routine for this source. Otherwise, the next-lower-priority source is tested, and so on.

The disadvantage of the soft ware method is that if there are many interrupts, the time required to poll \them can exceed the time available to service the I/O device. In this situation a hardware priority-interrupt unit can be used to speed up the operation.

A hardware priority-interrupt unit functions as an overall manager in an interrupt system environment.

It accepts interrupt requests from many sources, determines which of the incoming requests has the highest priority, and issues an interrupt request to the computer based on this determination.

no polling is required because all the decisions are established by the hardware priority-interrupt unit. The hardware priority function can be established by either a serial or a parallel connection of interrupt lines. The serial connection is also known as the daisy chaining method.

DAISY-CHAINING PRIORITY

The daisy-chaining method of establishing priority consists of a serial connection of all devices that request an interrupt. The device with the highest priority is placed in the first position, followed by lower- priority devices up to the device with the lowest priority, which is placed last in the chain.

T’lkhis method of connection between three devices and the CPU is shown in Fig. 6-

The interrupt request line is common to all devices and forms a wired logic connection. If any device has its interrupt signal in the low-level state, the interrupt line goes to the low-level state and enables the interrupt input in the CPU.

When no interrupts are pending, the interrupt line stays in the high-level state and no interrupts are recognized by the CPU.

This is equivalent to a negative logic OR operation. The CPU responds to an interrupt request by enabling the interrupt acknowledge line. This signal is received by device 1 at its PI (priority in) input. The acknowledge signal passes on to the next device through the PO (priority out) output only if device 1 is not requesting an interrupt.

If device 1 has a pending interrupt, it blocks the acknowledge signal from the next device by placing a 0 in the PO output. It then proceeds to insert its own interrupt vector address (VAD) into the data bus for the CPU to use during the interrupt cycle.

Figure 6.14 shows the block diagram of a typical DMA controller.

Components of DMA Controller

The unit communicates with the CPU via the data bus and control lines.

The registers in the DMA are selected by the CPU through the address bus by enabling the DS (DMA select) and RS (register select) inputs.

When the BG (bus grant) input is 0, the CPU can communicate with the DMA registers through the data bus to read from or write to the DMA registers.

When BG = 1, the CPU has relinquished the buses and the DMA can communicate directly with the memory by specifying an address in the address bus and activating the RD or WR control.

The DMA controller has three registers: an address register, a word count register, and a control register.

The address register contains an address to specify the desired location in memory.

The word count register is incremented after each word that is transferred to memory. This register is decremented by one after each word transfer and internally tested for zero.

The control register specifies the mode of transfer. All registers in the DMA appear to the CPU as I/O interface registers. Thus the CPU can read from or write into the DMA registers under program control via the data bus.

Functionality of DMA Controller The DMA is first initialized by the CPU. After that, the DMA starts and continues to transfer data between memory and peripheral unit until an entire block is transferred.

The CPU initializes the DMA by sending the following information through the data bus:

  1. The starting address of the memory block where data are available (for read) or where data are to be stored (for write)
  2. The word count, which is the number of words in the memory block
  3. Control to specify the mode of transfer such as read or write
  4. A control to start the DMA transfer

The starting address is stored in the address register. The word count is stored in the word count register, and the control information in the control register. Once the DMA is initialized, the CPU stops communicating with the DMA unless it receives an interrupt signal or if it wants to check how many words have been transferred.

DMA Transfer

  • The CPU communicates with the DMA through the address and data buses
  • The DMA has its own address, which activates the DS and RS lines.
  • The CPU initializes the DMA through the data bus.
  • Once the DMA receives the start control command, it can start the transfer between the peripheral device and the memory
  • When the peripheral device sends a DMA request, the DMA controller activates the BR line, informing the CPU to relinquish the buses.
  • The CPU responds with its BG line, informing the DMA that its buses are disabled.
  • The DMA then puts the current value of its address register into the address bus, initiates the RD or WR signal, and sends a DMA acknowledge to the peripheral device.
  • When BG = 0, the RD and WR are input lines allowing the CPU to communicate with the internal DMA registers.
  • When BG = 1, the RD and WR and output lines from the DMA controller to the random-access memory to specify the read or write operation for the data.
  • When the peripheral device receives a DMA acknowledge, it puts a word in the data us (for write) or receives a word from the data bus (for read).
  • Thus the DMA controls the read or write operations and supplies the address for the memory. The peripheral unit can then communicate with memory through the data bus for direct transfer between the two units while the CPU is momentarily disabled.

DMA transfer in a Computer System