1 Finite State Machines (FSMs) Now that we understand sequential circuits, we can use them to build: Synchronous (Clocked) Finite State Machines Finite.

Slides:



Advertisements
Similar presentations
ENGIN112 L23: Finite State Machine Design Procedure October 27, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 23 Finite State Machine.
Advertisements

Clocked Synchronous State-machine Analysis
Finite State Machines (FSMs)
State-machine structure (Mealy)
State Machine Design Procedure
A. Abhari CPS2131 Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and.
Classification of Digital Circuits  Combinational. Output depends only on current input values.  Sequential. Output depends on current input values and.
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Circuits require memory to store intermediate data
Sequential Circuit Analysis & Design Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.
1 EE365 Sequential-circuit analysis. 2 Clocked synchronous seq. circuits A.k.a. “state machines” Use edge-triggered flip-flops All flip-flops are triggered.
CS 151 Digital Systems Design Lecture 21 Analyzing Sequential Circuits.
1 Lecture 23 More Sequential Circuits Analysis. 2 Analysis of Combinational Vs. Sequential Circuits °Combinational : Boolean Equations Truth Table Output.
Sequential Circuit Design
ECE 331 – Digital System Design
Sequential Circuits and Finite State Machines Prof. Sin-Min Lee
EECC341 - Shaaban #1 Lec # 14 Winter Clocked Synchronous State-Machines Such machines have the characteristics: –Sequential circuits designed.
Give qualifications of instructors: DAP
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
Sequential Circuit Design
Overview Sequential Circuit Design Specification Formulation
EECC341 - Shaaban #1 Lec # 16 Winter State Machine Design Procedure 1. Build state/output table (or state diagram) from word description.
Contemporary Logic Design FSM Optimization © R.H. Katz Transparency No Chapter #9: Finite State Machine 9.4 Choosing Flip-Flops 9.5 Machine Partitioning.
Digital Logic Design Lecture 26. Announcements Exams will be returned on Thursday Final small quiz on Monday, 12/8. Final homework will be assigned Thursday,
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
1 Synchronous Sequential Circuit Analysis. 2 Synchronous Sequential Circuit State Memory – A set of n edge-triggered flip-flops that store the current.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Clocked Synchronous State Machine Design
Sequential Networks Two major classes of Sequential Circuits 1.Fundamental Mode – A sequential circuit where: Only one input is allowed to change at any.
SEQUENTIAL CIRCUITS Introduction
IKI c-Synthesis of Sequential Logic Bobby Nazief Semester-I The materials on these slides are adopted from: Prof. Daniel Gajski’s transparency.
Digital Computer Design Fundamental
Chapter 5 - Part Sequential Circuit Design Design Procedure  Specification  Formulation - Obtain a state diagram or state table  State Assignment.
Synchronous Circuit Design (Class 10.1 – 10/30/2012) CSE 2441 – Introduction to Digital Logic Fall 2012 Instructor – Bill Carroll, Professor of CSE.
Elevator Controller We’re hired to design a digital elevator controller for a four-floor building st try: Design a counter that counts up.
Chap 4. Sequential Circuits
Digital Logic Design Sequential circuits
Chap 4. Sequential Circuits
Lecture 4 – State Machine Design 9/26/20081ECE Lecture 4.
Introduction to Sequential Logic Design Flip-flops FSM Analysis.
Introduction to Sequential Logic Design Finite State-Machine Design.
1 Lecture #12 EGR 277 – Digital Logic Synchronous Logic Circuits versus Combinational Logic Circuits A) Combinational Logic Circuits Recall that there.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
Introduction to State Machine
Fall 2004EE 3563 Digital Systems Design EE3563 Chapter 7, 8, 10 Reading Assignments  7.1, 7.2, 7.3  8.1, ,   8.5.1, 8.5.2,
FINITE STATE MACHINES (FSMs)
DLD Lecture 26 Finite State Machine Design Procedure.
ANALYSIS OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
1 ENGG 1203 Tutorial Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives  Apply Karnaugh map for logic simplification  Design.
DESIGN OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
Registers; State Machines Analysis Section 7-1 Section 5-4.
1 State Reduction Goal: reduce the number of states while keeping the external input-output requirements unchanged. State reduction example: a: input 0.
Digital System Design using VHDL

ENG241 Digital Design Week #7 Sequential Circuits (Part B)
Synthesis Synchronous Sequential Circuits synthesis procedure –Word description of problem /hardest; art, not science/ –Derive state diagram & state table.
Introduction to Sequential Logic Design Finite State-Machine Analysis.
State Machine Design Shiva choudhary En No.: Electronics and comm. Dept K.I.T.,Jamnagar 1.
1 Clocked synchronous seq. circuits A.k.a. “state machines” Use edge-triggered flip-flops All flip-flops are triggered from the same master clock signal,
Lecture #17: Clocked Synchronous State-Machine Analysis
Week #7 Sequential Circuits (Part B)
Introduction to Sequential Logic Design
ANALYSIS OF SEQUENTIAL CIRCUITS
© Copyright 2004, Gaetano Borriello and Randy H. Katz
Asynchronous Inputs of a Flip-Flop
FINITE STATE MACHINES (FSMs)
Instructor: Alexander Stoytchev
DESIGN OF SEQUENTIAL CIRCUITS
EGR 2131 Unit 12 Synchronous Sequential Circuits
Presentation transcript:

1 Finite State Machines (FSMs) Now that we understand sequential circuits, we can use them to build: Synchronous (Clocked) Finite State Machines Finite number of states Flip-flops/latches run on clock signal(s)

2 FSM components: –Next state logic (combinational): next state = f(current state, inputs) –Memory (sequential): stores state in terms of state variables –Output logic (combinational): function depends on FSM type: Moore Machine: output = g(current state) Mealy Machine: output= g(current state, inputs)

3 FSM Analysis Goal: Given a FSM circuit, describe the circuit’s behavior

4 Excitation equations describe memory (FF or latch) input signals as a function of inputs and current state (i.e., state variables) Excitation Equations:

5 Transition equations describe the next state as a function of inputs and current state –Generated by substituting the excitation equations into the characteristic equation for the sequential gates Transition Equations:D FF Characteristic Eqn: This step is trivial when using D FFs!

6 Output equations describe the output signals as a function of the current state (for a Moore machine) or as a function of the current state and inputs (for a Mealy machine) Output Equation:

7 The transition/output table shows the next state and output for every current state/input combination –Entries of the table are obtained from the transition equations and the output equations Transition Equations: Output Equation: Transition/Output Table:

8 State labels are a one-to-one mapping from state encodings to state names The state/output table has the same format as the transition table, but state names are substituted in for state encodings Transition/Output Table:State/Output Table:

9 A state diagram is a graphical representation of the information in the state/output table Nodes (or vertices) represent states –Moore machines: output values are written in state node Arcs (or edges) represent state transitions –Labeled with a transition expression when an arc’s transition expression evaluates to 1 for a given input combination, that arc is followed to the next state –Mealy machines: output values (or expressions) are written on arcs State/Output Table: State Diagram:

10 FSM Analysis Recap 1)Find the circuit’s excitation equations 2)Using the excitation and characteristic equations, write the circuit’s transition equations 3)Write the circuit’s output equations 4)From the transition and output equations, create the circuit’s transition/output table 5)Create state labels 6)Using the transition table and state labels, create the state table 7)(optional) Draw the circuit’s state diagram

11 FSM Design Goal: Design a FSM that satisfies the requirements of the given problem description (spec.) Follow FSM analysis steps in reverse! (more or less) 1)(optional) Construct state diagram 2)Construct state/output table 3)Create state assignments 4)Create transition/output table 5)Choose FF type 6)Construct excitation/output table - Similar to transition/output table 7)Find excitation and output logic equations “Art of design” “Turn the crank”

12 FSM Design Example Problem description: design a Moore FSM with one input IN and one output OUT, such that OUT is one iff IN is 1 for three consecutive clock cycles State table:

13 State Assignments –How many state variables are needed to encode four states? –In general, if we have n states, how many state variables are needed to encode those states? These state assignments may seem rather arbitrary – that’s because they are! We will soon see the impact that state assignments have on our final circuit…

14 Transition/output table Choose FF type: –Using D flip-flops will simplify things (as we’ll see below…) Excitation table –Shows FF input values required to create next state values for every current state/input combination –If we’re designing with D FFs, entries in excitation/output table are the same as those in transition/output table! Because of D FF characteristic equation: Q + = D State/Output Table:Transition/Output Table:

15 Excitation Logic Output Logic Excitation/Output Table:

16 Circuit: Excitation Equations:Output Equation:

17 In Class Exercise Design a state/output table for the following problem specification: Combination lock: Two inputs, X and Y, encode a binary number between 0 and 3 (X is MSB, i.e., XY = 10 →2). A single output signal UNLOCK should be set to 1 iff the sequence 1, 2, 1 occurs on the inputs in three consecutive clock cycles

18 FSM Transition List Design: 50’s Vending Machine Inputs –d: asserted when user inserts dime –n: asserted when user inserts nickel –c: asserted when user presses candy button –s: asserted when user presses soda button Outputs –dc: dispenses candy when asserted –ds: dispenses soda when asserted –cr: 4-bit unsigned number, represents the user’s credit Specifications –All inputs are one-hot –Candy costs 10 cents, soda costs 15 cents –Money need only be counted up to 15 cents

19 Vending Machine State Diagram and Transition List

20 …

21 50’s Vending Machine: Mealy Implementation The Mealy implementation uses fewer states, and therefore fewer FFs!

22 State Assignments Back to our combinational lock example… Minimal SOP: 26 literals Perhaps we can do better using smarter state assignments… Minimal POS: 20 literals

23 Another state assignment approach –Maximize the number of 1’s Using smarter state assignments improved the next-state circuit cost from 20 literals to 9 literals! Minimal SOP: 10 literals Minimal POS: 9 literals

24 Another approach: use more flip-flops –one-hot encodings (with the addition of 000) Read minterms directly off of transition table: 23 literals How many states are really in our new state machine? What happened to the other 4 states???

25 Unused States Previous design: all unused states were implicitly assigned a next state of 000 (state A) This is known as a safe design –If noise causes the machine to enter an unused state, it will return to a used state under any input conditions

26 Efficient Design: Treat the next-states and outputs of unused states as don’t cares –Minimizes circuit cost! If an unused state is ever entered, state machine may never return to normal operation Finding transition equations now requires 5-variable K-maps!

27 State clustering assigns unused states to behave like used states If noise causes an unused state to be entered, the machine will return to a used state in a single clock cycle