in CO and Architecture edited by
1,450 views
5 votes
5 votes
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 edited by
1.5k views

4 Comments

@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
0
i think the link provided by gupta has nice explanation downwards ..
0
0
IT IS ACTUALLY

 

0.105/15.625

WHICH IS 0.672
0
0

1 Answer

2 votes
2 votes
Transfer rate is 1KBps , So  1KB----------1 s  (second)

                                             1 Byte-------1/1000 s

                                             16 Bytes-----16/1000 = 16ms

Also ,it is given that 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.

Therefore , to transfer 16 bytes cycles needed = 16*2=32 cycles , So total cycles needed is 32+10 = 42 cycles

Transfer Time = 42 * 1/400000 = 42/400 ms = 0.105 ms

Now , %age of CPU blocked state is (Transfer time/Preparation time) *100 = 0.105 / 16 *100 = 0.65

4 Comments

Therefore , to transfer 16 bytes cycles needed = 16*2=32 cycles , So total cycles needed is 32+10 = 42 cycles

@Sanandan Are all 16 bytes transferred at once? considering the fact that DMA is using cyle stealing.


In the question, it is mentioned “ 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.”  So if I read this specific part of the question as – a 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, then will it not be feasible with the concept of DMA cycle stealing as mentioned in this Direct memory Access pdf?.

If read like this then the calculation will be like 10+2 = 12 cycle for 1 byte, CPU will only be blocked during transfer time i.e. for 1 byte of data being transferred CPU will be blocked and it will take (12 * 2.5) micro-second = 30 micro-second.

(cycle time = 2.5 micro-second, As device transfer rate is 1KBps so 1 byte = 1000 mico-second and for 16 byte data preparation time is =  16 * 1000 micro-second = 16000 micro-second.

So percentage of processor time blocked during this DMA operation = (30/16000) * 100 = 0.1875.


But its not always true that a transfer of 1B takes place in cycle stealing.

@MiNiPanda you are right, In this → Question transfer of 8 bytes takes place but here is the catch, in this Question it has been mentioned that 1 word = 8 bytes(or 64 bit), so in the case of the current question, should we assume that 16 bytes = 1 word?. 

In this question, it has also not been said that in cycle stealing mode whenever 16 bytes of data are available in the buffer it will be transferred to the main memory, unlike this Question 

Seems the question is badly framed.

@Bikram 1 sir or anyone, please help with this question, what is the correct answer and correct way to understand.

0
0

@Shubham Sharma 2 You’re correct. For COA it is a waste of time reading ME questions. Why don’t we see such questions from standard books? From standard books, sometimes questions come as such for GATE too.

0
0
reshown by

Hence initialization happens for only once

As @MiNiPanda said above “Hence initialization happens for only once, is not correct. In cycle stealing mode, Initialization does happen for every byte/word sent.

Rightly said @Arjun sir, we should see such questions from standard books. Is it possible to have a separate section of top-wise and subject-wise questions from selected standard books on GO?.

0
0

There’s this PDF of standard book questions: https://github.com/GATEOverflow/GO-PDFs/releases/tag/initial-draft

It has almost all the subjects covered, but unfortunately COA is missing because it is not yet on GO site. Will start adding them soon.

1
1

Related questions