DDCO Dec24 Unit4
DDCO Dec24 Unit4
INPUT/OUTPUT ORGANIZATION
&
THE MEMORY SYSTEM
Processor Memory
Bus
•Multiple I/O devices may be connected to the processor and the memory
via a bus.
•Bus consists of three sets of lines to carry address, data and control
signals.
•Each I/O device is assigned an unique address.
•To access an I/O device, the processor places the address on the address
lines.
•The device recognizes the address, and responds to the control signals.
1/8/2025 Information Science and Engineering 3
Accessing I/O Devices
I/O devices and the memory may share the same address space:
Memory-mapped I/O.
Any machine instruction that can access memory can be used to
transfer data to or from an I/O device.
Simpler software.
I/O devices and the memory may have different address spaces:
Special instructions to transfer data to and from I/O devices.
I/O devices may have to deal with fewer address lines.
I/O address lines need not be physically separate from memory
address lines.
In fact, address lines may be shared between I/O devices and
memory, with a control signal to indicate whether it is a memory
address or an I/O address.
Input device
•I/O device is connected to the bus using an I/O interface circuit which has:
- Address decoder, control circuit, and data and status registers.
•Address decoder decodes the address placed on the address lines thus
enabling the device to recognize its address.
•Data register holds the data being transferred to or from the processor.
•Status register holds information necessary for the operation of the I/O
device.
•Data and status registers are connected to the data lines, and have unique
addresses.
•I/O interface circuit coordinates I/O transfers.
1/8/2025 Information Science and Engineering 5
Accessing I/O Devices
Recall that the rate of transfer to and from I/O devices is
slower than the speed of the processor. This creates the
need for mechanisms to synchronize data transfers
between them.
Program-controlled I/O:
Processor repeatedly monitors a status flag to achieve
the necessary synchronization.
Processor polls the I/O device.
Two other mechanisms used for synchronizing data
transfers between the processor and memory:
Interrupts.
Direct Memory Access.
Interrupt
occurs i
here
i+1
IN T R 1 INTR p
INTA1 INTA p
Priority arbitration
•If the interrupt request has a higher priority level than the
priority of the processor,
then the request is accepted.
1/8/2025 Information Science and Engineering 21
Interrupts
INTR
Processor
Device Device
INTA1
Processor
IN T R p
Device Device
INTA p
Priority arbitration
circuit
1/8/2025 Information Science and Engineering 25
Interrupts
Main
Processor
memory
System bus
Disk/DMA DMA
Printer Keyboard
controller controller
B BS Y
BR
Processor
DMA DMA
controller controller
BG1 1 BG2 2
• DMA controller requests the control of the bus by asserting the Bus
Request (BR) line.
• BBSY signal is 0, it indicates that the bus is busy. When BBSY becomes
1,1/8/2025
the DMA controller which asserted BR can acquire control of the bus. 36
Information Science and Engineering
Direct Memory Access
Centralized Bus Arbitration
DMA controller 2
asserts the BR signal. T ime
Processor asserts
BR
the BG1 signal
B BS Y
Bus
master
Processor DMA controller 2 Processor
Processor
Re gisters
Increasing Increasing Increasing
size speed cost per bit
Primary L1
cache
Secondary L2
cache
Main
memory
Magnetic disk
secondary
memory
Block 257
because of the need to search all 128 patterns to
Main memory address
determine whether a given block is in the cache.
Block 4095
Set-Associative mapping