asynchronous and synchronous counters

46
1 DIGITAL SYSTEMS TCE1111 Asynchronous and Synchronous Counters Week 10 and Week 11 (Lecture 1 of 2)

Upload: calum

Post on 10-Feb-2016

179 views

Category:

Documents


4 download

DESCRIPTION

Asynchronous and Synchronous Counters. Week 10 and Week 11 (Lecture 1 of 2). Counters. * Counters are important digital electronic circuits. * They are Sequential logic circuits because timing is obviously important and they need a memory characteristic. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Asynchronous  and Synchronous Counters

1

DIGITAL SYSTEMS TCE1111

Asynchronous and Synchronous Counters

Week 10 and Week 11(Lecture 1 of 2)

Page 2: Asynchronous  and Synchronous Counters

2

DIGITAL SYSTEMS TCE1111

* Counters are important digital electronic circuits.

* They are Sequential logic circuits because timing is obviously important and they need a memory characteristic.

* Digital counters have the following important characteristics,

1. Maximum number of count

2. Up-Down Count

3. Asynchronous or Synchronous Operation

4. Free-Running or Self-Stopping

Counters

Page 3: Asynchronous  and Synchronous Counters

3

DIGITAL SYSTEMS TCE1111

Asynchronous/Ripple Counter

• Asynchronous counter are commonly referred to as ripple counter because the effect of the input clock pulse is first “felt” by first flip-flop (FF0).

• Cannot get to the second flip-flop (FF1) immediately because of the propagation delay through FF0.

• So the effect of an input clock pulse “ripples” through the counter, taking some time, due to propagation delays, to reach the last flip-flop.

Only the first FF receive clock pulse from the source ( clock genarator), others FFs receive clock pulse from either Q or Q’ of prior FF

Page 4: Asynchronous  and Synchronous Counters

4

DIGITAL SYSTEMS TCE1111

Propagation delays in a 3-bit asynchronous (ripple-clocked) binary counter.

Asynchronous/Ripple Counter

Page 5: Asynchronous  and Synchronous Counters

5

DIGITAL SYSTEMS TCE1111

Three-bit asynchronous binary counter and its timing diagram for one cycle.

Asynchronous/Ripple Counter

Clk pulse

Q2 Q1 Q0

0 0 0 0

1 0 0 1

2 0 1 0

3 0 1 1

4 1 0 0

5 1 0 1

6 1 1 0

7 1 1 1

8 (REPEAT)

0 0 0

RIPPLE COUNTER UP – PGT AND ALL NON FIRST CLK RECEIVE CLK PLUSE FROM Q’

Page 6: Asynchronous  and Synchronous Counters

6

DIGITAL SYSTEMS TCE1111

Four-bit asynchronous binary counter and its timing diagram.

Asynchronous/Ripple Counter

CLKPLUSE

Q3 Q2 Q1 Q0

0 0 0 0 0

1 0 0 0 1

2 0 0 1 0

3 0 0 1 1

4 0 1 0 0

5 0 1 0 1

6 0 1 1 0

7 0 1 1 1

8 1 0 0 0

9 1 0 0 1

10 1 0 1 0

11 1 0 1 1

12 1 1 0 0

13 1 1 0 1

14 1 1 1 0

15 1 1 1 1

16REPEAT

0 0 0 0

RIPPLE COUNTER UP – NGT AND ALL NON FIRST CLK RECEIVE CLK PLUSE FROM Q

Page 7: Asynchronous  and Synchronous Counters

7

DIGITAL SYSTEMS TCE1111

Asynchronous Decade Counter

• The Modulus of a counter is the number of unique states that the counter will sequence through.

• Counter can also be designed to have a number of states in their sequence that is less than the maximum of 2n.

• Counters with the states in their sequence are called decade counters.

• To obtain a truncated sequence, it is necessary to force the counter to recycle before going through all of its possible states.

• One way to make the counter recycle after the count of nine (1001) is to decode count ten (1010) with a NAND gate and connect the output of the NAND gate to the clear (CLR) inputs of the flip-flops. The inputs the NAND gate are from the Q output from FF1 and FF3 ( from 1010 -- FF3FF2FF1FF0)

Page 8: Asynchronous  and Synchronous Counters

8

DIGITAL SYSTEMS TCE1111

An asynchronously clocked decade counter with asynchronous recycling.

Asynchronous Decade Counter

CLKPLUSE

Q3 Q2 Q1 Q0

0 0 0 0 0

1 0 0 0 1

2 0 0 1 0

3 0 0 1 1

4 0 1 0 0

5 0 1 0 1

6 0 1 1 0

7 0 1 1 1

8 1 0 0 0

9 1 0 0 1

10 GLITCH

0 0 0 0

11 0 0 0 1

12 0 0 1 0

13 0 0 1 1

14 0 1 0 0

15 0 1 0 1

16 0 1 1 0

MOD 10 RIPPLE UP COUNTER – NGT AND ALL NON FIRST CLK RECEIVE CLK PLUSE FROM QMOD 10 AS RESET / CLITCH AT 1010. •The inputs the NAND gate are from the Q output from FF1 and FF3 ( from 1010 -- FF3FF2FF1FF0)

Page 9: Asynchronous  and Synchronous Counters

9

DIGITAL SYSTEMS TCE1111

2-bit synchronous binary counter.

Synchronous binary Counter The term Synchronous refers to events that have a fixed time relationship with each other AND receive cllock pulse from a common source

Page 10: Asynchronous  and Synchronous Counters

10

DIGITAL SYSTEMS TCE1111

A 3-bit synchronous binary counter.

Synchronous binary Counter

Clk pulse

Q2 Q1 Q0

0 0 0 0

1 0 0 1

2 0 1 0

3 0 1 1

4 1 0 0

5 1 0 1

6 1 1 0

7 1 1 1

8 (REPEAT)

0 0 0

Page 11: Asynchronous  and Synchronous Counters

11

DIGITAL SYSTEMS TCE1111

A 4-bit synchronous binary counter and timing diagram. Points where the AND gate outputs are HIGH are indicated by the shaded areas.

Synchronous binary Counter

CLKPLUSE

Q3 Q2 Q1 Q0

0 0 0 0 0

1 0 0 0 1

2 0 0 1 0

3 0 0 1 1

4 0 1 0 0

5 0 1 0 1

6 0 1 1 0

7 0 1 1 1

8 1 0 0 0

9 1 0 0 1

10 1 0 1 0

11 1 0 1 1

12 1 1 0 0

13 1 1 0 1

14 1 1 1 0

15 1 1 1 1

16REPEAT

0 0 0 0

Page 12: Asynchronous  and Synchronous Counters

12

DIGITAL SYSTEMS TCE1111

Synchronous Counter DesignSeveral methods are available that follow arbitrary sequence.

Here we will learn one common method using JK flip-Flops.

In synchronous counters all the FF’s are clocked at the same time.

J-K Excitation Table

Before begin the designing we must know the operation of the

J-K FF, let us analysis Truth table for 74LS76 IC (JK flip-flop) and its excitation table.

Page 13: Asynchronous  and Synchronous Counters

13

DIGITAL SYSTEMS TCE1111

PRESET CLEAR

Truth table for 74LS76 IC (JK flip-flop)

J K CLK Qt Qt’

0 0 0 0 x 1 1

0 1 x 1 1

1 0 x 1 1

1 1 x 1 1

0 1 0 0 x 1 0

0 1 x 1 0

1 0 x 1 0

1 1 x 1 0

1 0 0 0 x 0 1

0 1 x 0 1

1 0 x 0 1

1 1 x 0 1

1 1 0 0 ↓ Q0 Q0’

0 1 ↓ 0 1

1 0 ↓ 1 0

1 1 ↓ TOGGLE TOGGLE

Page 14: Asynchronous  and Synchronous Counters

14

DIGITAL SYSTEMS TCE1111

PRESENT NEXT J K

0 0 0 X

0 1 1 X

1 0 X 1

1 1 X 0

JK FF Excitation Table:

Page 15: Asynchronous  and Synchronous Counters

15

DIGITAL SYSTEMS TCE1111

0 0 TRANSITION; FF’s Present status is 0 and it should remain in 0 when a clock pulse is applied. That can be either J=K=0 status or J=0,K=1.

That mean J=0 and K=0 or 1

That’s J=0 and K=X(don’t care)

J-K Excitation Table

TRANSITIONAT OUTPUT

PRESENT STATE

Q(N)

NEXT STATE Q(N+1)

J K

0 0

0 1

1 0

1 1

0

0

1

1

0

1

0

1

0

1

X

X

X

X

1

0

Synchronous Counter Design

Page 16: Asynchronous  and Synchronous Counters

16

DIGITAL SYSTEMS TCE1111

0 1 TRANSITION: The present state is 0 and it has to change to 1. This can happen either J=1 and K=0 or J=K=1.

That mean always J=1 and K=0 or1

J=1 and K=X( don’t care)

1 0 TRANSITION; The present state is 1 and it has to change to 0. This can happen either J=0 and K=1 or J=K=1.

That mean always K=1 and J=0 or1

K=1 and J=X( don’t care)

Synchronous Counter Design

1 1 TRANSITION; The present state is 1 and it has to change to 1. This can happen either J=K=0 or J=1 and K=0.

That mean always K=0 and J can be either level

K=0 and J=X( don’t care)

Page 17: Asynchronous  and Synchronous Counters

17

DIGITAL SYSTEMS TCE1111

Design Procedure

Given a Counter sequence,

Synchronous Counter Design

C B A0000100

0011000

etc.

0101001

Page 18: Asynchronous  and Synchronous Counters

18

DIGITAL SYSTEMS TCE1111

STEP -1Draw the state transition diagram showing all the possible states, including those that are not part of the desired counting sequence

Synchronous Counter Design / Example (1)

Page 19: Asynchronous  and Synchronous Counters

19

DIGITAL SYSTEMS TCE1111

STEP -2

Use the state transition diagram to set up a table that lists all PRESENT states and their NEXT states

Present state Next stateC B A C B A

12345678

00001111

00110011

01010101

00010000

01100000

10100000

Synchronous Counter Design / Example (1) ….cont.

Page 20: Asynchronous  and Synchronous Counters

20

DIGITAL SYSTEMS TCE1111

STEP -3Add a column to this table for each J and K input. For each PRESENT state, indicate the level required at each J and K input in order to produce the transition to the NEXT state.

Present state Next stateC B A C B A

jC kC jB kB jA kA

12345678

00001111

00110011

01010101

00010000

01100000

1 0100000

0001XXX

X

XXXX1111

01XX00XX

XX01XX11

1X1X0X0X

X1X1X1X1

Synchronous Counter Design / Example (1) ….cont.

Page 21: Asynchronous  and Synchronous Counters

21

DIGITAL SYSTEMS TCE1111

STEP- 4

Design the logic expression to generate the level required at each J and K, using K-maps.

Present stateC B A jA kA

0000

0011

0101

1X1X

X1X1

1111

0011

0101

0X0X

X1X1

X1

X0BC

X0

X1

AACBCB

CBjA= C

Synchronous Counter Design / Example (1) ….cont.

1X

XXBC

1X

1X

AACBCB

CB

kA = 1

Page 22: Asynchronous  and Synchronous Counters

22

DIGITAL SYSTEMS TCE1111

XXXXBC0010AA

CBCB

CB

jB = A C10

11BC

XX

XX

AACBCB

CB

kB = A+C

STEP- 4 …..cont.

Synchronous Counter Design / Example (1) ….cont.

Present stateC B A jB kB0000

0011

0101

01XX

XX01

1111

0011

0101

XXXX

XX11

Page 23: Asynchronous  and Synchronous Counters

23

DIGITAL SYSTEMS TCE1111

10

XXBC

XX

00

AACBCB

CBjC = AB

XX

11BC

11

XX

AACBCB

CBkC = 1

STEP- 4 …..cont.

Synchronous Counter Design / Example (1) ….cont.

Present stateC B A jC kC0000

0011

0101

0001

XXXX

1111

0011

0101

0X0X

1111

Page 24: Asynchronous  and Synchronous Counters

24

DIGITAL SYSTEMS TCE1111

SETP -5

Finally to implement the final expressions.

Synchronous Counter Design / Example (1) ….cont.

Page 25: Asynchronous  and Synchronous Counters

25

DIGITAL SYSTEMS TCE1111

Design a JK synchronous counter that has the following sequence:000,010,101,110 and repeat. The undesired states 001,011,100 and 111 must always go to 000 on the next clock pulse.

STEP -1 :State Transition Diagram

?Synchronous Counter Design / Example (2)

Page 26: Asynchronous  and Synchronous Counters

26

DIGITAL SYSTEMS TCE1111

STEP- 2 : Table to list PRESENT and NEXT status

Synchronous Counter Design / Example (2) ….cont.

Page 27: Asynchronous  and Synchronous Counters

27

DIGITAL SYSTEMS TCE1111

STEP- 3 : Table indicate the Level required at each J and K inputs in order to produce the transition to the NEXT

Synchronous Counter Design / Example (2) ….cont.

Page 28: Asynchronous  and Synchronous Counters

28

DIGITAL SYSTEMS TCE1111

STEP- 4 :Design the logic circuits to generate the levels required at each J and K inputs

Synchronous Counter Design / Example (2) ….cont.

Page 29: Asynchronous  and Synchronous Counters

29

DIGITAL SYSTEMS TCE1111

STEP- 5 :Simplify the SOP expression using K-maps

Synchronous Counter Design / Example (2) ….cont.

Page 30: Asynchronous  and Synchronous Counters

30

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (2) ….cont.

Page 31: Asynchronous  and Synchronous Counters

31

DIGITAL SYSTEMS TCE1111

Design a JK synchronous counter that has the following sequence:000,010,101,110 and repeat. For undesired states their NEXT states can be DON’T CARES.?

STEP -1 :State Transition Diagram

Synchronous Counter Design / Example (3)

Page 32: Asynchronous  and Synchronous Counters

32

DIGITAL SYSTEMS TCE1111

STEP- 2 : Table to list PRESENT and NEXT status

Synchronous Counter Design / Example (3) ….cont.

Page 33: Asynchronous  and Synchronous Counters

33

DIGITAL SYSTEMS TCE1111

STEP- 3 : Table indicate the Level required at each J and K inputs in order to produce the transition to the NEXT

Synchronous Counter Design / Example (3) ….cont.

Page 34: Asynchronous  and Synchronous Counters

34

DIGITAL SYSTEMS TCE1111

STEP- 4 :Design the logic circuits to generate the levels required at each J and K inputs

Synchronous Counter Design / Example (3) ….cont.

Page 35: Asynchronous  and Synchronous Counters

35

DIGITAL SYSTEMS TCE1111

STEP- 5 :Simplify the SOP expression using K-maps

Synchronous Counter Design / Example (3) ….cont.

Page 36: Asynchronous  and Synchronous Counters

36

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (3) ….cont.

Page 37: Asynchronous  and Synchronous Counters

37

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (4) ….cont.

Objective:To design a 3 bit counter (D FF) with the following count sequence 7,6,5,4,1. All unwanted stages go to 7.

000

010

011111

101

110

100001

Output sequence 7,6,5,4,1In 3 bits format: 111,110, 101, 100, 001State transition diagram:

Page 38: Asynchronous  and Synchronous Counters

38

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (4) ….cont.

PRESET CLEAR

Truth table for NGT D flip-flop

DCLK Q Qt Qt’

1 1 0 ↓ 0 0 1

0 ↓ 1 0 1

1 ↓ 0 1 0

1 ↓ 1 1 0

D Flip Flop Excitation Table:

PRESENT NEXT D

0 0 0

0 1 1

1 0 0

1 1 1

Page 39: Asynchronous  and Synchronous Counters

39

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (4) ….cont.

OUTPUT INPUT

PRESENT STATE NEXT STATE C B A

C B A C B A DC DB DA

0 0 0 1 1 1 1 1 1

0 0 1 1 1 1 1 1 1

0 1 0 1 1 1 1 1 1

0 1 1 1 1 1 1 1 1

1 0 0 0 0 1 0 0 1

1 0 1 1 0 0 1 0 0

1 1 0 1 0 1 1 0 1

1 1 1 1 1 0 1 1 0

Page 40: Asynchronous  and Synchronous Counters

40

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (4) ….cont.

K- Map

ABC

BC

BC

A

1 1

1 1

CB 1 1

0 1

DC =A+ C’ + B

A

BC

BC

BC

A

1 1

1 1

CB 0 1

0 0

DB = AB + C’

A

BC

BC

BC

A

1 1

1 1

CB 1 0

1 0

DA = A’ + C’

Pls draw the cct as a home work

Page 41: Asynchronous  and Synchronous Counters

41

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (5) ….cont.

Objective:To design a 3 bit counter (T FF) with the following count sequence 7,6,5,4,1. All unwanted stages go to 7.

SOLUTIONOutput sequence 7,6,5,4,1In 3 bits format: 111,110, 101, 100, 001

000010

011111

101

110

100001

State transition diagram:

Page 42: Asynchronous  and Synchronous Counters

42

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (5) ….cont.

PRESET CLEAR

Truth table for NGT T flip-flop

TCLK

Q Qt Qt’

1 1 0 ↓ 0 0 1 No change

0 ↓ 1 1 0 No change

1 ↓ 0 1 0 Toggle

1 ↓ 1 0 1 Toggle

Page 43: Asynchronous  and Synchronous Counters

43

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (5) ….cont.

T Flip Flop Excitation Table:

PRESENT NEXT T

0 0 0

0 1 1

1 0 1

1 1 0

Page 44: Asynchronous  and Synchronous Counters

44

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (5) ….cont.

T Flip Flop Input Function Table

OUTPUT INPUT

PRESENT STATE

NEXT STATE C B A

C B A C B A TC TB TA

0 0 0 1 1 1 1 1 1

0 0 1 1 1 1 1 1 0

0 1 0 1 1 1 1 0 1

0 1 1 1 1 1 1 0 0

1 0 0 0 0 1 1 0 1

1 0 1 1 0 0 0 0 1

1 1 0 1 0 1 0 1 1

1 1 1 1 1 0 0 0 1

Page 45: Asynchronous  and Synchronous Counters

45

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Example (5) ….cont.

K- Map

A

BC

BC

BC

A

1 1

1 1

CB 0 0

1 0

TC =A’B’ + C’

A

BC

BC

BC

A

1 1

0 0

CB 1 0

0 0

TB = B’C’ + A’BC

A

BC

BC

BC

A

1 0

1 0

CB 1 1

1 1

TA = A’ + C

Pls draw the cct as a home work

Page 46: Asynchronous  and Synchronous Counters

46

DIGITAL SYSTEMS TCE1111

Synchronous Counter Design / Execise

Objective:To design a 3 bit counter (JK FF) with the following count sequence 4,5,7,1,3. All unwanted stages go to 4.