Memory mapped I/O and isolated I/O are two methods for interfacing I/O devices with the CPU. With isolated I/O, memory and I/O devices have separate address spaces and control lines, allowing special I/O instructions. With memory mapped I/O, memory and I/O share the same address space and instructions, treating I/O as memory, but reducing available memory addresses. Both methods have advantages like flexibility and speed, but also disadvantages regarding complexity and available address space.
2. INTRODUCTION
As a CPU needs to communicate with the various memory and input-
output devices (I/O) as we know data between the processor and these
devices flow with the help of the system bus. There are three ways in
which system bus can be allotted to them :
1. Separate set of address, control and data bus to I/O and memory.
2. Have common bus (data and address) for I/O and memory but separate control
lines.
3. Have common bus (data, address, and control) for I/O and memory.
In first case it is simple because both have different set of address space and
instruction but require more buses.
3. The microprocessor obviously is not used as a single unit. It
needs to be linked with memory, extra peripherals, or I/O devices.
This linking can also be called as Interfacing. An interface acts
as a communication channel between the processor and the
externally interfaced device.
I/O interfacing is the link between the processor or CPU and the
various I/O peripherals such as the keyboard, printer, mouse, etc.
Such type of interfacing is referred to as I/O Interfacing.
The interfacing of the I/O devices can be done in two ways:
1. Memory-Mapped I/O Interfacing
2. Standard I/O Mapped I/O Interfacing (also known as isolated I/O
interfacing).
4. Isolated I/O –
Then we have Isolated I/O in which we Have common
bus(data and address) for I/O and memory but separate read
and write control lines for I/O. So when CPU decode
instruction then if data is for I/O then it places the address on
the address line and set I/O read or write control line on due
to which data transfer occurs between CPU and I/O. As the
address space of memory and I/O is isolated and the name is
so. The address for I/O here is called ports. Here we have
different read-write instruction for both I/O and memory.
6. ADVANTAGES
• There is minimal logic involved in decoding a
discrete address for the interfaced peripheral.
• We get special instructions only for I/O.
• Since these I/Os have a separate address space (8-
bits), the entire 64K bytes (16-bit address line) is
available just for memory.
• The whole system is smaller and less complicated.
• This method works faster due to lesser delays.
7. DISADVANTAGES
• Compared to the Memory Mapped I/O, more instructions are required to complete
the same task.
• Arithmetic and Logical instructions cannot be applied to the data.
• Less powerful and flexible than memory-mapped I/O.
• We need extra control signal lines to switch between the two different address
spaces that are created in I/O mapped I/O. This increases the number of pins.
We get two separate address spaces
when we use IO mapped IO method
to interface I/O devices. The I/O
devices get their own special
memory space. We can choose
which address space to
communicate with using the IO/M
pin.
8. Memory Mapped I/O –
In this case every bus in common due to which the same set of
instructions work for memory and I/O. Hence we manipulate I/O same as
memory and both have same address space, due to which addressing
capability of memory become less because some part is occupied by the
I/O.
9. ADVANTAGES
• This method of interfacing gives us a single address space, as well as a common set of
instructions to be used for both the memory & I/O operations.
• The memory ordering rules & memory barriers can be defined here, which will apply both to
the device accesses and normal memory.
• An entirely different set of opcodes for I/O commands is not necessary. Instead, you can reuse
your ordinary memory access instructions.
• The same memory mapping mechanisms which are used for other memory can be used to
gain access to the devices as well.
• It is very beneficial to use the low-latency buses in the system.
• The I/O intensive operations can be much quicker since the information content need not be
copied between the kernel space and the user space.
• Separate control signals are not required since there is no switching between two different
address spaces. We just have one unified address space for both memory and I/O devices.
This saves time as well as real-estate on the chip.
• With respect to 8085, the address lines are of 16-bits, so you get an option of using up to 64k
I/O ports, as opposed to just 256 in I/O mapped I/O.
10. DISADVANTAGES
• The working of the cache controller gets complicated, as the interfaced peripherals
differ in their behavior when compared to normal memory. We’ll read about this in detail
later in our embedded systems course track.
• The instruction scheduling becomes more difficult as the processor cannot recognize if
any information is loaded/stored in the memory or in the device.
• The entire address bus has to be fully decoded for every peripheral. Say, a machine
with a 64-bit address bus will need logic gates to resolve the states of all the 64
address lines, to decode the particular address of any peripheral properly.
• The more the system bit configuration, the more is the cost of adding the machine with
extra complex hardware.
• The mode works much slower than I/O mapped I/O interfacing.
Memory-mapped I/O gives us a unified
address space for both, memory and I/O