in CO and Architecture edited by
10,938 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
in CO and Architecture edited by
by
10.9k views

5 Answers

12 votes
12 votes
Best answer

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
by

4 Comments

in 833 cycles here have u assumed that during 822 cycles data is getting prepared and hence cpu can work normally and during the last 833rd cycle DMA transfers the character to the memory using the system bus which contributes to cpu slow down??
3
3
hi,can you pls explain

 "But because of DMA last cycle will be utilized by DMA where cpu remains idle. Slowdown = (833−832)833∗100(833−832)833∗100 % = 0.12 %"

how do you know that during 'last cycle" DMA will utilize and CPU will remain idle??

and what is the significance of giving the CPU's instruction fetching rate?

i am not ale to understand these things
1
1
edited by
In 833.33 usec the data will be ready by the Device,so it will transfer in 834th cycle? But you are saying it will taransfer in 833rd cycle?How is this possible when data was prepared in 833.33 cycle.Please help
1
1
How can we assume that in 1 cpu cycle DMA will send only 1 byte, no less no more? Because there are questions where we "assume" 1 word of data being transferred in 1 cycle.And then there are questions where we only take into consideration the interrupt time caused by DMA not the time taken to transfer, but here we are taking time taken to transfer as an overhead where CPU is idle.
0
0
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

4 Comments

intuitive!
0
0
edited by
@sarode knowledge & experience develope intuition!
2
2
cpu slowed down by 0.12% is correct

but, why are you finding DMA overhead for 1200 bytes ?

it should be $1\mu s$ as by default DMA works in cycle stealing mode therefore one cycle time is to transfer 1 byte, and for that DMA overhead is $1\mu s$
0
0
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

by

1 comment

I don't think there'll be units for ratio. but u got (w/s)/(w/s) as seconds.
0
0

Related questions