Breaking

Wednesday, December 26, 2018

What is the difference between Memory mapped I/O and I/O mapped I/O


What is the difference between Memory mapped I/O and I/O mapped I/O 
There are two techniques of addressing an I/O device by the CPU:
1. Memory mapped I/O scheme
2. I/O mapped I/O scheme

1    Memory-Mapped I/O Scheme:

The technique in which a CPU addresses an I/O device just like a memory location is called memory-mapped I/O scheme. In this scheme, only one address space is used by the CPU. Some addresses of the address space are assigned to memory locations and other are assigned to I/O devices. The same address cannot be assigned to both a memory location as well as an I/O device. For example, memory locations are assigned the addresses from 00000 to 4FFFF. One address is assigned to each memory location and an I/O device cannot be assigned any address from these addresses. The addresses for I/O devices are different from the addresses assigned to memory locations. The addresses which have not been assigned, for example, 500000,500001,500002 etc.to memory locations can be assigned to I/O device.

2     I/O mapped I/O scheme:

In this scheme two separate address spaces are used, one for memory locations and the other for I/O devices. I/O address space is much smaller than the memory address space.an address assigned to a memory location can also be assigned to an I/O device. Since the same address can be assigned to a memory location as well as an I/O device, there must be a signal issued by the CPU to distinguish whether the address on the address bus is for a memory location or for an I/O device. Two additional instructions IN and OUT are used for data transfer with an I/O device.

the above discussed two schemes have their own merits and demerits. The advantage of the memory mapped I/O scheme is that all the data transfer instructions which are used for memory locations can also be used for I/O devices. All arithmetic and logic operations can be performed on I/O data directly. In case of I/O mapped I/O scheme, the data has to be transferred to the accumulator (or any one of the internal resister) to perform arithmetic and logic operations. The disadvantage of memory mapped I/O scheme is that a part of the address space is used by I/O devices. As a result the maximum size of the memory becomes less than CPU’s address space. The advantage of the I/O mapped I/O scheme is that the entire address space of the CPU is available for memory devices. As the memory data transfer instructions cannot be used for I/O devices, new instructions IN and OUT have to be provided for data transfer with I/O devices.


Difference between memory mapped I/O & I/O mapped I/O


Characteristics
Memory-Mapped I/O
I/O-Mapped I/O
Device address
16 bit
8 bit
Control Signal
MEMR'/MEMW'
IOR'/IOW'
Instructions available
Memory related instructions such as STA,LDA,LDAX,STAX etc.
IN and OUT
Maximum no. of I/Os possible
The memory map(64k)is shared between I/Os and system memory
It is independent of the memory map,256 input devices and 256 output devices can connected
Data transfer
Between any register and I/O
Only between I/O and the accumulator
Execution speed
13 T states (STA, LDA)
7 T states(MOV,M,R)
10 T states
Hardware requirement
More hardware is needed to decode 16 bit address
Less hardware is needed to decode 8 bit
Other features
Arithmetic/Logic operations can be directly performed
Not available

No comments:

Post a Comment