316 views
1 1 vote

<!--StartFragment -->

A device is constantly transferring the data with 20KBps speed to memory using DMA. Assume that the transmission time to memory from IO once the data (1B) is ready is 5 microsec. Further assume that a file of 5KB needs to be transferred to memory.Find

  1. % of the time CPU is blocked due to DMA in burst mode
  2. % of the time CPU is blocked die to DMA in cycle stealing mode

<!--EndFragment -->

1 Answer

1 1 vote

 

  • Device Data Transfer Speed: $20 \text{ KBps}$ ($20,000 \text{ Bytes/sec}$).

    • This means the device produces 1 Byte of data every:

      $$T_{device} = \frac{1 \text{ second}}{20,000 \text{ Bytes}} = 50 \text{ microseconds} (\mu s)$$

  • Transmission Time (DMA to Memory): $5 \mu s$ per Byte.

    • This is the time the DMA controller needs to use the bus to transfer 1 Byte to memory once it is ready.

  • File Size: $5 \text{ KB}$ ($5,000 \text{ Bytes}$).


1. Cycle Stealing Mode

In Cycle Stealing Mode, the DMA controller transfers data byte-by-byte. It waits for the device to produce a byte, then "steals" a bus cycle to transfer it, and then releases the bus back to the CPU while waiting for the next byte.

  • Operation:

    1. Device takes $50 \mu s$ to prepare 1 Byte.

    2. DMA steals the bus for $5 \mu s$ to write that Byte to memory.

    3. The bus is free for the CPU during the remaining $45 \mu s$ of the cycle.

  • Percentage of Time Blocked:

    The CPU is blocked only when the DMA is using the bus ($5 \mu s$) out of the total time interval per byte ($50 \mu s$).

     

    $$\% \text{ Blocked} = \frac{\text{Time bus is busy}}{\text{Total time per byte}} \times 100$$

    $$\% \text{ Blocked} = \frac{5 \mu s}{50 \mu s} \times 100 = \mathbf{10\%}$$


2. Burst Mode

In Burst Mode, the DMA controller requests the bus and, once granted, holds it until the entire block of data (the file) is transferred. It does not release the bus between bytes.

  • Operation:

    1. The DMA acquires the bus.

    2. It must transfer the $5 \text{ KB}$ file.

    3. Since the device is slow ($20 \text{ KBps}$), the DMA must wait for the device to produce each byte while holding the bus.

    4. It waits $50 \mu s$, transfers (instantaneously in the window), waits $50 \mu s$... effectively blocking the bus for the entire duration determined by the slow device.

  • Percentage of Time Blocked:

    Since the DMA holds the bus for the entire time required to transfer the file at the device's speed, the CPU is blocked for 100% of the transfer duration.

    • Total Transfer Duration = $0.25 \text{ seconds}$.

    • CPU Blocked Duration = $0.25 \text{ seconds}$.

    • Result: 100%

Position:
Show:

Related questions

75 75 votes
4 answers 4 answers
24.4k
24.4k views
go_editor asked Sep 29, 2014
24,430 views
On a non-pipelined sequential processor, a program segment, which is the part of the interrupt service routine, is given to transfer $500$ bytes from an I/O device to mem...
0 0 votes
1 1 answer
608
608 views
N_i_t_i_n asked Sep 13, 2025
608 views
During DMA transfers, the CPU is momentarily halted while the DMA controller takes control of the system busTrue or False?
0 0 votes
1 1 answer
263
263 views
Shubham Sharma 2 asked Sep 9, 2025
263 views
The interface(s) that provide(s) I/O transfer of data directly to and from the memory unit peripheral is/are termed as :DMA (Direct Memory Access)IOP (Input-Output Proces...
3 3 votes
1 1 answer
1.0k
1.0k views
Miracle124 asked Oct 18, 2024
1,005 views
DMA
Consider 4 MBPS IO devices connected to 64 bit CPU using DMA interface. 64 words data is transfer from the IO to memory using DMA interface. Main memory machine cycle tim...