82 82 votes A hard disk with a transfer rate of $10$ Mbytes/second is constantly transferring data to memory using DMA. The processor runs at $600$ MHz, and takes $300$ and $900$ clock cycles to initiate and complete DMA transfer respectively. If the size of the transfer is $20$ Kbytes, what is the percentage of processor time consumed for the transfer operation? $5.0 \%$ $1.0\%$ $0.5\%$ $0.1\%$ CO & Architecture gatecse-2004 dma normal co-and-architecture + – Kathleen 42.0k views answer comment Share Follow Print See all 10 Comments 10 10 Comments reply Show 7 previous comments goku4199 commented Oct 14, 2025 reply Follow flag Ans 1 1 replyShare divy.sisodia commented Jan 16 reply Follow flag The first 300 cycles spent by the $CPU is for the DMA register initialization(source address, destination address, count register, and mode register). The 900 cycles needed by the CPU at the end/completion of the data transfer are spent in servicing the ISR for the interrupt raised by the DMA after completion. 0 0 replyShare Anmol Chaurasia commented Apr 27 reply Follow flag @goku4199 in dma questions hard disk data transfer rate is given, so i have a doubt that , Is this the time for hard disk to I/O controller transfer or i/o controller to mm transfer 0 0 replyShare Please log in or register to add a comment.
Best answer 118 118 votes Clock cycle time = $\frac{1}{600 \times 10^6}$ [ Frequency = 1/Time] For DMA initiation and completion = $\frac{(900+300)}{600\times10^6} = 2$ microsec . Disk Transfer rate $= 10$ Mbytes/sec $1$ byte $= \frac{1}{10^7}$ sec $20$ Kbytes $= 2$ milisec $= 2000$ micro sec Percentage $= \left (\frac{2}{2+2000} \right )\times100 =0.0999 ≃ 0.1\%$ option (D) $\%$ of CPU time consumed $=\frac{x}{x+y}$ If $x$ is the Data preparation time or Total cycle time used by CPU and $y$ is the Data transfer time, to calculate the fraction of CPU time to the data transfer time - we use $\frac{x}{x+y}$ in burst mode. Prashant. answered Nov 23, 2015 • edited Jul 5, 2022 by Arjun Prashant. comment Share Follow See all 30 Comments 30 30 Comments reply Show 27 previous comments saurabh0709 commented Sep 8, 2023 reply Follow flag When the data is being prepared in the burst mode, the CPU is blocked. So, how CPU is busy for the data preparation time x. Someone please clear my doubt. 1 1 replyShare rhl commented Nov 27, 2024 reply Follow flag @saurabh0709 CPU is involved in 2 stages here for Initialisation of the DMA and Handling interrupt after the Data transfer is complete. In between these 2 stages the CPU is idel and DMAC is in control of system bus. For more clarity please go through this lecture https://youtu.be/v3qnkhEu72s?si=alk-tkQH4wUgzVp-&t=5836 2 2 replyShare kabir123 commented Jan 6 reply Follow flag thanks bro for youtube link !! 0 0 replyShare Please log in or register to add a comment.
18 18 votes Clock cycle time = (1/600) x 10 ^6 For DMA initiation and competion = (900+300)/(600 x 10 ^6) = 2 microsec . Disk Transfer rate = 10 M bytes. 1 byte = 1/10^7 sec 20 K bytes = 2000 microsec Percentage = (2/2000)*100 =0.1% so, ans D . Pranay Datta 1 answered Aug 20, 2015 Pranay Datta 1 comment Share Follow See all 3 Comments 3 3 Comments reply Himanshu1 commented Nov 23, 2015 reply Follow flag How is it 2/2000 ?? 0 0 replyShare P0535_Yedidyah_Sagar commented Mar 23 reply Follow flag @Himanshu1Because, "Hard disk is "constantly" transferring data to memory using DMA.This means, Hard disk uses some sort of buffer.The formula for this type of questions is x/y and not x/x+y.Tag me, if you feel my perspective is wrong. 0 0 replyShare EagerLearner commented Sep 5 reply Follow flag P0535_Yedidyah_SagarIt is x/x+y here just because we are finding the CPU time taken which isx = CPU time spent during DMA (Initialization and Final stage) / Total time spent during the complete DMA process (i.e y= Data transfer time for 20KB + x=CPU time)i.e x/x+y *100 gives you the percentage of time spent by Processor during data transfer 0 0 replyShare Please log in or register to add a comment.
10 10 votes Data transfer time= initialization time + DMA transfer time =300+900=1200 cycles Data preparation time = time disk is taking to transfer 20KB to DMA = (20KB)/(10MBps) = 2msec or 1200000 cycles thus CPU time consumed = (transfer time)/(prepartion time + transfer time) = [1200/(1200000+1200)] * 100 =0.0999 = 0.1% AakS answered Jan 27, 2018 AakS comment Share Follow 0 reply Please log in or register to add a comment.
9 9 votes It is simple logical question. No need of so many calculations. The answer is simply (20KB/10MB)x100 = (20KB/10x1024KB)x100 = 0.1% The reason for this is whatever may be the processor speed and clock cycle . While taking percentage ratio they will get cancel led out. kanha95 answered May 30, 2017 kanha95 comment Share Follow 0 reply Please log in or register to add a comment.
9 9 votes Processor Speed = 600MHZ = $6*10^{8}$ cycles/second Transfer time = $\frac{20KB}{10MB}$ = 2ms = $12*10^{5}$ cycles Total cycles consumed = 1200,000 + 300 + 900 = 120,1200 cycles % of processor time consumed = $\frac{120,1200*100}{6*10^{8}} = \frac{12012}{60000}$= 0.2% So, (D) can be chosen as option! Manu Thakur answered Aug 11, 2017 • edited Aug 11, 2017 2 flags: ✌ Edit necessary (Girish Chougule)✌ Low quality (Navjeet singh saheb) Manu Thakur comment Share Follow See all 2 Comments 2 2 Comments reply joshi_nitish commented Aug 11, 2017 reply Follow flag @manu00x how you are getting 0.2? i am getting 0.1022 %(approx) 1 1 replyShare Manu Thakur commented Aug 11, 2017 reply Follow flag how?? what will be 12012/60000 = ? 0 0 replyShare Please log in or register to add a comment.
5 5 votes Transfer rate=10 MB per second Data=20 KB=20* 2 10 So Time=(20 * 2 10)/(10 * 2 20)= 2* 10-3 =2 ms Processor speed= 600 MHz=600 Cycles/sec Cycles required by CPU=300+900 =1200 For DMA=1200 So time=1200/(600 *10 6)=.002 ms In %=.002/2*100=.1% So (D) is correct option Paras Nath answered Nov 8, 2017 Paras Nath comment Share Follow See 1 comment 1 1 comment reply chauhansunil20th commented Nov 22, 2018 reply Follow flag what kind of logic is this, first converted into millisecond and converted it into %?? 0 0 replyShare Please log in or register to add a comment.