© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems...

36
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems Busses. Memory devices. I/O devices: serial links timers and counters keyboards displays analog I/O

Transcript of © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems...

Page 1: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Bus-Based Computer Systems

Busses.Memory devices.I/O devices:

serial links timers and counters keyboards displays analog I/O

Page 2: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

The CPU bus

Bus allows CPU, memory, devices to communicate. Shared communication medium.

A bus is: A set of wires. A communications protocol.

Page 3: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Bus protocols

Bus protocol determines how devices communicate.

Devices on the bus go through sequences of states. Protocols are specified by state machines,

one state machine per actor in the protocol.

May contain asynchronous logic behavior.

Page 4: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Four-cycle handshake

device 1 device 2enq

ack

time

device 1

device 2

1 2 3 4

Page 5: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Four-cycle handshake, cont’d.

1. Device 1 raises enq.2. Device 2 responds with ack.3. Device 2 lowers ack once it has

finished.4. Device 1 lowers enq.

Page 6: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

Microprocessor busses

Clock provides synchronization.

R/W is true when reading (R/W’ is false when reading).

Address is a-bit bundle of address lines.

Data is n-bit bundle of data lines.

Data ready signals when n-bit data is ready.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Page 7: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Timing diagrams

Page 8: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Bus read

Page 9: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

State diagrams for bus read

CPU device

Get data

Done

Adrs

Wait

See ack

Senddata

Release ack

Adrs

Wait

Ack

start

Page 10: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Bus wait state

Page 11: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Bus burst read

Page 12: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Bus multiplexing

CPU

adrs

device

data

adrs

data enable

Adrs enable

Page 13: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

DMA

Direct memory access (DMA) performs data transfers without executing instructions. CPU sets up transfer. DMA engine fetches,

writes.

DMA controller is a separate unit.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Page 14: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

Bus mastership

By default, CPU is bus master and initiates transfers.

DMA must become bus master to perform its work. CPU can’t use bus while DMA operates.

Bus mastership protocol: Bus request. Bus grant.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Page 15: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

DMA operation

CPU sets DMA registers for start address, length.

DMA status register controls the unit.

Once DMA is bus master, it transfers automatically. May run continuously

until complete. May use every nth bus

cycle.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Page 16: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Bus transfer sequence diagram

Page 17: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

System bus configurations

Multiple busses allow parallelism: Slow devices on

one bus. Fast devices on

separate bus.

A bridge connects two busses.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

CPU slow device

memory

high-speeddevice

brid

ge

slow device

Page 18: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Bridge state diagram

Page 19: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

ARM AMBA bus

Two varieties: AHB is high-

performance. APB is lower-speed,

lower cost.

AHB supports pipelining, burst transfers, split transactions, multiple bus masters.

All devices are slaves on APB.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Page 20: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

Memory components

Several different types of memory: DRAM. SRAM. Flash.

Each type of memory comes in varying: Capacities. Widths.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Page 21: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Random-access memory

Dynamic RAM is dense, requires refresh. Synchronous DRAM is dominant type. SDRAM uses clock to improve

performance, pipeline memory accesses.

Static RAM is faster, less dense, consumes more power.

Page 22: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

SDRAM operation

Page 23: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Read-only memory

ROM may be programmed at factory.Flash is dominant form of field-

programmable ROM. Electrically erasable, must be block erased. Random access, but write/erase is much

slower than read. NOR flash is more flexible. NAND flash is more dense.

Page 24: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Timers and counters

Very similar: a timer is incremented by a periodic

signal; a counter is incremented by an

asynchronous, occasional signal.Rollover causes interrupt.

Page 25: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Watchdog timer

Watchdog timer is periodically reset by system timer.

If watchdog is not reset, it generates an interrupt to reset the host.

host CPU watchdogtimer

interrupt

reset

Page 26: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Switch debouncing

A switch must be debounced to multiple contacts caused by eliminate mechanical bouncing:

Page 27: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Encoded keyboard

An array of switches is read by an encoder.

N-key rollover remembers multiple key depressions.

row

Page 28: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

LED

Must use resistor to limit current:

Page 29: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

7-segment LCD display

May use parallel or multiplexed input.

Page 30: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Types of high-resolution display

Liquid crystal display (LCD) is dominant form.

Plasma, OLED, etc.Frame buffer holds current display

contents. Written by processor. Read by video.

Page 31: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Touchscreen

Includes input and output device.Input device is a two-dimensional

voltmeter:

Page 32: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Touchscreen position sensing

ADC

voltage

Page 33: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Digital-to-analog conversion

Use resistor tree:R

2R

4R

8R

bn

bn-1

bn-2

bn-3

Vout

Page 34: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Flash A/D conversion

N-bit result requires 2n comparators:

encoder

Vin

...

Page 35: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Dual-slope conversion

Use counter to time required to charge/discharge capacitor.

Charging, then discharging eliminates non-linearities.

Vintimer

Page 36: © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Bus-Based Computer Systems zBusses. zMemory devices. zI/O devices: yserial links ytimers.

© 2008 Wayne WolfOverheads for Computers as

Components 2nd ed.

Sample-and-hold

Samples data:

converterVin