SlideShare a Scribd company logo
Chapter 5
Input/Output Organization
 Accessing I / O Devices
 Interrupts
 Direct Memory Access
 Buses
 Interface Circuits
2
Outline
Content Coverage
Main Memory System
Input/Output System
Arithmetic
and
Logic Unit
Operational
Registers
Program
Counter
Control Unit
Address Data/Instruction
Central Processing Unit (CPU)
Cache
memory
Instruction
Sets
3
Accessing I/O Devices
 Single-bus structure
 The bus enables all the devices connected to it to
exchange information
 Typically, the bus consists of three sets of lines used to
carry address, data, and control signals
 Each I / O device is assigned a unique set of addresses
Processor
4
.
Memory
I/O device 1 I/O device n
Bus
I/O Mapping
5
.
 Memory mapped I /O
 Devices and memory share an address space
 I / O looks just like memory read /write
 No special commands for I/ O
 Large selection of memory access commands available
 Isolated I /O
 Separate address spaces
 Need I / O or memory select lines
 Special commands for I /O
 Limited set
Memory-Mapped I/O
6
 When I / O devices and the memory share the same
address space, the arrangement is called memory-
mapped I /O
 With memory-mapped I / O, any machine instruction that
can access memory can be used to transfer data to or from
an I / O device
 Most computer systems use memory-mapped I / O.
 Some processors have special IN and OUT instructions to
perform I / O transfers
 When building a computer system based on these processors, the
designer has the option of connecting I / O devices to usethe
special I / O address space or simply incorporating them as part of
the memory address space
I/O Interface for an Input Device
 The address decoder, the data and status registers, and
the control circuitry required to coordinate I / O transfers
constitute the device’s interface circuit
Control
circuits
Address
decoder
Data and status
registers
Bus
Address lines
Data lines
Control lines
Input device
7
.
I/O Techniques
8
 Programmed
 Interrupt driven
 Direct Memory Access (DMA)
Program-Controlled I/O
 Consider a simple example of I / O operations
involving a keyboard and a display device in a
computer system. The four registers shown
below are used in the data transfer operations
 The two flags KIRQ and DIRQ in STATUS register are
used in conjunction with interrupts
DATAIN
DATAOUT
STATUS
CONTROL
DIRQ KIRQ SOUT SIN
9
DEN KEN
7 6 5 4 3 2 1 0
An Example
Move #LINE, R0 Initialize memory pointer
WAITK TestBit #0,STATUS Test SIN
Branch=0 WAITK Wait for character to be entered
Move DATAIN,R1 Read character
WAITD TestBit #1,STATUS Test SOUT
Branch=0 WAITD Wait for display to become ready
Move R1,DATAOUT Send character to display
Move R1,(R0)+ Store character and advance pointer
Compare #$0D,R1 Check if Carriage Return
Branch=0 WAITK If not, get another character
Move #$0A,DATAOUT Otherwise, send Line Feed
Call PROCESS Call a subroutine to process the
input line
 A program that reads one line from the keyboard,
stores it in memory buffer, and echoes it back to the
display
10
Program-Controlled I/O
11
 The example described above illustrates program-
controlled I / O, in which the processor repeatedly
checks a status flag to achieve the required
synchronization between the processor and an input
or output device. We say that the processor polls the
devices
 There are two other commonly used mechanisms for
implementing I / O operations: interrupts and direct
memory access
 Interrupts: synchronization is achieved by having the I / O
device send a special signal over the bus whenever it is
ready for a data transfer operation
 Direct memory access: it involves having the device
interface transfer data directly to or from the memory
Interrupts
12
 To avoid the processor being not performing any useful
computation, a hardware signal called an interrupt to the
processor can do it.At least one of the bus control lines,
called an interrupt-request line, is usually dedicated for
this purpose An interrupt-service routine usually is needed
and is executed when an interrupt request is issued On
the other hand, the processor must inform the device
that its request has been recognized sothat it may remove
its interrupt-request signal.An interrupt-acknowledge
signal serves this function
Example
Program 1
COMPUTE routine
Program 2
PRINT routine
Interrupt occurs
here
1
2
i
i+1
M
13
Interrupt-Service Routine & Subroutine
14
 Treatment of an interrupt-service routine is very
similar to that of a subroutine
 An important departure from the similarity should
be noted
 A subroutine performs a function required by the program
from which it is called.
 The interrupt-service routine may not have anything in
common with the program being executed at the time the
interrupt request is received. In fact, the two programs
often belong to different users
 Before executing the interrupt-service routine, any
information that may be altered during the execution
of that routine must be saved. This information must
be restored before the interrupted program is
resumed
Interrupt Latency
15
 The information that needs to be saved and restored
typically includes the condition code flags and the
contents of any registers used by both the interrupted
program and the interrupt-service routine
 Saving registers also increases the delay between the
time an interrupt request is received and the start of
execution of the interrupt-service routine. The delay
is called interrupt latency
 Typically, the processor saves only the contents of
the program counter and the processor status register.
Any additional information that needs to be saved
must be saved by program instruction at the
beginning of the interrupt-service routine and
restored at the end of the routine
Interrupt Hardware
 An equivalent circuit for an open-drain bus used
to implement a common interrupt-request line
INTR
INTR1 INTR2 INTRn
Processor
16
INTR
R
Vdd
INTR=INTR1+INTR2+…+INTRn
Handling Multiple Devices
17
 Handling multiple devices gives rise to a number of
questions:
 How can the processor recogniz e the device requesting an
interrupt?
 Given that different devices are likely to require different
interrupt-service routines, how can the processor obtain the
starting address of the approp riate routine in each case?
 Should a device be allowed to interrupt the processor while
another interrupt is being serviced?
 How should two or more simult aneous interrupt request be
handled?
 The information needed to determine whether a
device is requesting an interrupt is available in its
status register
 When a device raises an interrupt request, it sets to 1 one of
the bits in its status register , which we will call the IRQ bit
Identify the Interrupting Device
18
 The simplest way to identify the interrupting device
is to have the interrupt-service routine poll all the
I / O devices connected to the bus
 The polling scheme is easy to implement. Its main
disadvantage is the time spen t interrogating all the devices
 A device requesting an interrupt may identify itself
directly to the processor. Then, the processor can
immediately start executing the corresponding
interrupt-service routine. This is called vectored
interrupts
 An interrupt request from a high-priority device
should be accepted while the processor is servicing
another request from a lower-priority device
Interrupt Priority
19
 The processor’s priority is usually encoded in a few
bits of the processor status word. It can be changed
by program instructions that write into the program
status register (PS). These are privileged instructions,
which can be executed only while the processor is
running in the supervisor mode
 The processor is in the su pervisor mode only when
executing operating system routines. It switches to
the user mode before beginning to execute
application program
 An attempt to execute a privileged instruction while
in the user mode leads to a special type of interrupt
called a privilege exception
Implementation of Interrupt Priority
 An example of the implementation of a multiple-
priority scheme
Processor
Device 1 Device 2 Device p
INTA1
INTR1
Priority arbitration
circuit
INTRp
INTAp
20
Simultaneous Requests
 Consider the problem of simultaneous arrivals of
interrupt requests from two or more devices. The
processor must have some means of deciding
which request to service first
 Interrupt priority scheme with daisy chain
Device 1 Device 2 Device n
INTA
INTR
Processor
21
Priority Group
 Combination of the interrupt priority scheme
with daisy chain and with individual interrupt-
request and interrupt-acknowledge lines
Processor
Priority arbitration
circuit
Device Device Device
INTA1
INTR1
Device Device Device
INTAp
INTRp
22
Direct Memory Access
23
 To transfer large blocks of data at high speed, a
special control unit may be provided between an
external device and the main memory, without
continuous intervention by the processor. This
approach is called direct memory access (DMA)
 DMA transfers are performed by a control circuit that
is part of the I / O device in terface. We refer to this
circuit as a DMA controller.
 Since it has to transfer blocks of data, the DMA
controller must increment the memory address for
successive words and keep track of the number of
transfers
DMA Controller
 Although a DMA controller can transfer data
without intervention by the processor, its
operation must be under the control of a program
executed by the processor
 An example
31 30 1 0
Status and control
IRQ
IE
Starting address
Word count
Done
R/W
24
DMA Controller in a Computer System
Processor
Main
memory
Disk/DMA
controller
System bus
DMA
controller
Printer Keyboard
Disk Disk
Network
Interface
25
Memory Access Priority
26
 Memory accesses by the processor and the DMA
controllers are interwoven. Request by DMA devices
for using the bus are always given higher priority
than processor requests.
 Among different DMA devices, top priority is given
to high-speed peripherals such as a disk, a high-
speed network interface, etc.
 Since the processor originates most memory access
cycles, the DMA controller can be said to “steal”
memory cycles from the processor. Hence, this
interweaving technique is usually called cycle stealing
 The DMA controller may transfer a block of data
without interruption. This is called block/burst mode
Bus Arbitration
27
 A conflict may arise if both the processor and a DMA
controller or two DMA controllers try to use the bus
at the same time to access the main memory. To
resolve this problem, an arbitration procedure on bus
is needed
 The device that is allowed to initiate data transfer on
the bus at any given time is called the bus master.
When the current master relinquishes control of the
bus, another device can acquire this status
 Bus arbitration is the process by which the next
device to become the bus master take into account
the needs of various devices by establishing a
priority system for gaining access to the bus
Bus Arbitration
28
 There are two approaches to bus arbitration
 Centralized and distributed
 In centralized arbitration, a single bus arbiter
performs the required arbitration
 In distributed arbitration, all devices participate
in the selection of the next bus master
Centralized Arbitration
DMA
Controller 1
BG1
Processor
DMA
Controller 2
BBSY
BR
BG2
BR
BG1
BG2
BBSY
Processor
29
DMA controller 2 Processor
Distributed Arbitration
ARB3
ARB2
ARB1
ARB0
Start-Arbitration
Vcc
30
O.C.
Interface circuit for device A
0 1 0 1 0 1 1 1
Assume that IDs of A and B are 5 and 6.
Also, the code seen by both devices is 0111
Buses
31
 A bus protocol is the set of rules that govern the
behavior of various devices connected to the bus
as to when to place information on the bus, assert
control signals, and so on
 In a synchronous bus, all devices derive timing
information from a common clock line. Equal
spaced pulses on this line define equal time
intervals
 In the simplest form of a synchronous bus, each
of these intervals constitutes a bus cycle during
which one data transfer can take place
A Synchronous Bus Example
t2
32
.
t1
t0
Bus clock
Address and
command
Data
Bus Cycle
 Timing of an input transfer on a synchronous bus
A Synchronous Bus Example
 Detail timing diagram
t2
tAM
Bus clock
Address and
command
Data
t1
tAS
tDM
tDS
t1
Data
Seen by slave
Address and
command
Seen by master
Slave send the
requested data
33
.
Input Transfer Using Multiple Clock Cycles
Clock
Address
Command
Data
Slave-ready
34
1 2 3 4
Asynchronous Bus
 An alternative scheme for controlling data
transfers on the bus is based on the use of a
handshake between the master and slave
Address
and command
Master-ready
Slave-ready
Data
t3 t4 t5
t0 t1 t2
Bus cycle
35
Asynchronous Bus
 Handshake control of data transfer during an
output operation
Address
and command
Data
t3 t4 t5
t0 t1 t2
Bus cycle
36
Master-ready
Slave-ready
Discussion
37
 The choice of a particular design involves trade-offs
among factors such as
 Simplicity of the device interface
 Ability to accommodate device interfaces that introduce different
amounts of delay
 Total time required for bus transfer
 Ability to detect errors results from addressing a nonexistent
device or from an interface malfunction
 Asynchronous bus
 The handshake process eliminates the need for synchronization
of the sender and receiver clock, thus simplifying timing design
 Synchronous bus
 Clock circuitry must be designed carefully to ensure proper
synchronization, and delays must be kept within strict bounds
Interface Circuits
 Keyboard to processor connection
 When a key is pressed, the Valid signal changes from 0
o 1, causing the ASCII code to be loaded into DATAIN
and SIN to be set to 1
 The status flag SIN is cleared to 0 when the processor
reads the contents of the DATAIN register
Processor
Encoder
and
Debouncing
circuit
DATAIN
SIN
Input
Interface
Keyboard
switches
Valid
Data
Data
Address
Master-ready
Slave-ready
R/W
38
Input Interface Circuit
Address
decoder
Status
flag
Q7 D7
Q0 D0
Slave-
ready
D7
D0
SIN
Keyboard
data
Valid
A1
A0
Read-
data
status
1
Read-
R/W
Master-
ready
A31
DATAIN
39
Circuit for the Status Flag Block
Q D
Q
SIN
40
Read-data
Master-ready
1
Valid
Clear
Printer to Processor Connection
 The interface contains a data register, DATAOUT,
and a status flag, SOUT
 The SOUT flag is set to 1 when the printer is ready to accept
another character, and it is cleared to 0 when a new
character is loaded into DATAOUT by the processor
 When the printer is ready to acce pt a character, it asserts its
idle signal
Processor
DATAOUT
SOUT
Output
Interface
Data
Address
Master-ready
Slave-ready
R/W Printer
Idle
Data
Valid
41
Output Interface Circuit
Address
decoder
Handshake
control
D7 Q7
Slave-
ready
D7
SOUT
Printer
data
Idle
Valid
A1
A0
Load-
data
status
1
Read-
DATAOUT
R/W
Master-
ready
A31
D1
D0
D1 Q1
D0 Q0
42
A General 8-Bit Parallel Interface
DATAIN
DATAOUT
Data
Direction
Register
D7
43
D0
P7
P0
Output Interface Circuit for a Bus Protocol
Address
decoder
Handshake
control
D7 Q7
D7
SOUT
Printer
data
Load-
data
Read-
status
D1
D0
D1 Q1
D0 Q0
Idle
Valid
A1
A0
Clock
My-
address Timing
Logic
Go
Respond
Go=1
Idle
My-address
44
DATAOUT
R/W
Slave-
ready
A31
Timing Diagram for an Output Operation
Go
Slave-ready
Time
1 2 3
Clock
Address
R/W
Data
45
Serial Port
46
 A serial port is used to connect the processor to
I / O devices that require transmission of data one
bit at a time
 The key feature of an interface circuit for a serial
port is that it is capable of communicating in a
bit-serial fashion on the device side and in a bit-
parallel fashion on the bus side
 The transformation between the parallel and
serial formats is achieved with shift registers that
have parallel access capability
A Serial Interface
Input shift register
DATAIN
DATAOUT
Output shift register
Serial input
47
Serial output
D7
D0

More Related Content

What's hot

8085 mpu bus architecture
8085 mpu bus architecture8085 mpu bus architecture
8085 mpu bus architecture
MdHaque78
 
Basic ops concept of comp
Basic ops  concept of compBasic ops  concept of comp
Basic ops concept of comp
gaurav jain
 
Unit2 arm
Unit2 armUnit2 arm
Unit2 arm
Karthik Vivek
 
Interfacing rs232
Interfacing rs232Interfacing rs232
Interfacing rs232
PRADEEP
 
8086
80868086
Instruction Execution Cycle
Instruction Execution CycleInstruction Execution Cycle
Instruction Execution Cycle
utsav_shah
 
Intel Pentium Pro
Intel Pentium ProIntel Pentium Pro
Intel Pentium Pro
Muhtasim Fuad Rafid
 
Introduction to embedded systems
Introduction  to embedded systemsIntroduction  to embedded systems
Introduction to embedded systems
RAMPRAKASHT1
 
The Basic Organization of Computers
The Basic Organization of ComputersThe Basic Organization of Computers
The Basic Organization of Computers
Tallat Satti
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
RamaPrabha24
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
Jismy .K.Jose
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
SOMASUNDARAM T
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
Emertxe Information Technologies Pvt Ltd
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
Deepak John
 
Uart
UartUart
Uart
cs1090211
 
Direct memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA ControllerDirect memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA Controller
Muhammed Afsal Villan
 
80486 microprocessor
80486 microprocessor80486 microprocessor
80486 microprocessor
Mihika Shah
 
Unit 4
Unit 4Unit 4
Unit 4
tamilnesaner
 
Computer instruction
Computer instructionComputer instruction
Computer instruction
Sanjeev Patel
 
Microinstruction sequencing new
Microinstruction sequencing newMicroinstruction sequencing new
Microinstruction sequencing new
Mahesh Kumar Attri
 

What's hot (20)

8085 mpu bus architecture
8085 mpu bus architecture8085 mpu bus architecture
8085 mpu bus architecture
 
Basic ops concept of comp
Basic ops  concept of compBasic ops  concept of comp
Basic ops concept of comp
 
Unit2 arm
Unit2 armUnit2 arm
Unit2 arm
 
Interfacing rs232
Interfacing rs232Interfacing rs232
Interfacing rs232
 
8086
80868086
8086
 
Instruction Execution Cycle
Instruction Execution CycleInstruction Execution Cycle
Instruction Execution Cycle
 
Intel Pentium Pro
Intel Pentium ProIntel Pentium Pro
Intel Pentium Pro
 
Introduction to embedded systems
Introduction  to embedded systemsIntroduction  to embedded systems
Introduction to embedded systems
 
The Basic Organization of Computers
The Basic Organization of ComputersThe Basic Organization of Computers
The Basic Organization of Computers
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
 
Uart
UartUart
Uart
 
Direct memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA ControllerDirect memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA Controller
 
80486 microprocessor
80486 microprocessor80486 microprocessor
80486 microprocessor
 
Unit 4
Unit 4Unit 4
Unit 4
 
Computer instruction
Computer instructionComputer instruction
Computer instruction
 
Microinstruction sequencing new
Microinstruction sequencing newMicroinstruction sequencing new
Microinstruction sequencing new
 

Similar to Computer organization

Io pro
Io proIo pro
Io pro
cs19club
 
Io pro
Io proIo pro
Io pro
cs19club
 
IO organization.ppt
IO organization.pptIO organization.ppt
IO organization.ppt
DeepaThirumurugan
 
unit-5 ppt.ppt
unit-5 ppt.pptunit-5 ppt.ppt
unit-5 ppt.ppt
SheebaKelvin2
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4
Dr.MAYA NAYAK
 
Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003
Swathi Veeradhi
 
420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx
ddscraft123
 
CO--MODULE-1 (b) - Input-Output-Organization.pptx
CO--MODULE-1 (b) - Input-Output-Organization.pptxCO--MODULE-1 (b) - Input-Output-Organization.pptx
CO--MODULE-1 (b) - Input-Output-Organization.pptx
ahmedsalik057
 
8555046.ppt
8555046.ppt8555046.ppt
8555046.ppt
ssuser1b065a
 
IO hardware
IO hardwareIO hardware
IO hardware
sangrampatil81
 
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxUNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
LeahRachael
 
Ca 2 note mano
Ca 2 note manoCa 2 note mano
Ca 2 note mano
Manoharan Ragavan
 
chapter7-io organization.pptx
chapter7-io organization.pptxchapter7-io organization.pptx
chapter7-io organization.pptx
gracemann365
 
Microprocessor_IO Interfacing.ppt
Microprocessor_IO Interfacing.pptMicroprocessor_IO Interfacing.ppt
Microprocessor_IO Interfacing.ppt
Pratheep Ganesan
 
Unit no 05
Unit no 05Unit no 05
Unit no 05
MohanChimanna
 
I/O System
I/O SystemI/O System
I/O System
Nagarajan
 
CH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdfCH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdf
cauuthovohoaichau
 
Computer oganization input-output
Computer oganization input-outputComputer oganization input-output
Computer oganization input-output
Deepak John
 
Iosystemspre final-160922112930
Iosystemspre final-160922112930Iosystemspre final-160922112930
Iosystemspre final-160922112930
marangburu42
 
Io systems final
Io systems finalIo systems final
Io systems final
marangburu42
 

Similar to Computer organization (20)

Io pro
Io proIo pro
Io pro
 
Io pro
Io proIo pro
Io pro
 
IO organization.ppt
IO organization.pptIO organization.ppt
IO organization.ppt
 
unit-5 ppt.ppt
unit-5 ppt.pptunit-5 ppt.ppt
unit-5 ppt.ppt
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4
 
Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003Unit2 p1 io organization-97-2003
Unit2 p1 io organization-97-2003
 
420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx420214730-15cs34-module-2-pptx.pptx
420214730-15cs34-module-2-pptx.pptx
 
CO--MODULE-1 (b) - Input-Output-Organization.pptx
CO--MODULE-1 (b) - Input-Output-Organization.pptxCO--MODULE-1 (b) - Input-Output-Organization.pptx
CO--MODULE-1 (b) - Input-Output-Organization.pptx
 
8555046.ppt
8555046.ppt8555046.ppt
8555046.ppt
 
IO hardware
IO hardwareIO hardware
IO hardware
 
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxUNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
 
Ca 2 note mano
Ca 2 note manoCa 2 note mano
Ca 2 note mano
 
chapter7-io organization.pptx
chapter7-io organization.pptxchapter7-io organization.pptx
chapter7-io organization.pptx
 
Microprocessor_IO Interfacing.ppt
Microprocessor_IO Interfacing.pptMicroprocessor_IO Interfacing.ppt
Microprocessor_IO Interfacing.ppt
 
Unit no 05
Unit no 05Unit no 05
Unit no 05
 
I/O System
I/O SystemI/O System
I/O System
 
CH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdfCH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdf
 
Computer oganization input-output
Computer oganization input-outputComputer oganization input-output
Computer oganization input-output
 
Iosystemspre final-160922112930
Iosystemspre final-160922112930Iosystemspre final-160922112930
Iosystemspre final-160922112930
 
Io systems final
Io systems finalIo systems final
Io systems final
 

More from Rvishnupriya2

Advanced Software Engineering.ppt
Advanced Software Engineering.pptAdvanced Software Engineering.ppt
Advanced Software Engineering.ppt
Rvishnupriya2
 
Cluster Analysis.pptx
Cluster Analysis.pptxCluster Analysis.pptx
Cluster Analysis.pptx
Rvishnupriya2
 
Data Mining.ppt
Data Mining.pptData Mining.ppt
Data Mining.ppt
Rvishnupriya2
 
Data Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.pptData Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.ppt
Rvishnupriya2
 
Data Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.pptData Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.ppt
Rvishnupriya2
 
Rdbms
Rdbms Rdbms
Programming in C
Programming in CProgramming in C
Programming in C
Rvishnupriya2
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
Rvishnupriya2
 

More from Rvishnupriya2 (8)

Advanced Software Engineering.ppt
Advanced Software Engineering.pptAdvanced Software Engineering.ppt
Advanced Software Engineering.ppt
 
Cluster Analysis.pptx
Cluster Analysis.pptxCluster Analysis.pptx
Cluster Analysis.pptx
 
Data Mining.ppt
Data Mining.pptData Mining.ppt
Data Mining.ppt
 
Data Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.pptData Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.ppt
 
Data Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.pptData Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.ppt
 
Rdbms
Rdbms Rdbms
Rdbms
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 

Recently uploaded

一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
kuehcub
 
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
nudduv
 
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDARLORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
lorraineandreiamcidl
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
terpt4iu
 
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
ei8c4cba
 
Why is the AIS 140 standard Mandatory in India?
Why is the AIS 140 standard Mandatory in India?Why is the AIS 140 standard Mandatory in India?
Why is the AIS 140 standard Mandatory in India?
Watsoo Telematics
 
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
xuqdabu
 
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
snfdnzl7
 
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
1jtj7yul
 
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
yizxn4sx
 
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
eydeofo
 
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
u0g33km
 
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
1jtj7yul
 
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
8db3cz8x
 
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
2g3om49r
 
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
zpc0z12
 
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
terpt4iu
 
Production.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd ddddddddddddddddddddddddddddddddddProduction.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd dddddddddddddddddddddddddddddddddd
DanielOliver74
 
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalRBuilding a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Peter Gallagher
 
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
aozcue
 

Recently uploaded (20)

一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
 
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
 
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDARLORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
 
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
 
Why is the AIS 140 standard Mandatory in India?
Why is the AIS 140 standard Mandatory in India?Why is the AIS 140 standard Mandatory in India?
Why is the AIS 140 standard Mandatory in India?
 
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
 
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
 
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
 
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
 
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
 
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
 
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
 
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
 
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
 
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
 
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
 
Production.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd ddddddddddddddddddddddddddddddddddProduction.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd dddddddddddddddddddddddddddddddddd
 
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalRBuilding a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
 
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
 

Computer organization

  • 2.  Accessing I / O Devices  Interrupts  Direct Memory Access  Buses  Interface Circuits 2 Outline
  • 3. Content Coverage Main Memory System Input/Output System Arithmetic and Logic Unit Operational Registers Program Counter Control Unit Address Data/Instruction Central Processing Unit (CPU) Cache memory Instruction Sets 3
  • 4. Accessing I/O Devices  Single-bus structure  The bus enables all the devices connected to it to exchange information  Typically, the bus consists of three sets of lines used to carry address, data, and control signals  Each I / O device is assigned a unique set of addresses Processor 4 . Memory I/O device 1 I/O device n Bus
  • 5. I/O Mapping 5 .  Memory mapped I /O  Devices and memory share an address space  I / O looks just like memory read /write  No special commands for I/ O  Large selection of memory access commands available  Isolated I /O  Separate address spaces  Need I / O or memory select lines  Special commands for I /O  Limited set
  • 6. Memory-Mapped I/O 6  When I / O devices and the memory share the same address space, the arrangement is called memory- mapped I /O  With memory-mapped I / O, any machine instruction that can access memory can be used to transfer data to or from an I / O device  Most computer systems use memory-mapped I / O.  Some processors have special IN and OUT instructions to perform I / O transfers  When building a computer system based on these processors, the designer has the option of connecting I / O devices to usethe special I / O address space or simply incorporating them as part of the memory address space
  • 7. I/O Interface for an Input Device  The address decoder, the data and status registers, and the control circuitry required to coordinate I / O transfers constitute the device’s interface circuit Control circuits Address decoder Data and status registers Bus Address lines Data lines Control lines Input device 7 .
  • 8. I/O Techniques 8  Programmed  Interrupt driven  Direct Memory Access (DMA)
  • 9. Program-Controlled I/O  Consider a simple example of I / O operations involving a keyboard and a display device in a computer system. The four registers shown below are used in the data transfer operations  The two flags KIRQ and DIRQ in STATUS register are used in conjunction with interrupts DATAIN DATAOUT STATUS CONTROL DIRQ KIRQ SOUT SIN 9 DEN KEN 7 6 5 4 3 2 1 0
  • 10. An Example Move #LINE, R0 Initialize memory pointer WAITK TestBit #0,STATUS Test SIN Branch=0 WAITK Wait for character to be entered Move DATAIN,R1 Read character WAITD TestBit #1,STATUS Test SOUT Branch=0 WAITD Wait for display to become ready Move R1,DATAOUT Send character to display Move R1,(R0)+ Store character and advance pointer Compare #$0D,R1 Check if Carriage Return Branch=0 WAITK If not, get another character Move #$0A,DATAOUT Otherwise, send Line Feed Call PROCESS Call a subroutine to process the input line  A program that reads one line from the keyboard, stores it in memory buffer, and echoes it back to the display 10
  • 11. Program-Controlled I/O 11  The example described above illustrates program- controlled I / O, in which the processor repeatedly checks a status flag to achieve the required synchronization between the processor and an input or output device. We say that the processor polls the devices  There are two other commonly used mechanisms for implementing I / O operations: interrupts and direct memory access  Interrupts: synchronization is achieved by having the I / O device send a special signal over the bus whenever it is ready for a data transfer operation  Direct memory access: it involves having the device interface transfer data directly to or from the memory
  • 12. Interrupts 12  To avoid the processor being not performing any useful computation, a hardware signal called an interrupt to the processor can do it.At least one of the bus control lines, called an interrupt-request line, is usually dedicated for this purpose An interrupt-service routine usually is needed and is executed when an interrupt request is issued On the other hand, the processor must inform the device that its request has been recognized sothat it may remove its interrupt-request signal.An interrupt-acknowledge signal serves this function
  • 13. Example Program 1 COMPUTE routine Program 2 PRINT routine Interrupt occurs here 1 2 i i+1 M 13
  • 14. Interrupt-Service Routine & Subroutine 14  Treatment of an interrupt-service routine is very similar to that of a subroutine  An important departure from the similarity should be noted  A subroutine performs a function required by the program from which it is called.  The interrupt-service routine may not have anything in common with the program being executed at the time the interrupt request is received. In fact, the two programs often belong to different users  Before executing the interrupt-service routine, any information that may be altered during the execution of that routine must be saved. This information must be restored before the interrupted program is resumed
  • 15. Interrupt Latency 15  The information that needs to be saved and restored typically includes the condition code flags and the contents of any registers used by both the interrupted program and the interrupt-service routine  Saving registers also increases the delay between the time an interrupt request is received and the start of execution of the interrupt-service routine. The delay is called interrupt latency  Typically, the processor saves only the contents of the program counter and the processor status register. Any additional information that needs to be saved must be saved by program instruction at the beginning of the interrupt-service routine and restored at the end of the routine
  • 16. Interrupt Hardware  An equivalent circuit for an open-drain bus used to implement a common interrupt-request line INTR INTR1 INTR2 INTRn Processor 16 INTR R Vdd INTR=INTR1+INTR2+…+INTRn
  • 17. Handling Multiple Devices 17  Handling multiple devices gives rise to a number of questions:  How can the processor recogniz e the device requesting an interrupt?  Given that different devices are likely to require different interrupt-service routines, how can the processor obtain the starting address of the approp riate routine in each case?  Should a device be allowed to interrupt the processor while another interrupt is being serviced?  How should two or more simult aneous interrupt request be handled?  The information needed to determine whether a device is requesting an interrupt is available in its status register  When a device raises an interrupt request, it sets to 1 one of the bits in its status register , which we will call the IRQ bit
  • 18. Identify the Interrupting Device 18  The simplest way to identify the interrupting device is to have the interrupt-service routine poll all the I / O devices connected to the bus  The polling scheme is easy to implement. Its main disadvantage is the time spen t interrogating all the devices  A device requesting an interrupt may identify itself directly to the processor. Then, the processor can immediately start executing the corresponding interrupt-service routine. This is called vectored interrupts  An interrupt request from a high-priority device should be accepted while the processor is servicing another request from a lower-priority device
  • 19. Interrupt Priority 19  The processor’s priority is usually encoded in a few bits of the processor status word. It can be changed by program instructions that write into the program status register (PS). These are privileged instructions, which can be executed only while the processor is running in the supervisor mode  The processor is in the su pervisor mode only when executing operating system routines. It switches to the user mode before beginning to execute application program  An attempt to execute a privileged instruction while in the user mode leads to a special type of interrupt called a privilege exception
  • 20. Implementation of Interrupt Priority  An example of the implementation of a multiple- priority scheme Processor Device 1 Device 2 Device p INTA1 INTR1 Priority arbitration circuit INTRp INTAp 20
  • 21. Simultaneous Requests  Consider the problem of simultaneous arrivals of interrupt requests from two or more devices. The processor must have some means of deciding which request to service first  Interrupt priority scheme with daisy chain Device 1 Device 2 Device n INTA INTR Processor 21
  • 22. Priority Group  Combination of the interrupt priority scheme with daisy chain and with individual interrupt- request and interrupt-acknowledge lines Processor Priority arbitration circuit Device Device Device INTA1 INTR1 Device Device Device INTAp INTRp 22
  • 23. Direct Memory Access 23  To transfer large blocks of data at high speed, a special control unit may be provided between an external device and the main memory, without continuous intervention by the processor. This approach is called direct memory access (DMA)  DMA transfers are performed by a control circuit that is part of the I / O device in terface. We refer to this circuit as a DMA controller.  Since it has to transfer blocks of data, the DMA controller must increment the memory address for successive words and keep track of the number of transfers
  • 24. DMA Controller  Although a DMA controller can transfer data without intervention by the processor, its operation must be under the control of a program executed by the processor  An example 31 30 1 0 Status and control IRQ IE Starting address Word count Done R/W 24
  • 25. DMA Controller in a Computer System Processor Main memory Disk/DMA controller System bus DMA controller Printer Keyboard Disk Disk Network Interface 25
  • 26. Memory Access Priority 26  Memory accesses by the processor and the DMA controllers are interwoven. Request by DMA devices for using the bus are always given higher priority than processor requests.  Among different DMA devices, top priority is given to high-speed peripherals such as a disk, a high- speed network interface, etc.  Since the processor originates most memory access cycles, the DMA controller can be said to “steal” memory cycles from the processor. Hence, this interweaving technique is usually called cycle stealing  The DMA controller may transfer a block of data without interruption. This is called block/burst mode
  • 27. Bus Arbitration 27  A conflict may arise if both the processor and a DMA controller or two DMA controllers try to use the bus at the same time to access the main memory. To resolve this problem, an arbitration procedure on bus is needed  The device that is allowed to initiate data transfer on the bus at any given time is called the bus master. When the current master relinquishes control of the bus, another device can acquire this status  Bus arbitration is the process by which the next device to become the bus master take into account the needs of various devices by establishing a priority system for gaining access to the bus
  • 28. Bus Arbitration 28  There are two approaches to bus arbitration  Centralized and distributed  In centralized arbitration, a single bus arbiter performs the required arbitration  In distributed arbitration, all devices participate in the selection of the next bus master
  • 29. Centralized Arbitration DMA Controller 1 BG1 Processor DMA Controller 2 BBSY BR BG2 BR BG1 BG2 BBSY Processor 29 DMA controller 2 Processor
  • 30. Distributed Arbitration ARB3 ARB2 ARB1 ARB0 Start-Arbitration Vcc 30 O.C. Interface circuit for device A 0 1 0 1 0 1 1 1 Assume that IDs of A and B are 5 and 6. Also, the code seen by both devices is 0111
  • 31. Buses 31  A bus protocol is the set of rules that govern the behavior of various devices connected to the bus as to when to place information on the bus, assert control signals, and so on  In a synchronous bus, all devices derive timing information from a common clock line. Equal spaced pulses on this line define equal time intervals  In the simplest form of a synchronous bus, each of these intervals constitutes a bus cycle during which one data transfer can take place
  • 32. A Synchronous Bus Example t2 32 . t1 t0 Bus clock Address and command Data Bus Cycle  Timing of an input transfer on a synchronous bus
  • 33. A Synchronous Bus Example  Detail timing diagram t2 tAM Bus clock Address and command Data t1 tAS tDM tDS t1 Data Seen by slave Address and command Seen by master Slave send the requested data 33 .
  • 34. Input Transfer Using Multiple Clock Cycles Clock Address Command Data Slave-ready 34 1 2 3 4
  • 35. Asynchronous Bus  An alternative scheme for controlling data transfers on the bus is based on the use of a handshake between the master and slave Address and command Master-ready Slave-ready Data t3 t4 t5 t0 t1 t2 Bus cycle 35
  • 36. Asynchronous Bus  Handshake control of data transfer during an output operation Address and command Data t3 t4 t5 t0 t1 t2 Bus cycle 36 Master-ready Slave-ready
  • 37. Discussion 37  The choice of a particular design involves trade-offs among factors such as  Simplicity of the device interface  Ability to accommodate device interfaces that introduce different amounts of delay  Total time required for bus transfer  Ability to detect errors results from addressing a nonexistent device or from an interface malfunction  Asynchronous bus  The handshake process eliminates the need for synchronization of the sender and receiver clock, thus simplifying timing design  Synchronous bus  Clock circuitry must be designed carefully to ensure proper synchronization, and delays must be kept within strict bounds
  • 38. Interface Circuits  Keyboard to processor connection  When a key is pressed, the Valid signal changes from 0 o 1, causing the ASCII code to be loaded into DATAIN and SIN to be set to 1  The status flag SIN is cleared to 0 when the processor reads the contents of the DATAIN register Processor Encoder and Debouncing circuit DATAIN SIN Input Interface Keyboard switches Valid Data Data Address Master-ready Slave-ready R/W 38
  • 39. Input Interface Circuit Address decoder Status flag Q7 D7 Q0 D0 Slave- ready D7 D0 SIN Keyboard data Valid A1 A0 Read- data status 1 Read- R/W Master- ready A31 DATAIN 39
  • 40. Circuit for the Status Flag Block Q D Q SIN 40 Read-data Master-ready 1 Valid Clear
  • 41. Printer to Processor Connection  The interface contains a data register, DATAOUT, and a status flag, SOUT  The SOUT flag is set to 1 when the printer is ready to accept another character, and it is cleared to 0 when a new character is loaded into DATAOUT by the processor  When the printer is ready to acce pt a character, it asserts its idle signal Processor DATAOUT SOUT Output Interface Data Address Master-ready Slave-ready R/W Printer Idle Data Valid 41
  • 42. Output Interface Circuit Address decoder Handshake control D7 Q7 Slave- ready D7 SOUT Printer data Idle Valid A1 A0 Load- data status 1 Read- DATAOUT R/W Master- ready A31 D1 D0 D1 Q1 D0 Q0 42
  • 43. A General 8-Bit Parallel Interface DATAIN DATAOUT Data Direction Register D7 43 D0 P7 P0
  • 44. Output Interface Circuit for a Bus Protocol Address decoder Handshake control D7 Q7 D7 SOUT Printer data Load- data Read- status D1 D0 D1 Q1 D0 Q0 Idle Valid A1 A0 Clock My- address Timing Logic Go Respond Go=1 Idle My-address 44 DATAOUT R/W Slave- ready A31
  • 45. Timing Diagram for an Output Operation Go Slave-ready Time 1 2 3 Clock Address R/W Data 45
  • 46. Serial Port 46  A serial port is used to connect the processor to I / O devices that require transmission of data one bit at a time  The key feature of an interface circuit for a serial port is that it is capable of communicating in a bit-serial fashion on the device side and in a bit- parallel fashion on the bus side  The transformation between the parallel and serial formats is achieved with shift registers that have parallel access capability
  • 47. A Serial Interface Input shift register DATAIN DATAOUT Output shift register Serial input 47 Serial output D7 D0