memory-mapped I/o vs port-mapped I/O

Source: Internet
Author: User

About Mmio and Pio, I see the most clear explanation of the article, the original here: memory-mapped I/o vs port-mapped I/O-2015

Microprocessors normally use the methods to connect external devices: memory mapped or port mapped I/O. However, as far as the peripheral was concerned, both methods is really identical.

Memory mapped I/O is mapped to the same address space as program memory and/or user memory, and are accessed in the same The.

Port mapped I/O uses a separate, dedicated address space and is accessed via a dedicated set of microprocessor instruction S.

The difference between the schemes occurs within the microprocessor. used the port mapped scheme for their microprocessors and Motorola have used the memory Mappe D scheme.

As 16-bit processors has become obsolete and replaced with 32-bit and 64-bit in general use, reserving ranges of memory a Ddress space for I/O is less than a problem, as the memory address space of the processor is usually much larger than the RE Quired space for all memory and I/O devices in a system.

Therefore, it had become more frequently practical to take advantage of the benefits of memory-mapped of I/O. However, even with address space being no longer a major concern, neither I/O mapping method is universally superior to th e Other, and there'll be cases where using port-mapped I/O is still preferable.

memory-mapped IO (MMIO)


Picture Source:io Devices

I/O devices is mapped into the system memory map along with RAM and ROM. To access a hardware device, simply read or write to those ' special ' addresses using the normal memory access instructions .

The advantage to this method is a every instruction which can access memory can be used to manipulate an I/O device.

The disadvantage to this method is, the entire address bus must be fully decoded for every device. For example, a and 32-bit address bus would require logic gates to resolve the state of all address lines to Properly decode the specific address of any device. This increases, adding hardware to the machine.

port-mapped io (pmio or Isolated io)


Picture Source:io Devices

I/O devices is mapped into a separate address space. This was usually accomplished by have a different set of signal lines to indicate a memory access versus a port access. The address lines is usually shared between the address spaces, but less of them is used for accessing ports. An example of the-the standard PC which uses-bits of port address space, but with a memory address space of.

The advantage to this system is, less logic was needed to decode a discrete address and therefore less cost to add hard Ware devices to a machine. On the older PC compatible machines, only ten bits of address space were decoded for I/O ports and so there were only 1024 Unique port locations; Modern PC ' s decode all address lines. To read or write from a hardware device, special port I/O instructions is used.

From a software perspective, this is a slight disadvantage because more instructions be required to accomplish the same t Ask. For instance, the if we wanted to test one bit on a memory mapped port, the There is a single instruction to test a bit in memory, Ports we must read the data into a register and then test the bit.



Comparison-memory-mapped vs port-mapped

memory-mapped IO < Span style= "FONT-SIZE:18PX;" >port-mapped IO
same address bus to address Memory and I/O devices different address spaces for Memory and I/O devices
access to the I/O dev ICES using regular instructions uses a special class of C PU instructions to access I/O devices
most W Idely used I/O method x86 Intel microprocessors-in and O UT Instructions


Resource Monitor

We can check the reserved memory address space from the Resource Monitor via our desktop ' s Task Manager.



memory-mapped I/o vs port-mapped I/O

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.