0
$\begingroup$

I am learning about computer architecture and organization.

I have read that programmed I/O is not suitable for high-speed data transfer because it does not support synchronous mode of data transmission that is a requirement for many high-speed peripherals like disk.

But programmed I/O supports synchronous mode of data transfer. I am confused. Can someone please help me?

References: Assignment 10 question number 2

$\endgroup$
1
  • 2
    $\begingroup$ It might help to edit your question to tell us why you think it does or doesn't support synchronous data transfer. How did you form that conclusion? $\endgroup$
    – D.W.
    May 7, 2021 at 23:02

2 Answers 2

1
$\begingroup$

There are 3 flavors of dealing with IO:

  1. Programmed I/O (PIO). So for every 'data item', you need to execute an instruction on the CPU and the CPU will wait for the instruction to complete. So if you have a lot of data (so many 'data items') that needs to be send/received, the CPU will be blocked for a long time.

  2. Interrupt driven I/O. So the transfer starts on the CPU, and on completion of the transfer, an interrupt is send. This means that the CPU is free for other tasks. But for every data item you still need to interact with the CPU. So better than #1, but still not great.

  3. DMA: a DMA controller (either a central one or one on the storage device) will take care for sending multiple data items without any involvement of the CPU. So prevent the CPU from being a bottleneck.

I'm not sure if I'm understanding your question correctly. PIO is synchronous because the CPU is stalled.

There is another level where synchronous and asynchronous can be important. Modern interconnects like a link with PCIe is made of lanes and each lane is an asynchronous serial bus. The advantage of an asynchronous serial bus is that the source and destination are not limited by a common clock signal (hence the name asynchronous) and as a consequence can have very high bandwidths.

$\endgroup$
0
$\begingroup$

You can of course write a program which runs on a CPU and performs synchronous I/O.

But there are ways this can fail pretty easily: for example, your program may run on a pre-emptive operating system (i.e. all modern OSses like Linux and other Unices, Windows etc.) and simply not be scheduled quickly enough. Or, if your program manages to convince the OS to keep it scheduled, it may block other processes badly (e.g., if there is a GUI, it may freeze/stutter; or if there are other real time processes they might fail).

If you are in a setting without pre-emptive multitasking, i.e. on a microcontroller which you have under control yourself, then creating truly synchronous programs is still considerably harder than asynchronous. For slow protocols this wouldn't be an issue (you can simply rely on an interrupt timer, either on-chip or via some external circuit), but for very fast protocols you might need to fine-tune your algorithm to take the number of clock cycles of individual operations into account; and you probably will be hard pressed if you allow interrupt operations on the same uC.

Finally, a general purpose uC which is still fast enough for your high speed transfer after the above considerations might be exorbitantly more expensive than a dedicated separate chip.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.