in CO and Architecture recategorized by
21,441 views
49 votes
49 votes

A hard disk with a transfer rate of $10$ Mbytes/second is constantly transferring data to memory using DMA. The processor runs at $600$ MHz, and takes $300$ and $900$ clock cycles to initiate and complete DMA transfer respectively. If the size of the transfer is $20$ Kbytes, what is the percentage of processor time consumed for the transfer operation?

  1. $5.0 \%$
  2. $1.0\%$
  3. $0.5\%$
  4. $0.1\%$
in CO and Architecture recategorized by
21.4k views

4 Comments

@Manisha Jaishwal, it’s not like “2000 / (2+2000)” simply because 2000 is the data preparation time i.e. the time disk is taking to transfer 20KB to DMA, and during this time CPU won’t sit idle. CPU will be idle during the data transfer from DMA to Main memory. With regards to this particular question, whatever the data that disk wants to send to memory, it needs to be transferred to DMA first. And if you are considering the formula given in the best answer below then the calculation will be like “2 / (2+2000)”.

1
1

@Shubham Sharma 2 .

I think Data buss buffer in DMA[I am talking about single bus Architecture] is only for interacting with Registers in DMA that means writing and reading from/to DMA register ... Here we no need to send Data to DMA Buffer ,Here every I/O device has their individual buffer .. so data transfer happens only between I/0 to I/o buffer and then to Main memory , no need to involve DMA Buffer ... 

 

0
0

@RamaSivaSubrahmanyam

Although it looks like in my comment I am saying for data to be gathered in a DMA buffer, actually, it isn’t that. And that’s why I used the word ‘DMA’ and not ‘DMA buffer’. And you are right, data will be sent to memory only from i/o devices but using a "DMA module’.

The disk controller buffer has the data and as soon as DMA requests transfer to memory, the data is transferred. So upon the request of DMA to transfer data to memory, data is transferred. So from this statement, it might feel like DMA is storing the data, but actually, the data is present in the buffer of the disk controller and not in the data register of the DMA controller.

REF. → Direct Memory Access

Thanks for mentioning me in your comment; it helped me to revisit the topic.

 

0
0

10 Answers

0 votes
0 votes

 

For those who have difficulty in conversion of units like me, this can be the solution in terms of nanoseconds. 

0 votes
0 votes
$Percentage\ of\ CPU\ time\ consumed,P = \frac{No.\ of\ CPU\ cycles\ required\ by\ DMA\ per\ second}{No.\ of\ CPU\ cycles\ available\ per\ second}$

$No.\ of\ DMA \ transfer\ requests/sec = \frac{Data\ transfer\ rate\ of\ IO\ device }{Size\ of\ one\ transfer}$

                                                                              $=\frac{10MB/s}{20KB} =\frac{10*10^3}{20}= 500s^{-1}$

$No.\ of\ CPU\ cycles\ required\ by\ DMA\ per\ second$

$ = (no.\ of\ DMA\ transfer\ requests/sec)\ *\ (CPU\ cycles\ required/transfer)$

$=500 * (300+900) = 500 * 1200 = 6*10^5s^{-1}$

$No.\ of\ CPU\ cycles\ available\ per\ second = 600 * 10 ^6=6*10^8s^{-1}$

$P = \frac{6*10^5}{6*10^8}*100\%=0.1\%$

Answer : D
Answer:

Related questions