edited by
10,890 views
10 votes
10 votes
A processor is fetching instructions at the rate of 1 MIPS.A DMA module is used to transfer characters to RAM from a device transmitting at 9600 bps.How much time will the processor be slowed down due to DMA activity?

a)9.6 ms

b)4.8 ms

c)2.4 ms

d)1.2 ms
edited by

5 Answers

Best answer
12 votes
12 votes

Given then processor fetches instructions at a rate of 1 MIPS, i.e. 1 instruction per 1 micro second. For simplicity of analysis lets assume clock cycle is also 1 micro second.

Now DMA module transfers at $\frac{9600}{8} = 1200$ bytes = 1200 characters per second. Therefor 1 Byte or 1 character transfers in every 833 micro second.

 So, DMA will invoke in every 833th cycle and transfers a byte.

here $x+1 = 833 \ cycles$ . Without any DMA activity cpu would have been busy all the time (all 833 cycles). But because of DMA last cycle will be utilized by DMA where cpu remains idle. Slowdown = $\frac{(833-832)}{833}*100$ % = 0.12 %

P.S. : Here we have deliberately neglected MEM request invoked itself by CPU or assuming such MEM delay as a part of CPU work. Not contributing to slowdown caused by DMA.

selected by
25 votes
25 votes

If DMA doesn't interrupt CPU, then CPU can fetch 1,000,000 instructions/second.
DMA transfers = 9600bits/sec = 1200 Bytes/sec

DMA will interrupt CPU 1200 times in 1 second. where CPU could fetch 1million instructions in one second now will fetch only 1,000,000-1200 instructions only.


Hence CPU will be slow down by = $\frac{1200*100}{1000,000}$=0.12%
or
Sending 1200 Bytes by DMA will consume 1.2 ms of CPU time, hence CPU will be slow down by 1.2 ms!

edited
2 votes
2 votes
cpu is refers to memory on an average once every 1 micros(1/10^6)

It transferring 9600 bits in 1 second,
1 character takes 833.3 micro seconds

cpu is slowed down by (1/833.3)*100%=0.12%

after that i dont what to do?
2 votes
2 votes

The DMA combines (assembles) one word from one consecutive character (byte) so we get

I am assuming 1word=1 Byte
9600 chars/s = 9600 bytes/s = 1200 words/s = 1200 W/s

If we assume that one CPU instruction is one word wide then
1 million instructions/s = 1 million words/s = 10^6 W/s

So we have 1200 words received during one second and (10^6-1200) words processed by the CPU (while DMA is transferring a word, the CPU cannot fetch the instruction so we have to subtract the number of words transferred by DMA) and we get
(1200 w/s) / (10^6 w/s - 1200 w/s) = 1200 / (10^6 - 1200) = 1200 / 998800 = 0.0012014417...

So Convert 0.0012 this in ms. it will come 1.2 ms

Related questions

18 votes
18 votes
1 answer
2
ankitgupta.1729 asked Jul 29, 2017
8,131 views
Please Explain the formulae for % time of CPU blocked in both Cycle Stealing mode and Burst mode of DMA