Lecture 2.3.4 (Interrupt Driven, DMA)
Lecture 2.3.4 (Interrupt Driven, DMA)
ASSISTANT PROFESSOR
BE-CSE
MODES OF TRANSFER
For input, the device interrupts the CPU when new data has arrived and is
ready to be retrieved by the system processor. The actual actions to perform
depend on whether the device uses I/O ports or memory mapping.
For output, the device delivers an interrupt either
when it is ready to accept new data or to
acknowledge a successful data transfer.
Memory-mapped and DMA-capable devices
usually generate interrupts to tell the system they
are done with the buffer.
Here the CPU works on its given tasks
continuously. When an input is available, such as
when someone types a key on the keyboard, then
the CPU is interrupted from its work to take care
of the input data. The CPU can work continuously
on a task without checking the input devices,
allowing the devices themselves to interrupt it
as necessary.
Basic Operations of Interrupt
2.The device driver signals the I/O controller for the proper
device, which initiates the requested I/O.
Fast
Efficient
The transfer of data between the peripheral and memory without the interaction
of CPU and letting the peripheral device manage the memory bus directly is
termed as Direct Memory Access (DMA).
The two control signals Bus Request and Bus
Grant are used to fascinate the DMA transfer.
The bus request input is used by the DMA
controller to request the CPU for the control of
the buses. When BR signal is high, the CPU
terminates the execution of the current
instructions and then places the address, data,
read and write lines to the high impedance state
and sends the bus grant signal. The DMA CPU bus signal for DMA transfer
controller now takes the control of the buses and
transfers the data directly between memory and
I/O without processor interaction.
When the transfer is completed, the bus request signal is made low by DMA. In
response to which CPU disables the bus grant and again CPU takes the control of
address, data, read and write lines.
The transfer of data between the memory and I/O of course facilitates in two ways
which are DMA Burst and Cycle Stealing.
CPU is usually much faster than I/O (DMA), thus CPU uses the most of the
memory cycles
DMA Controller steals the memory cycles from CPU
For those stolen cycles, CPU remains idle
For those slow CPU, DMA Controller may steal most of the memory cycles
which may cause CPU remain idle long time
DMA CONTROLLER
The DMA controller communicates with the CPU through the data bus and control
lines. DMA select signal is used for selecting the controller, the register select is
for selecting the register.
When the bus grant signal is zero, the CPU communicates through the data bus to
read or write into the DMA register. When bus grant is one, the DMA controller
takes the control of buses and transfers the data between the memory and I/O.
Block diagram of DMA controller
The address register specifies the desired location of the memory which is
incremented after each word is transferred to the memory.
The word count register holds the number of words to be transferred which is
decremented after each transfer until it is zero. When it is zero, it
indicates the end of transfer.
After which the bus grant signal from CPU is made low and CPU returns to its
normal operation. The control register specifies the mode of transfer which is
Read or Write.
DMA TRANSFER
Reference Books:
J.P. Hayes, “Computer Architecture and
Organization”, Third Edition.
Mano, M., “Computer System Architecture”, Third
Edition, Prentice Hall.
Stallings, W., “Computer Organization and Architecture”, Eighth Edition,
Pearson Education.
Text Books:
Carpinelli J.D,” Computer systems organization &Architecture”, Fourth
Edition, Addison Wesley.
http://www.ecs.csun.edu/~cputnam/Comp546/Input-Output-Web.pdf
http://www.ioenotes.edu.np/media/notes/computer-organization-and-architec
ture- coa/Chapter7-Input-Output-Organization.pdf
https://www.geeksforgeeks.org/io-interface-interrupt-dma-mode/
I/O Interface (Interrupt and DMA Mode) - GeeksforGeeks