Difference Between DMA and PIO
DMA vs PIO
Direct Memory Access and Programmed Input/Output, DMA and PIO respectively, are two ways of transferring information in electronic devices; more famously in computers and other like devices. PIO is an older method that has since been replaced by DMA in most applications due to certain advantages. DMA is newer and better than PIO in many ways and many devices now use mainly DMA with only minimal PIO support for compatibility and to establish DMA modes.
The primary disadvantage of PIO, and the main reason for the advent of DMA, is the toll it takes on the CPU. With PIO, the CPU is responsible for moving the data from one point to another. The faster the transfer speed, the busier the CPU becomes; producing a major bottleneck in the performance of the computer. DMA does not operate the same way as PIO does. The CPU does not facilitate the transfer of information, leaving it free to do other tasks regardless of the rate of transfer of information. This means that the CPU is not a factor when it comes to considering the maximum rate of transfer.
As previously stated, some devices are capable of working with PIO and DMA despite using only DMA. PIO is used whenever there are problems with DMA. Whenever an error threshold is reached, the device automatically switches to PIO mode for a more consistent operation.
Although DMA is superior to PIO in many ways, it is still in use in many devices. The circuitry needed for a PIO controller is much simpler, therefore cheaper, when compared to DMA. In devices where a high speed of transfer is not necessary and in simple ones, it is more cost effective to use PIO rather than DMA. That is why PIO is still in use despite being bested by DMA in almost all aspects. One example of devices that still use PIO is CompactFlash. There are even new PIO modes that were designed for CompactFlash.
When choosing which mode to use with your hard drives, DMA would always produce better performance than PIO. It is better to let the system choose automatically though as it would automatically choose the better one at that your hardware can work with.
Summary:
PIO is older compared to DMA
PIO is takes up more CPU power compared to DMA
PIO is much simpler compared to DMA
Devices resort to PIO when DMA is problematic
- Difference Between Sony Cybershot S Series and W Series - December 22, 2012
- Difference Between Samsung Galaxy S3 and iPhone 5 - December 21, 2012
- Difference Between Samsung Galaxy S2 (Galaxy S II) and Galaxy S 4G - December 20, 2012
Search DifferenceBetween.net :
Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.
It’s very helpful to me..but i need one answer why programmed io is
simple to programmed. If you know this then replay me as soon as possible..
Very educative
But now!!how does the DMA work??
DMA is actually about as old as PIO. Back in the late 1970’s when I was working on minicomputers, DMA was the preferred method for moving large amounts of data. However early PC’s were pretty feature-poor and may not even have had any DMA logic, I don’t know.
In PIO, the CPU has to supply the address of the device or memory location it is writing to, and then the data that it is writing. If reading instead, it just supplies the address to read. It can only write or read one byte or word at a time.
In DMA, the CPU first uses PIO to write some registers that set up the DMA, such as the memory (source or destination) address register, the byte count register, and a control register. Then it (typically) starts the DMA by turning on a bit in the control register. The transfer then completes without any more attention from the CPU. The byte count register decrements every time a byte comes through, and the address register increments. When the byte count reaches zero, the DMA automatically stops, and an interrupt is generated to inform the CPU that the transfer is complete.