electronic counters. abstract electronic counters come in two flavors: asynchronous and synchronous....

28
Electronic Counters

Upload: noel-shelton

Post on 23-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Electronic Counters

Page 2: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

AbstractElectronic counters come in two flavors: asynchronous and synchronous.

Asynchronous counter encode a count sequence by directly connecting flip-flops and allowing the clock-pulse to ripple through the cascade. Synchronous counters use a common clock and logic between flip-flops to encode the count sequence. Asynchronous counters are simpler because they do not require logic gates, but any latency will scale linearly with respect to the number of bits. Synchronous counters are more complex but constrain the latency. If the cumulative latency is greater than the maximum allowable cycle time, then a synchronous architecture is preferable. If the application is not sensitive to false errors produced by latency, however, an asynchronous counter alone or with over-clocking (in the event that cumulative latency is greater than the cycle time) may be feasible. Alternatively filters, such as a strobing circuit, can be used to remove erroneous outputs caused by latency from the output.

Page 3: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Solid State

Physics

NN PP

+-

Transistors And

diodes

Logic gates

Memory devices : Flip flops

Systems : CountersFlip Flop

FlipFlopFlipFlop

Output

Clock

Clock

Input

Output’Input 2

Page 4: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Counter

Electronic counter

Memory deviceFlip flop

AddressableI/O signals

Wires

ArchitectureAsynchronous Synchronous

Page 5: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Electronic flip-flop

0 1

State

A bit is a two-state object, such as a flip-flop.

Page 6: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

0 1State 0

000 001 010 011 100 101 110 111 All possible information

levels for three bits

A collection of n bits can encode 2^n information

levels (states).

Page 7: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

0 1State 0

000 001 010 011 100 101 110 111 All possible information

levels for three bits

1 2 3 4 5 6 7 8

Each information level can represent a number.

Page 8: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

000 001 010 011 100 101 110 111

Bits oscillating with proportional frequencies encode count sequence.

Bit1

Bit2

Bit3

1 2 3 4 5 6 7 8

Page 9: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Counter system architecture connects bits (JK flip-flops) to produce this frequency pattern.

Bit2

Bit3

Bit1

Page 10: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Asynchronous

Page 11: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Couple two two bits so that inverse output from bit 1 is

trigger for bit 2.

“Trigger”

Inverter

Output 1 Output 2

“Trigger”Bit 1 Bit 2

Page 12: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Output 1

Trigger 1

Output 1

Inverted

Bit 1 output and inverted output

Page 13: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Output 2

Output 1

Inverted

Trigger 2

Bit 1 inverse output serves as clock for bit 2. Triggers state change at positive

going transitions.

Page 14: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Output 1

Output 2

2 outputs of proportional frequency produce the

count sequence

01

2

10

3

11

4

00

1

Page 15: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

“Trigger”

“Enable”

Latency

Delay, D

But if there is a delay between command to

toggle and response …

“Trigger”

BitState

Toggle:Change State

AND

AND

JK Flip-Flop

Page 16: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

… latency scales linearly wrt # of bits

Clock 1

Bit 1

Bit 2

Clock 2

D

D

Ideal Observed

Accumulated latency = n*d, for counter of n bits

Page 17: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

And results in an erroneous count.

Clock 1

Bit 1

Bit 2

Clock 2

D

D

01 (2) 10 (3) 01 01 00 (1) 10

Ideal Observed

Page 18: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

But if accumulated delay occurs before clock returns

to low state …Clock 1

Bit n

Clock n

Accumulated delay = (n-1)*d

Accumulated delay = (n)*d

Page 19: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

… let error ripple through the system when clock is high, then read output when the

clock is low.

Clock 1

Bit 1

Bit 2

Clock 2

01 10

Low enable is

True

Then read bits to produce correct output

“Strobing” circuit

Page 20: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Problem: delay limits clock speed …

Clock 1

Bit n

Clock n

Cumulative delay = (n)*d

Clock frequency must be set allow cumulative delay to ripple through cascade of bits during the high level of the trigger. Thus, the length of ½ cycle > length of cumulative delay

Page 21: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

In applications where false outputs from propagation delay produces errors and where speed is important,synchronous counter that

avoids “rippling” is preferable.

Page 22: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Synchronous

Page 23: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Couple enable to logic gate that processes output from prior bits : when all prior

bits are high, then 1 passed to bit and output toggles.

“Trigger”

PriorBits

ToggleOutput

“Inputs”

AND

AND

JK Flip-Flop

Page 24: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Synchronous counter: each bit holds its state until all

preceding bits are high and positive clock pulse.High

11Cloc

kCloc

k 22 33

Q2 Q3And

Clock

Q2

Q1

Q3

0 1

1

0 1 1 0 10

0 1 0 1

0

Q1

000 001 010 011 100 101 110 111 1 2 3 4 5 6 7 8

Page 25: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Bits flip simultaneously, with same latency :

no false outputsClock

Bit 2

Bit 3

Bit 4

Bit 1 1

1

1

0

0

Bit 4 enable:Logic gate

inputs

Bit 4 state

Time 1

1

1

1

1

1

Time 2: Flip

D: latency of flip-flop

Bit 4 trigger

Page 26: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Compare synchronous to asynchronous …

Clock

Bit 2

Bit 3

D

Bit 4

Bit 1

Latency for synchronous fixed and no false outputs but is synchronous is 4*D by 4th flip-flop, necessitating measures

(“strobing circuit”) to prevent errors and thus limiting speed.

Grows to 4*D

Page 27: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Knowing …

Clock

Bit n

Clock n

Clock

1. Cumulative latency for

asynchronous counter

2. Minimum acceptable clock speed

Maximum acceptable cycle time

Latency

Page 28: Electronic Counters. Abstract Electronic counters come in two flavors: asynchronous and synchronous. Asynchronous counter encode a count sequence by directly

Synchronous

Architecture

Is cumulative latency > maximum

cycle time? Yes

No

Do false outputs

resulting from latency cause

errors? No

Yes

Is cumulative latency < ½ maximum

cycle time?

Yes With strobing circuit to “block” output during high

level in clock cycle.

No

Asynchronous

Architecture

Decision …