2019 20 7a

Computer Organization and Architecture2019-2010 marksPeripheral devices, I/O interface, I/O ports

Write down the difference between isolated I/O and memory mapped I/O. Also discuss advantages and disadvantages of isolated I/O and memory mapped I/O.

Write down the difference between isolated I/O and memory mapped I/O. Also discuss advantages and disadvantages of isolated I/O and memory mapped I/O.

Quick answer

In a computer, the CPU must address both memory locations and I/O device registers. There are two ways to do this.

Isolated I/O keeps a separate address space for I/O. The CPU uses special instructions (IN and OUT) and a control signal such as IO/M to tell whether the address belongs to memory or to an I/O port.

Memory mapped I/O gives the I/O registers addresses from the same space as memory. The CPU uses the ordinary load and store instructions to talk to devices. No separate control signal is needed.

Difference between the two

PointIsolated I/OMemory mapped I/O
Address spaceSeparate for memory and I/OOne common space shared
InstructionsSpecial IN and OUTOrdinary LOAD, STORE, MOV
Control linesSeparate I/O read and write signalsSame memory read and write signals
Number of addressesFull space is available for memoryPart of memory space is used by devices
Instruction setNeeds extra I/O instructionsNo extra instructions
Address decodingSmaller, as only port numbers are decodedLarger, as device addresses sit among memory addresses
Typical useIntel 8085, 8086ARM, MIPS, Motorola 68000

Advantages of isolated I/O

  • The whole memory address space is free for memory.
  • I/O instructions stand out clearly in the program, so the code is easy to read.
  • Port address decoding is simple because the number of ports is small.

Disadvantages of isolated I/O

  • Only a few instructions (IN and OUT) can work with I/O, and they usually move data only through the accumulator.
  • Extra control signals and extra instructions make the CPU more complex.
  • Arithmetic or logic on device data cannot be done directly.

Advantages of memory mapped I/O

  • All memory instructions work on I/O registers, so one can add, compare, shift or test bits of a device register directly.
  • No special instructions or control pins are needed, so the CPU design is simpler.
  • Many more I/O devices can be addressed.

Disadvantages of memory mapped I/O

  • Device addresses take away a part of the memory space. This matters for a small address space.
  • Address decoding is more complex, because the full address must be decoded for each device.
  • It is harder to spot I/O operations in a program, since they look like normal memory accesses.

Which one to choose

A small processor with a limited address space and few devices often prefers isolated I/O, so that no memory addresses are lost. A modern processor with a large address space (32 or 64 bits) prefers memory mapped I/O, because the lost addresses hardly matter and the programming is far more flexible.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.

Up nexti. Discuss the design of a typical input or output interface. ii. What are interrupts? How