edited by
3,973 views
12 votes
12 votes
Consider $1 \text{ MBPS}$ hard disk is interfaced to the processor in a cycle stealing mode of $\text{DMA}$ whenever $64$ bytes of the data is available in the buffer then it is transferred to the main memory. Processor word length is $64$ bits. Machine cycle time is $2\: \mu\text{sec}$. Percentage of $\text{CPU}$ time is consumed for the $\text{DMA}$ operation is ________ (in $\%$).
edited by

4 Answers

Best answer
14 votes
14 votes

It is cycle stealing mode, we assume with the formula x/y 

Data is transferred word by word from DMA to memory .

Here total data size in Buffer is 64 Bytes .  And 1 word = 64 bits is given , 64 bits = 8 Bytes 

so for 64 B data we need to transfer 8 words means 8 times bus access is require by DMA. [  word size is 64 bit which is 8 byte hence to transfer 64 byte from CPU to MM, DMA has to steal the bus 8 times according to question because here in one time 8 byte will be transferred instead of 1 byte ]

each cycle time is 2  micro second, to transfer 64 Bytes it takes  8 * 2 =16 micro seconds

so Data preparation time is 16 microseconds .

Disk is sending 10 6 in 1sec 

so 1 byte is sent in 1 microsec 

for 64 byte it will be 64 microsec

it is cycle stealing so total time is 64 ms only as overlapping is happening ..

CPU efficiency = (16/64 ) * 100  = 25 %

so 25% of cpu time is consumed due to DMA activity .

selected by
7 votes
7 votes
Lets calculate the processor speed.

It can transfer 64 bits in 2 microsec or 4MBps.

Speed at which the buffer of the device is filled = 1MBps.

Now, lets assume time slot of 1 sec.

In that 1 sec, if I dont transfer 1MB that accumulated in device buffer , it will spill.   So, in 1 sec, I need to transfer 1MB to RAM at speed of bus i.e at 4MBps. That comes out as 0.25 sec.

Now, I steal 0.25 sec out of 1 sec   which 25%.

Hence, processor is blocked for 25%
2 votes
2 votes
answer will be 20%

here buffer size is 64 byte so we have 64 bytes of data in buffer

but word size is 64bit which is 8 byte hence to transfer 64 byte from CPU to MM, DMA has to steal the bus 8 times a/c to ques because here in one time 8 byte will be transfered instead of 1 byte

bo total cycle overhead = 8 *2 = 16 microsec

Disk is sending 10^ 6 in 1sec

so 1 byte is sent in 1 microsec

for 64 byte it will be 64 microsec

Total Time = 64+16

               =80 microsec

now CPU efficiency = (16/80)*100

                               =20%
0 votes
0 votes
1 word=64 bit=8 B

64 B=8 word

machine cycle time=2 microseconds => 1 word is transferred from io buffer to memory by cpu in 2 microseconds => data preparation time by cpu 64 B data and io bandwidth is 1MBps

so 64/10^6 seconds = 64 microseconds = transfer time by io device = time to dump data from io device to io buffer

now in cycle stealing mode generally data is transferred byte wise..but here word size is given so we assume data is transferred word wise..which is actually reasonable because IF ARCHITECTURE IS WORD ADDRESSABLE WITH 1 WORD = 8 B then naturally cycle stealing mode has to follow it...

64B data in 64 microseconds

=> 8 word data in 64 microseconds

=> 1 word data in 8 microseconds = this is word transfer time by io to buffer

so % cpu blocked= % cpu time consumed = % time CPU is actually transferring data from io buffer to main memory= (2/8)*100%=25%

in burst mode its ( 2 / (2+8) )*100%=20%>>>>>>>

in burst mode all data is transferred once as a block...so we wait for io to dump all of 64 B data in its buffer which is 64 microseconds

now cpu will fully transfer this data from io buffer to main memory..64 B data meaning 8 word data meaning 8*2 microseconds meaning 16 microseconds..

so 16*100/(16+64) % = 2*100/(2+8) = 20%
Answer:

Related questions

1 votes
1 votes
2 answers
1
sidsunny asked Jan 26, 2017
823 views
I have gone through these types of questions but I'm unable to understand. how to appraoch these questions? And during the dma transfer, cpu is considered to be idle. bef...
1 votes
1 votes
1 answer
4