in CO and Architecture retagged by
2,854 views
2 votes
2 votes

A hard disk with transfer rate of 20 kbps is constantly transferring data to memory using DMA cycle stealing mode. The size of data transfer is 32 bytes. The processor runs at 800 kHz clock frequency. The DMA controller requires 12 cycles for initialization of operation and transfer takes 4 cycles to transfer 2 byte of data from device to the memory. Then the transfer time for transfer time ______(μs)

My question is : as it is cycle stealing mode and 2 Byte of data transferred at every 4 cycles. So , after every 2 Byte data sent , DMA will give the control back to processor , is it correct ? So , will it not take 32/2 = 16 times to transfer the 32 B

The answer given as ::

    in CO and Architecture retagged by
    2.9k views

    4 Answers

    1 vote
    1 vote
    This  Solution is wrong .As units are mismatched here
    0 votes
    0 votes
    Takin $20kbps$ as $20KBps$

    as it is cycle stealing mode so disk will interrupt the processor for every single Byte.

    Data preparation time: $\frac{1}{20}=0.05ms$

    Data transfer time for each Byte:$\frac{2+12}{800}=0.03ms$

    using concept of pipelining, when data is transfering during $0.03ms$ then simultaneously data is preparing so it will take extra $0.02ms$ thereafter.

    so total time to transfer $32B$ is : $(0.05+0.03)+(0.02+0.03)*31=1.63ms$

    2 Comments

    The DMA controller requires 12 cycles for initialization of operation and transfer takes 4 cycles to transfer 2 byte of data from device to the memory

    every 2 bytes take 12 clock cycles for initialization and 4 for transfer. you've taken 2 cycles for transferring 2 bytes of data

    0
    0

    @reena_kandari, data transfer time for each byte will be (2 + 12) / 800 = 0.0175 ms

    using concept of pipelining, when data is transfering during 0.0175 ms then simultaneously data is preparing so it will take extra 0.0325 ms thereafter.

    So total time to transfer 32B is:

    (0.05 + 0.0175) + (0.0325 + 0.0175) * 31 = 1.6175 ms

    0
    0
    0 votes
    0 votes
    In cycle stealing mode ,  processor and DMA uses alternate cycles for data transfer.

    total cycles needed= 16 or 15 (if dma starts first then 15 else 16)

    transfer time =(initialization time+16)* 1/clock frequency

    transfer time=28/800khz

    35 $\mu$sec
    by
    0 votes
    0 votes

    4 cycle for 2 bytes means 2 cycle transferring 1 byte and 12 cycle for preparation so,

    total cycle needed to transfer 1 byte= 14 cycle 

    for 32 byte => 32x14 cycle =448

    time= 448/(800x10^3) = 0.56 ms

    1 comment

    you can see similar problem here for justification https://gatestack.in/t/made-easytest-series/727

    0
    0

    Related questions