<P> Hardware interrupts are another communication method between the CPU and peripheral devices, however, for a number of reasons, interrupts are always treated separately . An interrupt is device - initiated, as opposed to the methods mentioned above, which are CPU - initiated . It is also unidirectional, as information flows only from device to CPU . Lastly, each interrupt line carries only one bit of information with a fixed meaning, namely "an event that requires attention has occurred in a device on this interrupt line". </P> <P> I / O operations can slow memory access if the address and data buses are shared . This is because the peripheral device is usually much slower than main memory . In some architectures, port - mapped I / O operates via a dedicated I / O bus, alleviating the problem . </P> <P> One merit of memory - mapped I / O is that, by discarding the extra complexity that port I / O brings, a CPU requires less internal logic and is thus cheaper, faster, easier to build, consumes less power and can be physically smaller; this follows the basic tenets of reduced instruction set computing, and is also advantageous in embedded systems . The other advantage is that, because regular memory instructions are used to address devices, all of the CPU's addressing modes are available for the I / O as well as the memory, and instructions that perform an ALU operation directly on a memory operand (loading an operand from a memory location, storing the result to a memory location, or both) can be used with I / O device registers as well . In contrast, port - mapped I / O instructions are often very limited, often providing only for simple load - and - store operations between CPU registers and I / O ports, so that, for example, to add a constant to a port - mapped device register would require three instructions: read the port to a CPU register, add the constant to the CPU register, and write the result back to the port . </P> <P> As 16 - bit processors have become obsolete and replaced with 32 - bit and 64 - bit in general use, reserving ranges of memory address space for I / O is less of a problem, as the memory address space of the processor is usually much larger than the required space for all memory and I / O devices in a system . Therefore, it has become more frequently practical to take advantage of the benefits of memory - mapped I / O. However, even with address space being no longer a major concern, neither I / O mapping method is universally superior to the other, and there will be cases where using port - mapped I / O is still preferable . </P>

Differentiate between memory-mapped io and peripheral i/o