Lecture-13: I/O Mapping in Microprocessor (MPU)

 I/O Mapping or I/O Addressing or I/O Interfacing Technique

When computers use one common bus to transfer information between Memory, I/O, & CPU. Thus, there are 2 ways that computer programs communicate with I/O devices, or 2 techniques for addressing the I/O devices by the CPU:

1.    Isolated I/O (I/O-mapped I/O or Port mapped I/O)

2.    Memory Mapped I/O


Key Points:

Technique

Control Lines

Addressing

Isolated I/O

Separate

I/O has its own address space

Memory Mapped I/O

Common (shared)

I/O shares memory address space

ISOLATED I/O (I/O-Mapped I/O or Port-Mapped I/O):

Key Features:

  • The address & data bus are common but separate read & write control lines for I/O & memory.
  • I/O device & memory both have a separate address space.
  • Separate read/write control lines for I/O & memory transfer.
  • I/O read & I/O write → for I/O transfer
  • Memory read & Memory write → for Memory transfer
  • Special commands are used for I/O transfer: → IN & OUT instructions
  • For memory transfer: → MOV instruction
  • Because it isolates I/O address from memory address, that’s why called Isolated I/O.
  • The address for I/O here is called ports, hence also called port-mapped I/O.

Address Space Allocation:

Component

Address Range

Size

Notes

Memory

0000 to FFFF

64 KB

Full memory available

I/O Ports

00 to FF

256 ports

Separate space


Advantages:

1.    Full memory space is available because I/O space is isolated.

2.    Special instructions (IN, OUT) make I/O operations easily identifiable.

Disadvantages:

1.    Need of special instructions (IN, OUT) — not memory-related.

2.    Less flexible for programming.

Control Signal Summary:

Signal

Used For

Memory Read/Write

Memory transfer

I/O Read/Write

I/O transfer (IN/OUT)


Instructions Used:

Operation

Instruction

I/O Input

IN

I/O Output

OUT

Memory Transfer

MOV




                                                         Figure: Isolated Mapping

MEMORY MAPPED I/O:

Key Features:

  • Address, data & control bus are common for I/O devices & memory.
  • I/O devices & memory share same address space.
  • Due to which addressing capability of memory becomes less because some part is occupied by I/O.
  • Single set of read/write control lines for both I/O & memory transfer.
  • I/O transfer looks like memory read/write.
  • No special commands for I/O transfer (like IN/OUT).
  • MOV can be used to perform both I/O & memory transfer.

Address Space Allocation:

Component

Address Range

Notes

Memory + I/O

0000 to FFFF

64 KB total

I/O

Part of above

Assigned within memory range

Memory

Remaining

Reduced due to I/O


Advantages:

  1. Uses only one set of read/write signals & does not distinguish between memory & I/O addresses.
  2. No need for special I/O instructions — MOV works for both.
  3. Most computer systems use memory-mapped I/O.

 

Disadvantages:

  • Reduces memory address range available because addresses are assigned to I/O devices.

      
                                               
                                                           Figure: Memory Mapping

Sr. No.

I/O Mapped I/O

Memory Mapped I/O

1.

I/O device is treated as an I/O device and hence given an I/O address.

I/O device is treated like a memory device and hence given a memory address.

2.

I/O device has an 8 or 16 bit I/O address.

I/O device has a 20-bit Memory address.

3.

I/O device is given IOR# and IOW# control signals

I/O device is given MEMR# and MEMW# control signals

4.

Decoding is easier due to lesser address lines

Decoding is more complex due to more address lines

5.

Decoding is cheaper

Decoding is more expensive

6.

Works faster due to less delays

More gates add more delays hence slower

7.

Allows max 2^16 = 65536 I/O devices

Allows many more I/O devices as I/O addresses are now 20 bits.

8.

I/O devices can only be accessed by IN and OUT instructions.

I/O devices can now be accessed using any memory instruction.

9.

ONLY AL/ AH/ AX registers can be used to transfer data with the I/O device

Any register can be used to transfer data with the I/O device

10.

Popular technique in Microprocessors.

Popular technique in Microcontrollers

Post a Comment

0 Comments