Lecture #12 EGR 277 – Digital Logic

15
1 Lecture #12 EGR 277 – Digital Logic Synchronous Logic Circuits versus Combinational Logic Circuits A) Combinational Logic Circuits Recall that there are numerous ways to describe a combinational logic circuit, including: truth tables Karnaugh maps (minterms) (maxterms) Boolean expressions SOP expressions POS expressions Logic Diagrams Note : Given any one of the descriptions above, we could determine all of the others. Reading Assignment: Chapter 5 in Digital Design, 3 rd Edition by Mano

description

Lecture #12 EGR 277 – Digital Logic. Reading Assignment: Chapter 5 in Digital Design, 3 rd Edition by Mano. Synchronous Logic Circuits versus Combinational Logic Circuits A) Combinational Logic Circuits - PowerPoint PPT Presentation

Transcript of Lecture #12 EGR 277 – Digital Logic

Page 1: Lecture #12      EGR 277 – Digital Logic

1

Lecture #12 EGR 277 – Digital Logic

Synchronous Logic Circuits versus Combinational Logic Circuits

A) Combinational Logic Circuits

Recall that there are numerous ways to describe a combinational logic circuit, including:

• truth tables

• Karnaugh maps

• (minterms)

• (maxterms)

• Boolean expressions

• SOP expressions

• POS expressions

• Logic Diagrams

Note: Given any one of the descriptions above, we could determine all of the others.

Reading Assignment: Chapter 5 in Digital Design, 3rd Edition by Mano

Page 2: Lecture #12      EGR 277 – Digital Logic

2

Lecture #12 EGR 277 – Digital Logic

B) Sequential Logic Circuits

Similarly, there are numerous ways to describe a sequential logic circuit, including:

• State Diagrams

• State Tables

• State Equations and Output Equations

• Input Equations (flip-flop input functions) and Output Equations

• Logic Diagrams

Note: Given any one of the descriptions above, we could determine all of the others.

Some of these ways to describe sequential circuits will now be introduced.

Page 3: Lecture #12      EGR 277 – Digital Logic

3

Lecture #12 EGR 277 – Digital Logic

State Diagrams

This is the most common way to describe a sequential circuit.

A state diagram is somewhat like a flowchart that describes the sequence to states through which the circuit might progress.

State – a distinct event that is to occur (one event in a sequence)

Example: A state might be a single count in a counter. If a counter counts 0, 1, 2, ….. , 9 and then repeats, then it has 10 unique states. If four flip-flops were used to store the count, then the flip-flops would store the values 1001 corresponding to state 9.

Example: A state might be one step in a machining operation (there might be 5 states corresponding to the operations drill, ream, counterbore, countersink, and polish).

Example: A traffic light controller might have three states: Green, Yellow, and Red. Under certain input conditions or at certain times, the controller will change state.

Page 4: Lecture #12      EGR 277 – Digital Logic

4

Lecture #12 EGR 277 – Digital Logic

Encoding states – Show how a binary code can be stored in a set of flip-flops.

In most cases,

Number of flip-flops needed = log2(Number of states)

Example: Determine the number of states needed in each case below:

Description of circuit Number of flip-flops required

Circuit with 20 states

Traffic light controller

3-bit UP/DOWN counter

Decade counter

Page 5: Lecture #12      EGR 277 – Digital Logic

5

Lecture #12 EGR 277 – Digital Logic

There are two primary types of state diagrams:

Mealy model – the next state depends on the inputs applied. Outputs optional.

Moore model – the next state is predetermined. There are no inputs, so the circuit advances through a predetermined sequence of states.

A B

Input/Output

C

Mealy Model

(State A may be followed by State B or State C, depending on the input)

Input/Output A B

Output

Moore Model

(State A is always followed by State B)

Page 6: Lecture #12      EGR 277 – Digital Logic

6

Lecture #12 EGR 277 – Digital Logic

Examples of state diagrams:

A) Modulo-5 (mod-5) counter:

B) 3-bit Up/Down counter:

C) Traffic Light Controller

Page 7: Lecture #12      EGR 277 – Digital Logic

7

Lecture #12 EGR 277 – Digital Logic

State Table

A state table provides the same information as the state diagram, but in tabular form.

Example: Determine the state table for the state diagram shown below.

B

C

A

D

0/0

1/1

1/0 1/0

1/0 0/0

0/1

0/1

Page 8: Lecture #12      EGR 277 – Digital Logic

8

Lecture #12 EGR 277 – Digital Logic

State Assignment – Note that the states in the example above do not have binary values associated with them. They must be assigned. How should they be assigned?

Example: List possible state assignments for the last problem and repeat the state table using one of the state assignments.

Page 9: Lecture #12      EGR 277 – Digital Logic

9

Lecture #12 EGR 277 – Digital LogicState Assignment Some state diagrams have states indicated by letters or names because there is no

numeric value assigned to the states. As an example, there are no natural numeric values for the states in a circuit that controls a traffic light (states, RED, YELLOW, and GREEN). In such cases, numeric values must be assigned to each state. In the case of the traffic light, 2 bits are needed to encode the three states, but various possible codes could be used. For example, RED = 00, YELLOW = 01, and GREEN = 10. There are many other possible state assignments. Which is the best assignment to use? We don’t know. This is a current research topic.

Example: List possible state assignments for the last problem and repeat the state table using one of the state assignments.

Page 10: Lecture #12      EGR 277 – Digital Logic

10

Lecture #12 EGR 277 – Digital Logic

Determining the State Diagram from a Logic Diagram

The state diagram or state table can be found from the logic diagram by assuming an initial state, determining the corresponding flip-flop input values, and then using the truth table for the flip-flop to find the next state. This information can be easily tabulated as in the example below.

Page 11: Lecture #12      EGR 277 – Digital Logic

11

Lecture #12 EGR 277 – Digital LogicExample: Determine the state diagram for the logic diagram shown below.

A (M S B )

U 4 A

7 4 8 6

1

23

U 5 A

7 4 0 8

1

23

U 8 A

7 4 0 4

1 2B

U 6 A

7 4 0 8

1

23

U 7 A

7 4 3 2

1

23

U 1 A

7 4 7 6

2

4

1

1 6

3

1 5

1 4

PR

E

J

C L K

K

CLR

Q

Q

U 3 A

7 4 3 2

1

23

y

U 2 A

7 4 7 6

2

4

1

1 6

3

1 5

1 4

PR

E

J

C L K

K

CLR

Q

Q

x

Present State/Inputs Flip-flop inputs Next State Output

x A B JA KA JB KB A B y

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

Page 12: Lecture #12      EGR 277 – Digital Logic

12

Lecture #12 EGR 277 – Digital Logic

Sequential Circuit Design Methods

Two specific methods will be covered in this chapter:

• The Excitation Table method

• The State Equation method

Before covering the excitation table method, it is useful to develop excitation tables for each type of flip-flop.

Flip-flop Excitation Tables

Truth table – defines the output state based on the inputs

Excitation table – defines the required inputs to cause a transition from one state to another.

JK flip-flop truth table JK flip-flop excitation table

J K Q(t + 1) Q(t) Q(t + 1) J K

0 0 Q 0 0

0 1 0 0 1

1 0 1 1 0

1 1 Q’ 1 1

Example – Complete the excitation table below for the JK flip-flop

Page 13: Lecture #12      EGR 277 – Digital Logic

13

Lecture #12 EGR 277 – Digital Logic

Excitation table method – Design Procedure1. Problem description.2. Obtain the state table.3. Use state reduction to reduce the number of states if possible (covered

later).4. Use state assignment to assign binary values to each state if they are

symbolic.5. Determine the number of flip-flops required and assign a letter or

number to each.6. Determine the type of flip-flop to use (SR, JK, D, or T).7. Derive the circuit excitation table and output table from the state table.8. Simplifya) the circuit output functionsb) the flip-flop input functions9. Draw the logic diagram.Example: Design a modulo-7 counter (counts 0 to 6 and repeats) using JK flip-

flops.

Page 14: Lecture #12      EGR 277 – Digital Logic

14

Lecture #12 EGR 277 – Digital Logic

Flip-flop Excitation Tables

Q(t) Q(t+1) J K S R D T

0 0 0 X 0 X 0 0

0 1 1 X 1 0 1 1

1 0 X 1 0 1 0 1

1 1 X 0 X 0 1 0

Circuit Excitation TablePresent States/Inputs Next State Flip-flop Inputs and Circuit Outputs

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

Page 15: Lecture #12      EGR 277 – Digital Logic

15

Lecture #12 EGR 277 – Digital Logic

0

1

00 01 11 10

Flip-flop Input Functions and Circuit Output Functions

0

1

00 01 11 10

0

1

00 01 11 10

0

1

00 01 11 10

0

1

00 01 11 10

0

1

00 01 11 10

0

1

00 01 11 10

0

1

00 01 11 10