264 views
A hard disk with a transfer rate of 1 KBps is constantly transferring data to memory using DMA cycle stealing mode. The size of the data transfer is 16 bytes. The processor runs at 400 kHz clock frequency. The DMA controller requires 10 cycles for initialization of operation and transfer takes 2 cycles to transfer one byte of data from the device to the memory. What is the percentage of processor time blocked during this DMA operation?

I am getting transfer time as 480 micro-sec and preparation time as 0.9375 sec

and percentage time CPU gets blocked = transfer time/preparation time (IN case of cycle stealing)

edited | 264 views
+1
I think you are taking transfer time for every Byte ( i.e. 12 cycles x 16 B = 192 cycles and 1 cycle=2.5 microsec so 192*2.5=480 microsec.) as its operating in cycle stealing mode.

But its not always true that a transfer of 1B takes place in cycle stealing. It may also happen that the disk buffer is allowed to get filled by x B amount here 16B and then send it to memory.

Ref: https://gateoverflow.in/116524/coa-dma-doubt?show=131553#c131553

Hence initialization happens for only once and transfer cycles occur for 2*16=32 times.

So time to send initialize DMA and transfer data to memory takes 10+32=42 cycles. So 42*2.5microsec=105microsec=0.105ms

Prep time is 16B*0.001=.016s=16ms.[ Take KB in power of 10 in case of freq/bandwidth cases.]

% CPU blocked=transfer time/prep time = 0.105/16 x100=0.65
0
How do I know that complete buffer size is 16 byte or it is just data amount needed to be transfered!?
0
When any data transfer of xB is given and "cycle stealing" mode is explicitly mentioned, approach the problem like this..

Else if cycle stealing is not mentioned then by default take it as burst mode..

Also if you want you can go through the discussion of the link I attached..it is helpful..
0

But its not always true that a transfer of 1B takes place in cycle stealing. It may also happen that the disk buffer is allowed to get filled by x B amount here 16B and then send it to memory.

won't this be same as Burst mode ?if not then how does this case differ from burst mode?

0

0
For burst mode, % of $CPU-blocked= \frac{Data-Transfer-time}{Data-Transfer-time+Data-Prep-time}$
0

Hope you get some hint from here

0

According tp the solution there, cycle stealing mode is blocking the CPU more than burst mode. Is it true?

@Shaik Masthan Please help..there is a lot of confusion in such problems! Also please check the links I attached..Is my solution matching with the one suggested by Bikram Sir..?

0
@minipanda

need some time to respond on this question
0

@Shaik Masthan

Okay..I have struggled a lot on this topic but there is so much of disparity all over the net!! :(

The link I attached is what I found today which also made me realize that I knew the wrong this before..but again the one attached by gupta is telling something different.

0
i think the link provided by gupta has nice explanation downwards ..