Resource 3 (I O Organization) 1
Resource 3 (I O Organization) 1
The I/O devices can not communicate with the CPU directly. That’s why it needs some
connection point so that it can communicate with the CPU which is called the I/O
Interface.An I/O (Input/Output) interface is a mechanism that allows a computer or
other electronic system to communicate with external devices or peripherals. It serves
as a bridge between the system's internal components and external hardware, enabling
the transfer of data and commands.
I/O Mapping
I/O mapping refers to the method of organizing and accessing Input/Output (I/O)
devices within a computer system. It determines how the system's I/O operations are
translated into actions or data transfers between the CPU and peripheral devices. There
are mainly three types of I/O mapping: Separate buses, port-mapped I/O and
memory-mapped I/O.
Separate buses
The CPU uses separate data bus , address bus and control bus for Memory and
separate data bus , address bus and control bus for communicating with I/O devices.
But this technique makes the system very costly and big.
Port-mapped I/O or Isolated I/O
● The address and data bus are common but separate read and write control lines
are for memory and I/O
● Separate address space for I/O and memory
● separate read and write control lines are for memory and I/O
○ IOR and IOW for I/O operations
○ MEMR and MEMW for memory operations
● Special instruction ( IN & OUT ) is used for I/O operation
● MOV instruction is used for memory transfer
● Since it separates the I/O address from memory address that’s why it is called
isolated I/O
Advantage
➔ Full memory space is available since I/O has separate space. So can store more
programs in the memory
Disadvantage
➔ Need special instructions for I/O operation which makes it complex for
programming
● Address, data and control bus are common for I/O devices and memory
● uses the same address space for both memory and I/O devices
● I/O devices are assigned addresses within the system's memory space
● the same instructions used for memory operations are also used for I/O
● No special instruction such as IN and OUT is needed for I/O operation
● Uses only one set of read/write signals and does not distinguish between
memory and I/O
Advantage
Disadvantage
➔ The allocation and management of address space for both memory and I/O can
become complex, particularly in systems with large amounts of memory or
numerous I/O devices.
➔ Careful management is needed to ensure that I/O device addresses do not
overlap with memory addresses used by the system.
Separate instruction control read and Same instructions can control both I/O
write operation in I/O and Memory and Memory
In this I/O address are called ports. Normal memory address are for both
More efficient due to separate buses Lesser efficient
It is complex due to separate logic used Simpler logic is used as I/O is also
to control both. treated as memory only.
We can transfer data between I/O devices and memory using three approaches
Programmed I/O
Programmed I/O (Input/Output) is a method of data transfer between the CPU and
peripheral devices (like disk drives, printers, etc.) in computer systems. In Programmed
I/O, the CPU is actively involved in the transfer of data, which means it continually
checks the status of the I/O device and reads or writes data as needed.
● The CPU will ask for data from the specific I/O device through the address
bus
● That request will be received by the interface and will forward it to the
mentioned I/O device
● Based on this request, the specified I/O will give the data to the data
register through I/O bus.The CPU continues executing other tasks while
waiting for the transfer to complete
● When the data will be available on data register, the status register will be
set to 1
● When the flag bit of status register is 1, the interface will send a interrupt
request (INTR) to CPU
● Once the interrupt is received by the CPU, the CPU responds to the
interrupt by sending an interrupt Acknowledge(INTA) signal to the interface
● When the interface receives the INTA, it will place the data from the data
register on the data bus and the CPU will read it from the bus.
Follow the diagram for interrupt driven I/O that was explained in the classroom
DMA is a method that allows an I/O device to send or receive data directly to or
from the memory, bypassing the CPU to speed up the memory operation.The
steps are given below:
Modes of DMA
Burst Mode: In this mode, buses are handed over to the CPU by the DMAC if the
whole data is transferred completely, not before that. It is the fastest mode.
Cycle Stealing Mode: In this mode, buses are handed over to the CPU by the DMAC
after the transfer of each byte. As a result of that, continuous request for the bus control
is generated by this mode.
Interleaving/ Transparent Mode: In this mode, DMAC gets the bus control only when
the CPU is executing the instruction which does not require the use of buses or CPU is
idle.It is the slowest mode.