Unit II
Unit II
Input/output Organization
Accessing Input/output devices
Input/output (I/O) refers to the communication between a computer and
the outside world. Input/output devices connect peripheral devices to the
CPU.
The block diagram of an Input-Output Interface unit contain the following
blocks :
0 0 1 0 0 Port A
0 0 1 0 1 Port B
0 0 1 1 0 Control Register
0 0 1 1 1 Status Register
Write State :
0 1 0 0 0 Port A
0 1 0 0 1 Port B
0 1 0 1 0 Control Register
0 1 0 1 1 Status Register
Example :
•If S0, S1 = 0 1, then Port B data register is selected for data transfer between CPU and I/O
device.
•If S0, S1 = 1 0, then Control register is selected and store the control information send by the
CPU.
Interrupts
An interrupt is a signal emitted by a device attached to a computer or from a
program within the computer. It requires the operating system (OS) to stop and
figure out what to do next.
Interrupt Hardware:
A hardware interrupt is an electronic signal from an external hardware device
that indicates it needs attention from the OS.
Disabling Interrupts:
• Conversely, disabling interrupts prevents the processor from responding to interrupt signals.
• When interrupts are disabled, the processor ignores any incoming interrupt requests.
• This can be useful in critical sections of code where interrupt handling could cause
undesirable behavior or when the system needs to perform tasks that require uninterrupted
execution.
Handling Multiple Devices
Handling multiple devices in computer organization involves managing the
interactions between the central processing unit (CPU) and various peripheral
devices connected to the system.
DMA (Direct memory access) is the special feature within the computer system that
transfers the data between memory and peripheral devices(like hard drives) without
the intervention of the CPU.
This improves system performance by off loading data transfer tasks from the CPU,
allowing it to focus on other processing tasks.
Modes of Data Transfer in DMA
There are 3 modes of data transfer in DMA that are described below.
• Burst Mode: In Burst Mode, buses are handed over to the CPU by the
DMA if the whole data is completely transferred, not before that.
• Cycle Stealing Mode: In Cycle Stealing Mode, buses are handed over
to the CPU by the DMA after the transfer of each byte. Continuous
request for bus control is generated by this Data Transfer Mode. It
works more easily for higher-priority tasks.
• Transparent Mode: Transparent Mode in DMA does not require any
bus in the transfer of the data as it works when the CPU is executing
the transaction.
• The above block diagram of the DMA controller.
• The unit communicates with the CPU through the data bus and control lines.
• Through the use of the address bus and allowing the DMA and RS register to
select inputs, the register within the DMA is chosen by the CPU.
• RD and WR are two-way inputs.
• When BG (bus grant) input is 0, the CPU can communicate with DMA
registers.
• When BG (bus grant) input is 1, the CPU has relinquished the buses and
DMA can communicate directly with the memory.
• The CPU initializes the DMA by sending the given information through
the data bus.
• The starting address of the memory block where the data is available (to read)
or where data are to be stored (to write).
• It also sends word count which is the number of words in the memory block to
be read or written.
• Limited Control: As DMA takes control over the memory bus for data
transfers which is not always acceptable because in some situations CPU has to
wait for the DMA controller to complete the task.