Top Banner
ECE 301 – Digital Electronics Counters (Lecture #20) The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6 th Edition, by Roth and Kinney, and were used with permission from Cengage Learning.
32

ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Mar 09, 2018

Download

Documents

hoangduong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

ECE 301 – Digital Electronics

Counters

(Lecture #20)

The slides included herein were taken from the materials accompanying

Fundamentals of Logic Design, 6th Edition, by Roth and Kinney,

and were used with permission from Cengage Learning.

Page 2: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 2

Counters

● A counter is a sequential circuit (aka. finite state machine) that cycles through a fixed sequence of states.

● The state of the counter is stored in Flip-Flops.

● An n-bit counter

– has n Flip-Flops

– can cycle through at most 2n states.

Page 3: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 3

Counters

00

10

0111010110

000 001111

011100101

2-bit Counter

3-bit Counter

Page 4: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 4

Counters

2-bit Counter

3-bit Counter

00

01

10

using only 3 states

using only 5 states

010

101 011

000

110

Page 5: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 5

Binary Counters

● An n-bit binary counter is a counter that cycles through all 2n states in ascending (or descending) order.

010110

000 001111

011100101

3-bit Binary Counter

Cycles through all 8 states

in ascending order

Page 6: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 6

Binary Counters: Design

1.Draw a state graph that specifies the desired sequence of the counter.

2.Construct a state table from the state graph.

One Flip-Flop for each bit in the state.

3.Derive a K-map from the state table for each Flip-Flop input.

Select the type of Flip-Flop to be used.

4.Determine the input equation(s) for each Flip-Flop.

Page 7: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 7

Binary Counters: Design

Example: State Table (using D FF)

Present State Next State FF Inputs

C B A C+ B+ A+ DC DB DA

0 0 0 0 0 1

0 0 1 0 1 0

0 1 0 0 1 1

0 1 1 1 0 0

1 0 0 1 0 1

1 0 1 1 1 0

1 1 0 1 1 1

1 1 1 0 0 0

Q+ = D

CharacteristicEquation:

Page 8: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 8

Binary Counters: Design

Example: K-maps (for D FF inputs)

Page 9: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 9

Binary Counters: Design

Example: Circuit Diagram (using D FF)

Page 10: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 10

Binary Counters: Design

Example: State Table (using T FF)

Q+ = T xor Q

CharacteristicEquation:

Present State Next State FF Inputs

C B A C+ B+ A+ TC TB TA

0 0 0 0 0 1

0 0 1 0 1 0

0 1 0 0 1 1

0 1 1 1 0 0

1 0 0 1 0 1

1 0 1 1 1 0

1 1 0 1 1 1

1 1 1 0 0 0

Excitation Table:

Q Q+ T

0 0 0

0 1 1

1 0 1

1 1 0

Page 11: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 11

Binary Counters: Design

Example: K-maps (for T FF inputs)

Page 12: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 12

Binary Counters: Design

Example: Circuit Diagram (using T FF)

Page 13: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 13

Binary Up-Down Counters

What constraints must be placed on the U and D control signals?

Page 14: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 14

Binary Up-Down Counters

Page 15: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 15

Loadable Counter with Enable

Page 16: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 16

Counters: Design

1.Draw a state graph that specifies the desired sequence of the counter.

2.Construct a state table from the state graph.

One Flip-Flop for each bit in the state.

3.Derive a K-map from the state table for each Flip-Flop input.

Select the type of Flip-Flop to be used.

4.Determine the input equation(s) for each Flip-Flop.

Page 17: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 17

Counters: Design

Example:

Design the following counter using D Flip-Flops.

Page 18: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 18

Counters: Design

Example: State Table (using D FF)

Present State Next State FF Inputs

C B A C+ B+ A+ DC DB DA

0 0 0 1 0 0

0 0 1 x x x

0 1 0 0 1 1

0 1 1 0 0 0

1 0 0 1 1 1

1 0 1 x x x

1 1 0 x x x

1 1 1 0 1 0D = Q+

ExcitationEquation:

Page 19: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 19

Counters: Design

Example: K-maps (for D FF inputs)

DC DB DA

Page 20: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 20

Counters: Design

Example: Circuit Diagram (using D FF)

Page 21: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 21

Counters: Design

Example:

Design the following counter using T Flip-Flops.

Page 22: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 22

Counters: Design

Example: State Table (using T FF)

Present State Next State FF Inputs

C B A C+ B+ A+ TC TB TA

0 0 0 1 0 0

0 0 1 x x x

0 1 0 0 1 1

0 1 1 0 0 0

1 0 0 1 1 1

1 0 1 x x x

1 1 0 x x x

1 1 1 0 1 0T = Q xor Q+

ExcitationEquation:

Page 23: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 23

Counters: Design

Example: K-maps (for T FF inputs)

Page 24: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 24

Counters: Design

Example: K-maps (for T FF inputs)

We could derive TC , TB , and TA directly from the state table,

but it is often more convenient to plot next-state maps

showing C+, B+, and A+ as functions of C, B, and A, and then

derive TC , TB , and TA from these maps.

Page 25: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 25

Counters: Design

Example: Circuit Diagram (using T FF)

Page 26: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 26

Counters: Design

Example: Next States (for T FF inputs)

Although the original state table for the counter is not

completely specified, the next states of states 001, 101,

and 110 have been specified in the process of

completing the circuit design

110101

Page 27: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 27

Counters: Design

Example:

Design the following counter using JK Flip-Flops.

Page 28: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 28

Counters: Design

Example: Using JK Flip-Flops

Excitation Table:

Q Q+ J K

0 0 0 x

0 1 1 x

1 0 x 1

1 1 x 0

Page 29: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 29

Counters: Design

Example: State Table (using JK FF)

Present State Next State FF Inputs

C B A C+ B+ A+ JC KC JB KB JA KA

0 0 0 1 0 0

0 0 1 x x x

0 1 0 0 1 1

0 1 1 0 0 0

1 0 0 1 1 1

1 0 1 x x x

1 1 0 x x x

1 1 1 0 1 0

Page 30: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 30

Counters: Design

Example: K-maps (for JK FF inputs)

Page 31: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 31

Counters: Design

Example: Circuit Diagram (using JK FF)

Page 32: ECE 301 – Digital Electronicsece.gmu.edu/~clorie/Spring11/ECE-301/Lectures/Lecture_20.pdfSpring 2011 ECE 301 - Digital Electronics 6 Binary Counters: Design 1. Draw a state graph

Spring 2011 ECE 301 - Digital Electronics 32

Questions?