edited by
10,092 views
33 votes
33 votes
A hard disk is connected to a $50$ MHz processor through a DMA controller.  Assume that the initial set-up of a DMA transfer takes $1000$ clock cycles for the processor, and assume that the handling of the interrupt at DMA completion requires $500$ clock cycles for the processor. The hard disk has a transfer rate of $2000$ Kbytes/sec and average block transferred is $4$ K bytes.  What fraction of the processor time is consumed by the disk, if the disk is actively transferring $100\%$ of the time?
edited by

4 Answers

Best answer
50 votes
50 votes
$2000$ $KB$ is transferred in $1$ second

 $4$ $KB$ transfer is $(4/2000 ) * 1000 \text{ ms} = 2 \text{ ms}$

Total cycle required for locking and handling of interrupts after DMA transfer control

$=(1000+500) \text{ clock cycle } = 1500 \text{ clock cycle }$

Now, $50$ $Mhz = 50 * 10^6 = 0.02 \text{ microsecond}$

So, $(1500  * 0.02 ) = 30 \text{ microsecond}$

$30 \mu s$ for initialization and termination and $\ 2 ms$ for data transfer.

The CPU time is consumed only for initialization and termination.

Fraction of CPU time consumed $=\dfrac{30\mu s}{(30\mu s+2\,ms)}=0.015$
edited by
3 votes
3 votes
According to me what i figure out is

No of cycle (ticks ) by a processor = 50MHhz= 50 Million = 50 *10^6 cycle in 1 second

The time taken by 1 cycle take 0.2 μsecond

Total cycle required for locking and hadnling of interrupt after DMA transfer control=(1000+500) clock cyle = 1500 clock cycle= (1500*0.2  μsecond) = 300 μsecond

Since 2000K bytes is send in 60*10^3 msec

therefore 4K bytes can be send in (4*60*10^3)/2000= 120msec

Now as i know in 10^3 m sec = 50*10^6 cycles happen

therfore in 120 msec  , no of cycle that will happen is 6*10^6 cycle.

Now since each cycle take 0.2  μsecond

therefore 6*10^6 cycle will take 1.2 second

therfore fraction of cpu time consumed by disk = 300  μsecond / (300  μsecond + 120msec)=2.49 msec
2 votes
2 votes

using DMA for data transfer from a hard disk.
initial DMA setup = 1000 cycles
Interrupt handling on DMA completion = 500 cycles
Average size of data transfer = 4 KB
Each DMA transfer takes (4 KB)/(2000 KB/sec) = 2 X 10-3 seconds
CPU cycles used for DMA transfer = 1000 + 500 = 1500
Total CPU cycles during DMA transfer = (50 X 106) X (2 X 10-3)
= 100 X 103
Fraction of CPU cycles used for DMA = 1500 / 100 X 103
= 1.5 %
 

Answer:

Related questions

30 votes
30 votes
4 answers
2
33 votes
33 votes
6 answers
4