x= Data preparation time or CPU time and y= Data transfer time
When to use which formula: % of cpu time consume , that depends on the exact wordings in question .
Case 1: In Burst Mode -
In this case we use ( x/x+y )
example : burst mode in both cases
Case 2: In Cycle Stealing Mode -
In this case we use ( x/y )
example - explicitly mention it is in cycle stealing mode
In cycle stealing mode we always follow pipelining concept that means when one byte is getting transferred then at the same time Device is parallel way preparing the next byte.So we use concept of x/y .
And default is burst mode, when no mode mention explicitly , we use Burst mode like 1996 and 2004 Gate questions.
We use cycle stealing formula (x/y) only when the term "cycle stealing" is mention explicitly . In cycle stealing 1 byte data is transferred at a time in theoretically.
Now, coming to x = preparation time, it is given in question,say " 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,"
Clock cycle time = 600 MHz =1/ (600 x 106 ) seconds
total cycle time for processor is (300+900)=1200 and each cycle time is 1/ (600 x 106 ) seconds
So data preparation time = x , which is 1200 * 1/ (600 x 106 ) * 106 microsecs = 2 microsec. This 2 microsec is x .
Now coming to y = data transfer time
here data transfer rate from disk is 10 MB/sec , total data to transfer is 20 KB .
so, Disk Transfer data at a rate of 10 Mbytes/sec
1 byte transfer in 1/107 sec
20 Kbytes transfer in 2 milisec = 2000 micro sec .. this 2000 microsec is data transfer time of y .
now here nothing is mention so we use formula for burst that is x/x+y
so put x and y value and get the answer.
here if cycle stealing mode explicitly mention like " assume disk is using cycle stealing mode" then we should use x/y formula..
hope you get it now .