2
$\begingroup$

Q) Consider 1MBps hard-disk is interfaced to the processor in a cycle stealing mode of DMA whenever $64$ bytes of data is available in the buffer,then it is transferred to main memory (1 word = 64 bits) and machine cycle time is 2 micro sec. Then,

1.) Percentage of CPU time consumed for DMA operation is ?
2.) Percentage of CPU time consumed for DMA Operation if burst mode is used?

Given Solution :
1.) For Cycle Stealing Mode
1 word = 64 bits = 8 bytes is transferred in one cycle.
Since total 64 bytes is to be transferred So total number of cycles $= 64/8 =8 $,
1 cycle time = 2µs , So time for 8 cycles is = 16µs
Now time taken by disc to transfer 64 B is $(64)/10^{6}=64µs$
Hence % of CPU Time consumed = Data Preparation Time / Data Transfer time $= (16 / 64)*100\% = 25\%$
My Doubt : How does the above formulae give the % time consumed by CPU or basically where CPU spends time during a DMA transfer and why are we dividing by the disk transfer time.

2.) For Burst Mode : Since all data is transferred at once so only 1 cycle is needed for data transfer i.e. 2 µs So % CPU time consumed = Data Preparation Time / Data transfer Time
=$(2/(2+64))*100\%$ =~ $3\%$
My Doubt : Why are we adding the 2 in burst mode.

$\endgroup$
2
  • $\begingroup$ My knowledge of these topics is only marginal at best, but I would say the 2 is probably just the CPU cycle time. $\endgroup$
    – dkaeae
    Dec 27, 2018 at 10:32
  • $\begingroup$ Yes that is already mentioned in the question. $\endgroup$
    – Sourajit
    Dec 27, 2018 at 12:15

1 Answer 1

0
$\begingroup$

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..

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%

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.