The following will be discussed in this chapter: Design of systems that input flip flops and combinational logic, specifications start with a word description, create a state table to indicate next states, convert next states and outputs to output and flip flop input equations, draw resulting circuits.
Trang 1Lecture 26
Finite State Machine Design Procedure
Trang 2w
° Design of systems that input flip flops and
combinational logic
° Specifications start with a word description
° Create a state table to indicate next states
° Convert next states and outputs to output and flip flop input equations
• Reduce logic expressions using truth tables
° Draw resulting circuits
Trang 3Concept of the State
Qualifiers and
Inputs
Trang 4Concept of the State Machine
Computer Hardware = Datapath + Control
Qualifiers and Inputs
Inputs
°Divide circuit into combinational logic and state
°Localize feedback loops and make it easy to break cycles
°Implementation of storage elements leads to various forms of sequential logic
Concept of the State Machine
Trang 5Designing Finite State Machines
° Specify the problem with words
° (e.g Design a circuit that detects three consecutive 1
inputs)
° Assign binary values to states
° Develop a state table
° Use K-maps to simplify expressions
° Flip flop input equations and output equations
° Create appropriate logic diagram
° Should include combinational logic and flip flops
Trang 6Example: Detect 3 Consecutive 1 inputs
° State S0 : zero 1s detected
° State S1 : one 1 detected
° State S2 : two 1s detected
° State S3 : three 1s detected
0
° Note that each state has 2 output arrows
° Two bits needed to encode state
Trang 7State Table for Sequence
Detector
° Sequence of outputs, inputs, and flip flop states enumerated in
state table
value of flip flops
next rising clock edge
clock edge
Present
State Next State
A B x A B y
0 0 0 0 0 0
0 0 1 0 1 0
0 1 0 0 0 0
0 1 1 1 0 0
1 0 0 0 0 0
1 0 1 1 1 0
1 1 0 0 0 1
1 1 1 1 1 1
Output Input
° S0 = 00
° S1 = 01
° S2 = 10
° S3 = 11
Trang 8Finding Expressions for Next State and Output Value
° Create K-map directly from state table (3
columns = 3 K-maps)
° Minimize K-maps to find SOP representations
° Separate circuit for each next state and
output value
Trang 9Circuit for Consecutive 1s Detector
° Note location of state
Trang 11Concept of the State
Input
0
1
0 1
Next State Even Odd Odd Even
Output
0
0
1 1
Symbolic State Transition Table
Output
0
0
1 1
Next State
0
1
1 0
Input
0
1
0 1
Present State
0
0
1 1
Encoded State Transition Table
° Note: Present state and output are the same value
° Moore machine
Trang 12Concept of the State
Machine
Example: Odd Parity Checker
Next State/Output Functions
NS = PS xor PI; OUT = PS
Trang 13Concept of the State
Machine
Example: Odd Parity Checker
Next State/Output Functions
NS = PS xor PI; OUT = PS
D R
Q Q
Trang 14Solution 1: (Mealy)
0/0Even
Odd
1/11/0
0/1
0
Even
11
Appears after the state transition takes place
Trang 15Vending Machine FSM
Step 1 Specify the problem
Trang 18Vending Machine FSM
State Encoding How many flip-flops are needed?
Trang 19N
Trang 20Q
N
CLK CLK
Minimized Implementation
Trang 22Count Sequence Design Procedure
Complex Count Sequence
Step 1: Derive the State Transition Diagram Count sequence: 000, 010, 011, 101, 110
Trang 23More Complex Count Sequence Design Procedure
Trang 24Complex Count Sequence Design Procedure
Trang 25Complex Count Sequence Design Procedure
Trang 26Complex Count Sequence
Trang 27Design Procedure
Complex Count Sequence