CO Module5 - Solution PDF
CO Module5 - Solution PDF
CO Module5 - Solution PDF
If the registers in the interface (I/O interface) share a common clock with CPU
registers, then transfer between the two units is said to be synchronous. But in
most cases, the internal timing in each unit is independent from each other in
such a way that each uses its own private clock for its internal registers. In that
case, the two units are said to be asynchronous to each other, and if data transfer
occur between them this data transfer is said to be Asynchronous Data
Transfer.
One way is by means of strobe pulse which is supplied by one of the units to
other unit. When transfer has to occur. This method is known as “Strobe
Control”.
Another method commonly used is to accompany each data item being transferred
with a control signal that indicates the presence of data in the bus. The unit
receiving the data item responds with another signal to acknowledge receipt of the
data. This method of data transfer between two independent units is said to be
“Handshaking”.
1.Strobe Control:
The Strobe Control method of asynchronous data transfer employs a single control
line to time each transfer .This control line is also known as strobe and it may be
achieved either by source or destination, depending on which initiate transfer.
The block diagram and timing diagram of strobe initiated by source unit is shown in figure
below:
In block diagram, we see that, the strobe initiated by destination, and as shown in
timing diagram, the destination unit first 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. The falling edge of strobe pulse can be used again to
trigger a destination register. The destination unit then disables the strobe. And source
removes the data from data bus after as per determine time interval.
Now, actually in computer, in the first case means in strobe initiated by source the
strobe may be a memory-write control signal from the CPU to a memory unit. The source,
CPU, places the word on the data bus and informs the memory unit, which is the
destination, that this is a write operation.
And in the second case i.e, in the strobe initiated by destination - the strobe may be
a memory read control from the CPU to a memory unit. The destination, the CPU,
initiates the read operation to inform the memory, which is a source unit, to place
selected word into the data bus.
2, Handshaking:
The disadvantage of strobe method is that source unit that initiates the transfer has no
way of knowing whether the destination has actually received the data 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 data on the bus.
Hand shaking method introduces a second control signal line that provides a replay to
the unit that initiates the transfer.
In it, one control line is in the same direction as the data flow in the bus from the source
to destination. It is used by source unit to inform the destination unit whether there are
valid data in the bus. The other control line is in the other direction from destination to
the source. It is used by the destination unit to inform the source whether it can accept
data. And in it also, sequence of control depends on unit that initiate transfer. Means
sequence of control depends whether transfer is initiated by source and destination.
Sequences of control in both of them are described below:
The source initiated transfer using handshaking lines is shown in figure below:
In its block diagram, we see that 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 timing relationship of exchange of signals between the
two units. Means as shown in its timing diagram, the source initiates a transfer by
placing data on the bus and enabling its data valid signal. The data accepted signal is
then activated by 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. After this, the
destination unit disables its data accepted signal and the system goes into initial state.
The source unit does not send the next data item until after the destination unit shows
its readiness to accept new data by disabling the data accepted signal.
This sequence of events described in its sequence diagram, which shows the above
sequence in which the system is present, at any given time.
The destination initiated transfer using handshaking lines is shown in figure below:
In its block diagram, we see that the two handshaking lines are "data valid", generated
by the source unit, and "ready for data" generated by destination unit. Note that the
name of signal data accepted generated by destination unit has been changed to ready
for data to reflect its new meaning.
In it, transfer is initiated by destination, so source unit does not place data on data bus
until it receives ready for data signal from destination unit. After that, hand shaking
process is some as that of source initiated.
The sequences of event in it are shown in its sequence diagram and timing relationship
between signals is shown in its timing diagram.
Thus, here we can say that, sequence of events in both cases would be identical. If we
consider ready for data signal as the complement of data accept. Means, the only
difference between source and destination initiated transfer is in their choice of initial
state.
DMA controller - Interface which allows I/O transfer directly between Memory and
Device, freeing CPU for other tasks
CPU initializes DMA Controller by sending memory address and the block size
(number of words).
1. The staring 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. The starting address is stored in the address register.
• The interrupt request line is common to all devices having wired logical connection
• When device has interrupt signal in the low-level state 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.
• A device with a 0 in its PI input generates a 0 in its PO output to inform the next-lower-
priority device that the acknowledgement signal has been blocked.
• A device that is requesting an interrupt has a 1 in its PI input will intercept the ack signal
by placing a 0 in its PO output.
• If the device does not have pending interrupts, it transmits the ack signal to the next
device by placing a 1 in its PO output.
Q.32 How main memory is useful in computer system? Explain the memory address map of
RAM and ROM.
Ans. Main Memory
The main memory is the central storage unit in a computer system.
Primary memory holds only those data and instructions on which computer is
currently working.
It has limited capacity and data is lost when power is switched off.
It is generally made up of semiconductor device.
These memories are not as fast as registers.
The data and instruction required to be processed reside in main memory.
It is divided into two subcategories RAM and ROM.
The designer of a computer system must calculate the amount of memory required
for the particular application and assign it to either RAM or ROM.
The interconnection between memory and processor is then established from
knowledge of the size of memory needed and the type of RAM and ROM chips
available.
The addressing of memory can be established by means of a table that specifies the
memory address assigned to each chip.
The table, called a memory address map, is a pictorial representation of assigned
address space for each chip in the system, shown in table.
To demonstrate with a particular example, assume that a computer system needs
512 bytes of RAM and 512 bytes of ROM.
The RAM and ROM chips to be used are specified in figure 1 and figure 2.
Table : Memory Address Map for Micro-computer
Q.33 Discuss associative mapping and direct mapping in organization of cache memory.
ANS
Q.34 Write a short note on associative memory.
ANS
A 101 111100
K 111 000000
WORD1 100 111100 NO MATCH
WORD2 101 000001 MATCH