The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
137 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)
in CO and Architecture by Active (3.1k points)
edited by | 137 views
0
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

@MiNiPanda 

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

@Gupta731 Will you please help me figure out this problem?

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

https://gatestack.in/t/made-easytest-series/727

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.

Please log in or register to answer this question.

Related questions

+6 votes
3 answers
1
0 votes
0 answers
3
0 votes
1 answer
4
0 votes
1 answer
7
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,093 questions
55,333 answers
190,852 comments
86,257 users