• edited by
17,967 views
47 47 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?

6 Answers

Best answer
67 67 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
5 5 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 %
 

3 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
0 0 votes

The hard disk transfers data at 2000 KB/s, and the average block size is 4 KB.

Therefore, the number of block transfers per second is:

$$
\frac{2000}{4} = 500 \text{ blocks/sec}
$$

For each block transfer, the processor spends:

  • 1000 clock cycles for DMA setup

  • 500 clock cycles for interrupt handling

Hence, total processor overhead per block is:

$$
1000 + 500 = 1500 \text{ cycles}
$$

Since there are 500 block transfers per second, total processor cycles consumed per second are:

$$
500 \times 1500 = 750000 \text{ cycles/sec}
$$

The processor speed is:

$$
50 \text{ MHz} = 50 \times 10^6 \text{ cycles/sec}
$$

Therefore, the fraction of processor time consumed by the disk is:

$$
\frac{750000}{50 \times 10^6}
= 0.015
$$

$$
= 1.5%
$$

Hence, the fraction of processor time consumed is:

$$
\boxed{0.015 \text{ (or } 1.5\%\text{)}}
$$

Answer:
Position:
Show:

Related questions

75 75 votes
4 answers 4 answers
24.6k
24.6k views
go_editor asked Sep 29, 2014
24,558 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...
25 25 votes
3 answers 3 answers
10.2k
10.2k views
Kathleen asked Oct 9, 2014
10,247 views
For the daisy chain scheme of connecting I/O devices, which of the following statements is true?It gives non-uniform priority to various devicesIt gives uniform priority ...
38 38 votes
6 answers 6 answers
16.7k
16.7k views
Kathleen asked Oct 9, 2014
16,697 views
Which of the following is an example of spooled device?A line printer used to print the output of a number of jobsA terminal used to enter input data to a running program...
3 3 votes
2 answers 2 answers
2.7k
2.7k views
Bikram asked Nov 25, 2016
2,664 views
A hard disk is connected to a $2$ GHz processor through a DMA controller which works in burst mode. The initial set up of a DMA transfer takes $1000$ clock cycles for the...