Bcs302 Unit 5 (Part II)
Bcs302 Unit 5 (Part II)
The device transfers bytes of data one at a time as they are available then the device places it in the I/O bus and enables its
data valid line. The interface accepts the byte into its data register and enables the data accepted line.
The interface sets a bit in the status register as a "flag" bit (F). The device can now disable data valid line, but it will not
transfer another byte until data accepted line is disabled by the interface.
2. Interrupt-initiated I/O
We can improve the efficiency of CPU by using an interrupt facility and special commands to inform the interface to issue an
interrupt request signal when the data are available from the device.
In the meantime the CPU can proceed to execute another program. The interface meanwhile keeps monitoring the device.
When the interface determines that the device is ready for data transfer, it generates an interrupt request to the CPU.
Upon detecting the external interrupt signal, the CPU momentarily stops the task it is processing, branches to a
service program to process the I/O transfer, and then returns to the task it was originally performing.
In DMA bus transfer, a block sequence consisting of a number of memory words is transferred in a continuous burst while the
DMA controller is master of the memory buses. E.g. transfer needed for magnetic disks.
Cycle stealing
An alternative technique called cycle stealing allows the DMA controller to transfer one data word at a time, after which it must
return control of the buses to the CPU. The CPU merely delays its operation for one memory cycle to allow the direct
memory I/O transfer to “steal” one memory cycle.
DMA Controller
Following *MM Fig 11-17 shows the block diagram of a typical DMA controller. 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 BG = 0, the CPU can communicate with the DMA registers through the data bus.
When BG = 1, the CPU has relinquished the buses and the DMA can communicate directly with the memory by
specifying an address and activating the RD or WR control.
In addition to the usual circuits of an interface unit, it needs an address register, a set of address lines (both for direct
communication with the memory) and a word count register (to specify number of words to be transferred).
The control register specifies the mode of transfer.
The DMA communicates with the external peripheral through the request and acknowledgement lines.
Compiled by- Durgesh Pandey (CSED)
PSIT, Kanpur
The CPU initializes the DMA by sending the following information through the data bus:
1. The starting address of the memory block for read or for write
2. The word count (number of words in the memory block)
3. Control to specify the mode of transfer (read or write)
4. A control to start the DMA transfer
DMA Transfer
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.
Then DMA puts its current value of address register into the address bus.
Since RD and WR lines are bidirectional, the direction of transfer depends on the status of the BG line i.e.
When BG = 0, the RD and WR lines are input lines allowing the CPU to communicate with the internal DMA
registers.
When BG = 1, the RD and WR lines are output lines from the DMA controller to the random access memory.
Compiled by- Durgesh Pandey (CSED)
PSIT, Kanpur
When the peripheral device receives a DMA acknowledge, it puts a word in the data bus (for write) or receives a word
from the data bus (for read).
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.
The CPU is responsible for processing data whereas IOP provides a path for transfer of data between various
peripheral devices and memory unit.
In most computer systems, the CPU is the master while the IOP is a slave processor. The CPU is assigned the task of
initiating all operations, but I/O instructions are executed in the IOP.
CPU instructions provide operations to start an I/O transfer and also to test I/O status conditions needed for making decisions
on various I/O activities. The IOP, in turn, typically asks for CPU attention by means of an interrupt.
Compiled by- Durgesh Pandey (CSED)
PSIT, Kanpur
Data Transmission
The transfer of data between two units may be done in parallel or serial.
In parallel data transmission, each bit of the message has its own path and the total message is transmitted at the same
time. This means that an n-bit message must be transmitted through n separate conductor paths.
In serial data transmission, each bit in the message is sent in sequence one at a time.
Serial Communication
A data communication processor communicates with each terminal through a single pair of wires for transferring data and
control information. Transferring information from sender to receiver one bit at a time is known as serial communication.
The incoming data word is stored in the buffer on the sender side then it is bit-wise taken and sent through a single
communication channel in a serial manner.
On the receiver end, again there is a buffer to store the incoming bits and so on.
Advantage- Only single communication line required for transferring any number of bits of data word
Disadvantage- The speed of data transfer is decreased.
In order to work efficiently with serial devices, the clock is the primary source. The clock signal for each serial device is different
and it is categorized as synchronous transmission and asynchronous transmission.
Synchronous transmission
In synchronous transmission, the sender and receiver share a common clock frequency and bits are transmitted
continuously at the rate dictated by the clock pulses.
Data is sent in the form of blocks or frames. There is no gap present between data. It is more efficient and more reliable
than asynchronous transmission to transfer a large amount of data.
Synchronization signals are transmitted periodically between the two units to keep their clocks in step with each other.
Asynchronous transmission
In asynchronous transmission, binary information is sent only when it is available and the line remains idle when there
is no information to be transmitted.
The technique (used in many interactive terminals) employs special bits that are inserted at both ends of the character code.
With this technique, each character consists of three parts: a start bit, the character bits, and stop bits.
The convention is that the transmitter rests at the 1-state when no characters are transmitted. The first bit, called the
start bit, is always a 0 and is used to indicate the beginning of a character. The last bit called the stop bit is always a 1.
As an illustration, consider the serial transmission of a terminal whose transfer rate is 10 characters per second. Each transmitted
character consists of a start bit, eight information bits, and two stop bits, for a total of 11 bits.
Baud Rate
The baud rate is defined as the rate at which serial information is transmitted and is equivalent to the data transfer in bits per
second. E.g. Ten characters per second with an 11-bit format, has a transfer rate of 110 baud.
1. Strobe Control
2. Handshaking
1. 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.
As shown in the timing diagram of *MM Fig. 11-3(b), the source unit first places the data on the data bus. After a brief delay to
ensure that the data settle to a steady value, the source activates the strobe pulse. The information on the data bus and the
strobe signal remain in the active state for a sufficient time period to allow the destination unit to receive the data.
*MM Fig 11-4 shows a destination initiated transfer i.e. data transfer initiated by the destination unit.
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.
Compiled by- Durgesh Pandey (CSED)
PSIT, Kanpur
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.
2. Handshaking
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-wire handshaking method of data transfer is as follows:
i. Source initiated handshaking
ii. Destination initiated handshaking
Figure 11-5 shows the source initiated handshaking data transfer procedure when initiated by the source. The two handshaking
lines are data valid, which is generated by the source unit, and data accepted, generated by the destination unit. The timing
diagram shows the exchange of signals between the two units.
The destination-initiated transfer using handshaking lines is shown in *MM Fig. 11-6. Note that the name of the signal
generated by the destination unit has been changed to ready for data to reflect its new meaning.
The source unit in this case does not place data on the bus until after it receives the ready for data signal from the destination unit.
From there on, the handshaking procedure follows the same pattern as in the source-initiated case.
The handshaking scheme provides a high degree of flexibility and reliability because the successful completion of a data
transfer relies on active participation by both units. If one unit is faulty, the data transfer will not be completed.
NOTE: The CPU communicates directly with the channels through dedicated control lines and indirectly through reserved storage
areas in memory.
Bluetooth - (a short-range wireless technology standard that is used for exchanging data between fixed
and mobile devices over short distances)
RS-232 - (standard communication protocol for connecting computers and their peripheral devices to
enable serial data exchange)
RS422 - (a simplex multi-drop standard, which means only one driver and up to ten receivers can be
attached to a bus)
USB - (Universal Serial Bus is an industry standard that establishes specifications for cables, connectors
and protocols for connection, communication and power supply between computers, peripherals and other
computers)
Ethernet - (Ethernet is a family of wired computer networking technologies commonly used in LANs,
MANs and WANs. It was commercially introduced in 1980 and first standardized in 1983 as IEEE 802.3).
~~~~~~*****{Ӂ۞Ӂ}*****~~~~~~
Compiled by- Durgesh Pandey (CSED)