Title: CoE EE 00142 Computer Organization Set 10 InputOutput
1CoE - EE 00142Computer OrganizationSet 10 -
Input/Output
2Five Computer Components
3I/O Device Speeds
Fig 8.2
4Basic Computer Organization
5Computer Buses
- Bus - collection of signal wires that carry a
binary number - Word comes from Bus Bar
- big copper strips used to distribute electric
- Buses now used to distribute information
- between memory and cache, memory and disk, disk
and I/O, etc.
6Computer Buses
- Physically - wires etched to back plane of mother
board - Logically - typical bus configuration
- address bus
- data bus
- control bus
- Parallel or serial
76800 Bus Structure
8Typical Bus Structure
9Example Bus Signals
- Data bus - Bits (0 - n) of data
- Address bus - Bits (0 - n) of address
- Control bus examples
- Write address bus control line
- Write data bus control line
- Read address bus control line
- Read data bus control line
10Three State Buffer
When EN 1, output input When EN 0, output
Hi Impedance
Use the tri-state or three state buffer to
connect to any bus line
Graphics from Logic and Computer Design
Fundamentals, Mano Kime, Prentice Hall
11Bus Arbitration
- Deciding who can read or write on the bus at a
given time - Control of source destination
- Deciding who is in control is called bus
arbitration
12Daisy Chaining
- Unit requests use of bus - bus request
- Current user finishes, lowering -bus busy
- Arbitrator (logic unit) raises - bus grant
- Bus grant is passed down along the daisy chain
until accepted by a unit which then raises - bus
busy
13Daisy Chain Bus Structure
14Daisy Chain Bus Example
A - unit 3 has bus B - unit 4 requests C - unit 2
requests D - unit 3 releases E - unit 1 passes to
2 F - unit 2 takes bus unit 4 is still
waiting
15Fairness of Arbitration
- Unit closest to arbiter dominates
- highest priority
- Daisy chain called a priority chain
- Some units could be starved from the bus
- Priority - function of physical position
- Daisy chain slow
16Other Arbiters Philosophies
- Run separate request/grant lines
- flexible but lots of wires
- Arbiter can poll
- fair if round robin - start where it leaves off
17Independent Request - Grant Lines
Flexible - but lots of wires
18Polling Bus Structure
Fairer - if round robin polling
19General Classes of I/O
- Programmed input-output
- Interrupt driven
- Direct memory access
20Programmed Input Output
- Simplest form
- Specific commands to input or output data
- Wastes time
- Low transfer rate
- Uses accumulator for transfer
21Interrupt Driven I/O
- Provides for multiprogramming
- execute multiple programs concurrently
- Interrupt vector
- one memory address for each interrupt
- points to service subroutine
- Context switch
- saving register status and switching programs
22What are Interrupts
- An interrupt is a special event
- Causes CPU to stop normal execution
- Generated externally or internally
- Must provide for return to normal execution
23Types of Interrupts
- External
- Coordinates I/O activities
- Routine tasks time of day
- Internal
- Illegal Op Codes
- Traps and exceptions
24Interrupt Concepts
- Mask ability
- Allow some interrupts to be ignored
- Priority
- Allows some interrupts higher priority
- Service Routine
- The program initiated by the interrupt (example
input keyboard character) - Interrupt vector
- Starting addresses of service routines for each
interrupt
25Normal Interrupt Process
- When an interrupt occurs
- Save the CPU status
- Identify the cause of the interrupt
- Resolve the starting address of the corresponding
service routine - Execute the service routine
- Restore the CPU status
- Restart the interrupted program
26Tannenbaum, Prentice Hall
27Example 68HC11 Interrupt System
- System supports
- 16 Hardware interrupts
- Real time clock, serial port, etc.
- 2 Software interrupts
- Divide by zero, overflow, illegal codes, etc.
- 3 Resets
- Power on, manual, etc.
2868HC11 Interrupt Vector Address and Priority
2968HC11 Interrupt Handling Procedure
- When an interrupt occurs
- CPU saves registers on stack
- I bit of CCR is set to a 1 to disable further
interrupts - Starting address of service routine is fetched
from predefined table - Program is executed at that address
3068HC11 Interrupt Stacking Order
31Example of Interrupt
Consider the following program segment
32(No Transcript)
33Interrupt Overhead
- In the 68HC11
- Saving the CPU registers and fetching the
interrupt vector address takes 12 clock cycles - The RTI instruction restores the registers and
takes an additional 12 clock cycles - Interrupt total is 24 plus the service routine
cycles
34Direct Memory Access
- Independent transfer of data from I/O to memory
- Instruction has start-stop locations
- Requires considerable extra logic
- Cycle steals
35Discrete Continuous Conversion
- Real world devices are analog or continuous
signals - To monitor or control requires conversion of
signals - Digital to analog - D/A
- Analog to digital A/D
36Digital-to-Analog Conversion
Let ai (0, const)
37Consider the effect of a0 on Vout
38Consider the resistance to the left of the node
with voltage V0
R??R R/2
etc.
39Then the resistance to the left of the node with
voltage V0 is simply R
Finally, using a voltage divider, V0
((R/2)/(RR/2)) a0 1/3 a0
40Now consider the portion of the voltage V0 which
exists across V1
V1 ((R/2) / (R/2 R/2)) V0 ½ V0
41Vout V3 (½)3 V0
then using superposition
Vout (½)2 V1
Vout (½)1 V2
putting it all together
Vout 1/3 (a3 ½ a2 (½)2 a1 (½)3 a0)
Let ai (0, 1) volts
42(No Transcript)
43(No Transcript)
444 bit D/A converter
Let ai (0, const voltage)
458-bit D/A Converter
46A/D Converter Subsystem
47Analog to Digital Conversion
- Typically uses D/A converter
- Example systems
- Using up counter
- Using up-down counter
- Using successive approximation
48A/D Using Up Counter
Simplest form Counts until analog signal B equals
A Always starts at 0
49A/D Using Up-Down Counter
Counts up or down until analog signal B equals
A Can start at previous reading
50A/D Using Successive Approximation
Tries MSB first, then moves on down to MSB-1
until signal B equals A
51End of Set
52(No Transcript)