retagged by
1,042 views
3 votes
3 votes
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 processor and DMA completion requires $700$ clock cycles.

The hard disk has a transfer rate of $4000$ KB / sec and the average block size transferred is $16$ KB. Then, the fraction of CPU time free if the disk is transferring data is  _______%.
retagged by

2 Answers

Best answer
3 votes
3 votes

Total cycle required for initial set up of a DMA transfer and DMA completion

= (1000 + 700 ) clock cycles

=1700 clock cycles

Given clock rate= 2 GHz. So, clock cycle time=(1/clock rate)= (1/2 GHz) = (1/ 2*109 ) * 109 ns = 0.5 ns

No of cycles for Initialization and Completion of the block transfer is 1700 cycles,

so total time takes by processor =1700*0.5 ns=850 ns . let X = 850 ns , this is preparation time or total clock cycle time use by cpu .

Disk transfer rate is 4000 KB/sec. So, to transfer 16 KB, the time required is ( 16/4000 ) sec=4000000 ns.

Let  Y= 40,00000 ns , this is transfer time.

% of time processor "involved" is = X/(X+Y) * 100

= {850/(850+4000000)} * 100 [ as question explicitly says it is burst mode, so we use this formula x/x+y where x =clock cycle time use by cpu   and y = Transfer time ]
=0.02124 %

[ In burst mode all data is transferred in a single cycle . so we need to consider x+y in this formula x/x+y ]

Therefore, % of processor time is free= 100 - % of processor time involved
=(100- 0.02124) 

=99.97876 

=99.978

selected by
2 votes
2 votes
DMA initiation (taking the bus control) = $1000 cc = 500ns$

DMA completion (handling the bus control back) = $700 cc = 350 ns$

 

Time required for transferring a block of 16KB with 4000 KB/s speed = $16/4000=0.004seconds$

 

CPU time consumed would be just for setting up and handling the DMA = $500ns + 350ns = 850ns$

Total time would be = $850ns + 0.004s = 0.004s$ (approx)

 

So, CPU time consumed = $850ns/0.004s = 0.02\%$

=> %CPU time not consumed = $100-0.02=99.8\%$ (approx)
Answer:

Related questions

0 votes
0 votes
2 answers
1
1 votes
1 votes
3 answers
2