Unit4 1
Unit4 1
Overview
Peripheral Devices
Input-Output Interface
Modes of Transfer
Priority Interrupt
Input-Output Processor
Serial Communication
Input/Output Organization 3
– I/O Subsystem
• Provides an efficient mode of communication between the
central system and the outside environment
Peripheral Devices
• Devices that are under direct control of computer are said to be
connected on-line.
Peripheral Devices
Input Devices Output Devices
• Keyboard • Card Puncher, Paper Tape Puncher
• Optical input devices • CRT
- Card Reader • Printer (Daisy Wheel, Dot Matrix, Laser)
- Paper Tape Reader • Plotter
- Bar code reader
- Optical Mark Reader
• Magnetic Input Devices
- Magnetic Stripe Reader
• Screen Input Devices
- Touch Screen
- Light Pen
- Mouse
•
Input/Output Organization 6
I/O Interface
• Provides a method for transferring information between internal
storage (such as memory and CPU registers) and external I/O
devices
• Resolves the differences between the computer and peripheral
devices
(1). Peripherals – Electromechanical or Electromagnetic Devices
CPU or Memory - Electronic Device
– Conversion of signal values required
(2). Data Transfer Rate
• Peripherals - Usually slower
• CPU or Memory - Usually faster than peripherals
– Some kinds of Synchronization mechanism may be needed
Keyboard
and Printer Magnetic Magnetic
display disk tape
terminal
Interface :
- Decodes the device address (device code)
- Decodes the commands (operation)
- Provides signals for the peripheral controller
- Synchronizes the data flow and supervises
the transfer rate between peripheral and CPU or Memory
4 types of command interface can receive : control, status, data o/p and data i/p
Input/Output Organization 8
•Status command : used to test various status condition in the interface and
the peripherals
•data o/p command : causes the interface to respond by transferring data from
the bus into one of its registers
•data i/p command : interface receives an item of data from the peripheral and
places it in its buffer register.
Input/Output Organization 9
(1). use two separate buses, one to communicate with memory and the
other with I/O interfaces
- Computer has independent set of data, address and control bus one
for
accessing memory and another I/O.
- done in computers that have separate IOP other than CPU.
(2). Use one common bus for memory and I/O but separate control lines
for each
(3). Use one common bus for memory and I/O with common control
lines for both
Input/Output Organization 11
I/O Interface
Port A I/O data
Bidirectional register
Bus
data bus buffers
Port B I/O data
register
Internal bus
CPU
Chip select I/O
CS
Register select
Control Control Device
RS1 Timing
Register select register
RS0 and
I/O read Control
RD Status Status
I/O write
WR register
Peripheral Devices
Input-Output Interface
Modes of Transfer
Priority Interrupt
Input-Output Processor
11-3. Asynchronous Data Transfer
Synchronous Data Transfer: Clock pulses are applied to all registers
within a unit and all data transfer among internal registers occur
simultaneously during the occurrence of a clock pulse. Two units such
as CPU and I/O Interface are designed independently of each other. If
the registers in the interface share a common clock with CPU registers,
the transfer between the two is said to be synchronous.
Asynchronous Data Transfer: Internal timing in each unit (CPU and
Interface) is independent. Each unit uses its own private clock for
internal registers. Asynchronous data transfer between two
independent units requires that control signals be transmitted
between the communicating units to indicate the time at which data is
being transmitted. One way of achieving this is by means of
STROBE(Control signal to indicate the time at which data is being
transmitted) pulse and other method is HANDSHAKING(Agreement
between two independent units).
1
2
2
1
Timeout : If the return handshake signal does not respond within a given time period,
the unit assumes that an error has occurred.
– Asynchronous Serial Transfer
• Synchronous transmission :
– The two unit share a common clock frequency
– Bits are transmitted continuously at the rate dictated by the clock
pulses
• Asynchronous transmission :
– Binary information sent only when it is available and line remain
idle otherwise
– Special bits are inserted at both ends of the character code
– Each character consists of three parts :
» 1) start bit : always “0”, indicate the beginning of a character
» 2) character bits : data
» 3) stop bit : always “1”
1 1 0 0 0 1 0 1
S tart S to p
C harac ter b its
b it b it
• Asynchronous transmission rules :
– When a character is not being sent, the line is kept in the 1-state
– The initiation of a character transmission is detected from the
start bit, which is always “0”
– The character bits always follow the start bit
– After the last bit of the character is transmitted, a stop bit is
detected when the line returns to the 1-state for at least one bit
time
• Baud Rate : Data transfer rate in bits per second
– 10 character per second with 11 bit format = 110 bit per second
Input/Output Organization 21
Internal Bus
and clock
Chip select
CS
Status Receiver Receiver CS RS Oper. Register selected
RS Timing clock
register control 0 x x None
I/O read and and clock 1 0 WR Transmitter register
RD Control 1 1 WR Control register
I/O write Receive 1 0 RD Receiver register
WR Receiver Shift data
1 1 RD Status register
register register
Transmitter Register
- Accepts a data byte(from CPU) through the data bus
- Transferred to a shift register for serial transmission
Receiver Register
- Receives serial information into another shift register
- Complete data byte is sent to the receiver register
Status Register Bits
- Used for I/O flags and for recording errors
Control Register Bits
- Define baud rate, no. of bits in each character, whether to generate and check parity, and no.
of stop bits
•UART stands for?
A)It ensures that data transfer occurs without any timing constraints.
B)It initiates data transfer upon external events.
C)It controls the timing of data transfer.
D)It provides random timing for data transfer.
7. In synchronous data transfer, what is the key factor that ensures proper synchronization?
A)Asynchronous
B)Synchronous
C)Both are equally common
D)Neither, they are rarely used
9. Which of the following is not a function of I/O interfaces?
a)Data transfer
b)Address generation
c)Error detection
d)Control signal generation
Peripheral Devices
Input-Output Interface
Modes of Transfer
Priority Interrupt
Input-Output Processor
Modes of Transfer
Priority
- Determines which interrupt is to be served first when two or more requests
are made simultaneously
- Also determines which interrupts are permitted to interrupt the computer while
another is being serviced
- Higher priority interrupts can make requests while servicing a lower priority
interrupt
- Very slow
- if there are many interrupts, time required to poll may exceed time available to
service IO device
Priority Interrupts
- Fast since each interrupt source has its own interrupt vector to access
directly to its own service routine
Interrupt request
INT
CPU
Interrupt acknowledge
INTACK
2
Interrupt
to CPU
3
INTACK
from CPU
IEN: Set or Clear by instructions ION or IOF
IST: Represents an unmasked interrupt has occurred. INTACK enables tristate Bus Buffer to load VAD
generated by the Priority Logic
Interrupt Register:
- Each bit is associated with an Interrupt Request from different Interrupt Source - different priority level
- Each bit can be cleared by a program instruction
Mask Register:
- Mask Register is associated with Interrupt Register
- Each bit can be set or cleared by an Instruction
Priority Encoder
Inputs Outputs
I0 I1 I2 I3 x y IST Boolean functions
1 d d d 0 0 1
0 1 d d 0 1 1
0 0 1 d 1 0 1 x = I0' I1'
0 0 0 1 1 1 1 y = I0' I1 + I0’ I2’
0 0 0 0 d d 0 (IST) = I0 + I1 + I2 + I3
Interrupt Cycle
9 6 10
Initial and Final Operations
Each interrupt service routine must have an initial and final set of
operations for controlling the registers in the hardware interrupt system
a. PI=0, PO=0
b. PI=0, PO=1
c. PI=1, PO=0
d. PI=1, PO=1
1. GATE 2016: In Programmed I/O, who typically controls the data transfer process?
• A) CPU
• B) I/O device
• C) DMA controller
• D) Interrupt controller
2. GATE 2017: What triggers the CPU to handle an I/O operation in Interrupt-driven I/O?
• A) Polling routine
• B) DMA transfer request
• C) System call
• D) Interrupt request
3. GATE 2018: Which mode of data transfer is most suitable for devices requiring minimal CPU intervention?
• A) Programmed I/O
• B) Interrupt-driven I/O
• C) Direct Memory Access (DMA)
• D) Memory-mapped I/O
4. GATE 2019: What is the primary function of the DMA controller in Direct Memory Access (DMA)?
• A) Initiates I/O operations
• B) Manages data transfer between I/O devices and memory
• C) Controls interrupt handling
• D) Performs arithmetic and logical operations
5. GATE 2020: In DMA, what does the CPU primarily do during data transfer?
• A) Initiates the transfer
• B) Controls the flow of data
• C) Relinquishes control of the system bus
• D) Determines the priority of I/O operations
6. GATE 2017: Which mode of data transfer is most suitable for transferring large data blocks between memory and I/O devices?
• A) Programmed I/O
• B) Interrupt-driven I/O
• C) Direct Memory Access (DMA)
• D) Memory-mapped I/O
7. GATE 2019: What is the primary advantage of Interrupt-driven I/O over Programmed I/O?
• A) Lower CPU overhead
• B) Higher data transfer rates
• C) Simpler implementation
• D) Reduced latency
8. GATE 2018: Which statement best describes Programmed I/O transfer mechanism?
• A) CPU initiates and controls data transfer.
• B) DMA controller initiates and controls data transfer.
• C) I/O device initiates and controls data movement.
• D) Interrupt controller initiates and controls data transfer.
9. GATE 2020: Which mode of data transfer allows the CPU to be free from handling I/O operations once initiated?
• A) Programmed I/O
• B) Interrupt-driven I/O
• C) Direct Memory Access (DMA)
• D) Memory-mapped I/O
10. GATE 2019: In DMA, which component temporarily takes control of the system bus for data transfer?
• A) CPU
• B) Memory
• C) DMA controller
• D) I/O device
11. GATE 2018: Which mode of data transfer is commonly used for high-speed peripherals like disk drives and network interfaces?
• A) Programmed I/O
• B) Interrupt-driven I/O
• C) Direct Memory Access (DMA)
• D) Memory-mapped I/O
12. GATE 2017: Which of the following statements about Interrupt-driven I/O is true?
• A) It requires constant polling by the CPU.
• B) It allows the CPU to perform other tasks during I/O operations.
• C) It involves direct access to memory without CPU intervention.
• D) It is slower compared to Programmed I/O.
13. GATE 2016: Which mode of data transfer is most suitable for devices requiring minimal CPU intervention?
• A) Programmed I/O
• B) Interrupt-driven I/O
• C) Direct Memory Access (DMA)
• D) Memory-mapped I/O
14. GATE 2019: What triggers the CPU to handle an I/O operation in Interrupt-driven I/O?
• A) Polling routine
• B) DMA transfer request
• C) System call
• D) Interrupt request
15. GATE 2018: Which mode of data transfer allows the CPU to be free from handling I/O operations once initiated?
• A) Programmed I/O
• B) Interrupt-driven I/O
• C) Direct Memory Access (DMA)
• D) Memory-mapped I/O
16. (GATE 2016) In computer architecture, which of the following is true about a daisy chain interrupt priority resolver?
a)It assigns the highest priority to the device connected at the end of the chain.
b)It assigns the highest priority to the device connected at the beginning of the chain.
c)It assigns priority to devices based on their physical proximity to the CPU.
d)It assigns equal priority to all devices in the chain.
17. (GATE 2018) Which of the following is NOT true regarding daisy-chaining of interrupt vectors?
a)It reduces the number of wires required to connect multiple devices to a CPU.
b)It simplifies the process of adding or removing devices from the system.
c)It allows for prioritization of interrupts based on their position in the chain.
d)It increases the complexity of the interrupt handling circuitry.
18. (GATE 2019) In a computer system with daisy-chained interrupt structure, an interrupt request from a device with a higher priority ca
be serviced
Overview
Peripheral Devices
Input-Output Interface
Modes of Transfer
Priority Interrupt
Input-Output Processor
Input/Output Organization 50
Internal Bus
DMA select DS
Desired location in memory Address register
RS
Word count register
Read RD Word count register
Holds no. of words to be transferred Write WR Control
logic
Control register Bus request BR Control register
Specifies the mode of transfer
Bus grant BG
Interrupt Interrupt DMA request
DMA acknowledge to I/O device
Input/Output Organization 51
(2) Cycle stealing : Alternative technique called cycle stealing allows DMA controller to
transfer one data word at time after which it must return control of
the buses to the CPU.
- CPU merely delays its operation for one memory cycle to allow the
direct memory I/O transfer to “steal” one memory cycle
Input/Output Organization 52
CPU initializes the DMA by sending following information through data bus:
DMA Transfer
Interrupt
Random-access
BG
CPU memory unit (RAM)
BR
RD WR Addr Data RD WR Addr Data
Read control
Write control
Data bus
Address bus
Address
select
RD WR Addr Data
DS DMA ack.
RS DMA I/O
Controller Peripheral
BR device
BG DMA request
Interrupt
Input/Output Organization 55
- Data gathered in IOP at device rate and bit capacity while CPU executing own program
- Transfer between IOP and Device similar to Programmed I/O and
transfer between IOP and Memory similar to DMA
- CPU is master while IOP is slave processor
- CPU initiates the channel by executing a channel I/O class instruction and once initiated,
channel operates independent of the CPU
Central
processing
unit (CPU)
Memory Bus
Peripheral devices
Memory
unit PD PD PD PD
Input-output
processor
(IOP) I/O bus