This article describes the difference between Memory-mapped IO and IO-mapped IO. The microprocessor is connected with external devices such as I/O devices, memory, and other peripherals via an Interface, which is the communication link between the CPU and the external peripheral devices.
I/O interfacing is defined as the interfacing between the processing unit or CPU and I/0 devices such as – keyboard, mouse, printer, etc. Based on the kind of interfacing link between CPU and I/O devices, it can be subdivided into the following two categories –
- Memory-Mapped I/O Interfacing
- Standard I/O Mapped I/O Interfacing
In this article, we will highlight the significant differences between Memory-Mapped I/O Interfacing and Standard I/O-mapped I/O Interfacing. But before that, let’s look at their basic introductions.
What is Memory-mapped I/O Interfacing?
Memory-mapped I/O devices are treated as memory locations and not separate I/O peripherals. In the case of memory-mapped I/O peripherals, no separate memory is allocated for I/O devices; they share the same memory. A 16-bit address is assigned for the I/O devices in the memory.
Moreover, I/O devices and memory share the same bus to transfer data to and from the processor. This minimizes addressing and memory capacity. Memory-mapped I/O interfacing is used in applications with small memory requirements.
In this scenario, the I/O ports are memory locations for writing and reading operations. The same set of instructions is used for transferring data to and from the I/O or memory. A control signal is activated whenever an address is sent over the address line. In a memory-mapped I/O peripheral, the data from the I/O device is sent to the ALU (arithmetic and logical unit).
The assemble language instructions, namely LOAD and STORE, are utilized to execute the read and write operations from both the I/O peripherals and the memory.
What is I/O Mapped I/O Interfacing?
I/O-mapped I/O devices are also called isolated I/O mapping, as the I/O devices are allotted a separate addressing space from the memory. These distinct spaces allotted for the I/O peripherals are called ‘Ports.’ Therefore, separate instructions for reading and writing are present for both I/O and memory.
In this case, the I/O devices have been assigned distinct read and write control lines. Data transfer in the case of I/O-mapped I/O devices occurs such that when data or information has to be transmitted from the I/O to the processes, it is first placed on the common address bus, followed by the activation of the I/O read and I/O write control lines to enable this data transfer.
This kind of system is applicable in scenarios where the memory requirements are large. In contrast to the memory-mapped I/O system, the I/O-mapped I/O system operates vis the I/O read and I/O write cycles. However, it interfaces comparatively fewer ports, approximately 256. Moreover, the arithmetic and logic unit (ALU) operations cannot be performed using the information accessed from the I/O devices of the I/O-mapped I/O system approach.
Difference Between Memory-mapped I/O and I/O-mapped I/O
The key differences between Memory-mapped IO and IO-mapped IO are listed in the table below.
Parameter | Memory-mapped I/O | I/O-mapped I/O |
Functionality | I/O peripherals share the same instructions and address space. | I/O peripherals are allotted separately or isolated in special address spaces called ports. |
Width of Assigned address space | The size of the address space is about 16 bits. | The size of the address space is about 8 bits. |
Instruction types | The type of instructions involved in memory writing and memory reading. | The type of instructions involved in I/O writing and I/O reading. |
Instructions for data transfer | Both memory and I/O devices share the same type of instructions for data transfer. | Memory and I/O devices have separate and distinct types of instructions for data transfer. |
Ports for I/O interfacing | The interfacing size for memory-mapped I/O devices is quite large i.e., 64K bytes. | The interfacing size for I/O-mapped I/O devices is comparatively less than 256 bytes. |
Control signals | No distinct control signals are involved in the transfer of data. | Special and distinct control signals, namely – I/O read, and I/O write control signals, are involved in the transfer of data, |
Efficacy | The efficiency of memory-mapped I/O systems is relatively low. | The efficiency of I/O-mapped I/O systems is relatively high. |
Hardware for decoder | Comparatively, more hardware is needed to design a decoder. | Comparatively, less hardware is needed to design a decoder. |
Status of pin IO/M | The value of the IO/M pin of the system is set to 0 (i.e., low) when the memory read and memory write cycles are executed. | The value of the IO/M pin of the system is set to 1 (i.e., high) when the I/O read and I/O write cycles are executed. |
Movement of data | Data is transmitted between ports and registers in the case of a memory-mapped I/O approach. | Data is transmitted between ports and accumulators in the case of the I/O-mapped I/O approach. |
System complexity | The system is relatively simple due to the absence of separate control signals and requires fewer pins. | The system is relatively complex due to separate control signals and requires more pins. |
Speed | The speed of operation is relatively low. | The speed of operation is relatively high. |
Application | The memory-mapped I/O approach is used in the case of smaller systems requiring less memory space. | The I/O mapped I/O approach is used for larger systems requiring greater memory space. |
Example of Processor | Intel 8085, Motorola 6800 | Intel 8255, Zilog Z80 |
Conclusion
In conclusion, this article highlights the important differences between Memory-mapped IO and IO-mapped IO systems. The major difference is that memory-mapped I/O devices share a common address space and instructions for both I/O devices and memory, while I/O-mapped I/O systems have isolated and special address spaces designated for I/O devices.