Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No. 16-1 Chapter #8: Finite State Machine Design 8.5 Finite State Machine.

Slides:



Advertisements
Similar presentations
Chapter #8: Finite State Machine Design Contemporary Logic Design
Advertisements

Chapter #8: Finite State Machine Design 8
FSM Word Problems Today:
Sequential logic examples
Chapter #10: Finite State Machine Implementation
Implementation Strategies
Finite State Machines (FSMs)
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
COE 202: Digital Logic Design Sequential Circuits Part 3
Finite State Machine Chapter 10 RTL Hardware Design by P. Chu.
ECE C03 Lecture 111 Lecture 11 Finite State Machine Optimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
3/20/20091 More State Machines. Multiple processes.
ECE C03 Lecture 101 Lecture 10 Finite State Machine Design Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ECE C03 Lecture 131 Lecture 13 Finite State Machine Optimization Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Contemporary Logic Design Sequential Case Studies © R.H. Katz Transparency No Chapter #7: Sequential Logic Case Studies 7.1, 7.2 Counters.
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
ECE C03 Lecture 121 Lecture 12 Finite State Machine Design Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Contemporary Logic Design FSM Optimization © R.H. Katz Transparency No Chapter #9: Finite State Machine 9.4 Choosing Flip-Flops 9.5 Machine Partitioning.
1 Synchronous Sequential Circuit Design. 2 Sequential circuit design In sequential circuit design, we turn some description into a working circuit – We.
FINITE STATE MACHINES (FSMs) Dr. Konstantinos Tatas.
CSCI 3301 Transparency No. 9-1 Chapter #9: Finite State Machine Optimization Contemporary Logic Design.
Lecture #5 In this lecture we will introduce the sequential circuits.
Lecture 23 Design example: Traffic light controller.
FPGA-Based System Design: Chapter 5 Copyright  2004 Prentice Hall PTR Verilog for sequential machines.

1 COMP541 State Machines Montek Singh Feb 8, 2012.
FPGA-Based System Design: Chapter 5 Copyright  2004 Prentice Hall PTR Topics n Verilog styles for sequential machines. n Flip-flops and latches.
ECE C03 Lecture 101 Lecture 10 Finite State Machine Design Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Elevator Controller We’re hired to design a digital elevator controller for a four-floor building st try: Design a counter that counts up.
EE434 ASIC & Digital Systems
Chapter #8: Finite State Machine Design
Hussein Bin Sama && Tareq Alawneh
Chapter #8: Finite State Machine Design
ECNG1014 Digital Electronics
1 Lecture #12 EGR 277 – Digital Logic Synchronous Logic Circuits versus Combinational Logic Circuits A) Combinational Logic Circuits Recall that there.
CPEN Digital System Design Chapter 5 - Sequential Circuits Sequential Circuit Design C. Gerousis © Logic and Computer Design Fundamentals, 4 rd Ed.,
9-1 Introduction Chapter #9: Finite State Machine Optimization.
IX - Sequential Logic Technology © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Sequential logic implementation Implementation  random logic.
IX - Sequential Logic TechnologyContemporary Logic Design1 Ch 9. Sequential Logic Technologies.
Lecture 20: Sequential Logic (5)
1 ENGG 1015 Tutorial Three Examples of Finite State Machines Supplementary notes Learning Objectives  Learn about Design of Finite State Machines Ack.:
Digital System Design using VHDL
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
ECE DIGITAL LOGIC LECTURE 21: FINITE STATE MACHINE Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/24/2015.
ASM block The state box represents the state in the FSM, and the output in the state box describes the desired output values when the FMS enters this state.
Finite State Machine. Clock Clock cycle Sequential circuit Digital logic systems can be classified as combinational or sequential. – Combinational circuits.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
George Mason University Finite State Machines Refresher ECE 545 Lecture 11.
Finite State Machines Mealy machine inputs Outputs next state function
Finite state machine optimization
Finite state machine optimization
Chapter #8: Finite State Machine Design Contemporary Logic Design Randy H. Katz University of California, Berkeley.
© Copyright 2004, Gaetano Borriello and Randy H. Katz
Digital Electronics Tutorial: Sequential Logic
COMP541 Sequential Logic – 2: Finite State Machines
Synchronous Sequential Circuit Design
Sequential logic examples
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Introduction to Sequential Circuits
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Implement FSM with fewest possible states • Least number of flip flops
Sequential logic implementation
Lecture 24 Logistics Last lecture Today HW7 back today
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
EGR 2131 Unit 12 Synchronous Sequential Circuits
Implementation Strategies
Presentation transcript:

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design 8.5 Finite State Machine Word Problems

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Mapping English Language Description to Formal Specifications Four Case Studies: Finite String Pattern Recognizer Complex Counter with Decision Making Traffic Light Controller Digital Combination Lock We will use state diagrams and ASM Charts

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems 1. Finite String Pattern Recognizer A finite string recognizer has one input (X) and one output (Z). The output is asserted whenever the input sequence …010… has been observed, as long as the sequence 100 has never been seen. Step 1. Understanding the problem statement Sample input/output behavior: X: … Z: … X: … Z: … The outputs have been written to lag behind the inputs.

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Finite String Recognizer Step 2. Draw State Diagrams/ASM Charts for the strings that must be recognized. I.e., 010 and 100. Moore State Diagram Reset signal places FSM in S0 Outputs 1 Loops in State S0 [0] S1 [0] S2 [0] S3 [1] S4 [0] S5 [0] S6 [0] Reset ,1

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Finite String Recognizer Exit conditions from state S3: have recognized …010 if next input is 0 then have …0100! if next input is 1 then have …0101 = …01 (state S2) S0 [0] S1 [0] S2 [0] S3 [1] S4 [0] S5 [0] S6 [0] Reset ,1 0 1 …01 …010 …100

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Finite String Recognizer Exit conditions from S1: recognizes strings of form …0 (no 1 seen) loop back to S1 if input is 0 Exit conditions from S4: recognizes strings of form …1 (no 0 seen) loop back to S4 if input is 1 S0 [0] S1 [0] S2 [0] S3 [1] S4 [0] S5 [0] S6 [0] Reset ,10 …010 …01 …0 …100

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Finite String Recognizer S2, S5 with incomplete transitions S2 = …01; If next input is 1, then string could be prefix of (01)1(00) S4 handles just this case! S5 = …10; If next input is 1, then string could be prefix of (10)1(0) S2 handles just this case! Final State Diagram S0 [0] S1 [0] S2 [0] S3 [1] S4 [0] S5 [0] S6 [0] Reset ,1 0 0 …0 …01 …010 …100 …10 …1

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Finite String Recognizer Verify I/O behavior of your state diagram to insure it functions like the specification X: … Z: … X: … Z: … Sample input/output behavior:

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems 2. Complex Counter A sync. 3 bit counter has a mode control M. When M = 0, the counter counts up in the binary sequence. When M = 1, the counter advances through the Gray code sequence. Binary: 000, 001, 010, 011, 100, 101, 110, 111 Gray: 000, 001, 011, 010, 110, 111, 101, 100 Example Valid I/O behavior: Mode Input M Current State Next State (Z2 Z1 Z0) Output = Next State

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Complex Counter Derive the State Diagram using Moore FSM

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems 3. Traffic Light Controller A busy highway is intersected by a little used farmroad. Detectors C sense the presence of cars waiting on the farmroad. With no car on farmroad, light remain green in highway direction. If vehicle on farmroad, highway lights go from Green to Yellow to Red, allowing the farmroad lights to become green. These stay green only as long as a farmroad car is detected but never longer than a set interval. When these are met, farm lights transition from Green to Yellow to Red, allowing highway to return to green. Even if farmroad vehicles are waiting, highway gets at least a set interval as green. Assume you have an interval timer that generates a short time pulse (TS) and a long time pulse (TL) in response to a set (ST) signal. TS is to be used for timing yellow lights and TL for green lights.

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Traffic Light Controller Picture of Highway/Farmroad Intersection:

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Traffic Light Controller Tabulation of Inputs and Outputs: Input Signal reset C TS TL Output Signal HG, HY, HR FG, FY, FR ST Description place FSM in initial state detect vehicle on farmroad short time interval expired long time interval expired Description assert green/yellow/red highway lights assert green/yellow/red farmroad lights start timing a short or long interval Tabulation of Unique States: Some light configuration imply others State S0 S1 S2 S3 Description Highway green (farmroad red) Highway yellow (farmroad red) Farmroad green (highway red) Farmroad yellow (highway red)

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Traffic Light Controller Refinement of ASM Chart: Start with basic sequencing and outputs:

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Traffic Light Controller Determine Exit Conditions for S0: Car waiting and Long Time Interval Expired- C TL Equivalent ASM Chart Fragments S 0 S 0 H.HG H.FR H.HG H.FR TL C H.ST C S 1 H.HY H.FR S 1 H.HY H.FR OR

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Traffic Light Controller S1 to S2 Transition: Set ST on exit from S0 Stay in S1 until TS asserted Similar situation for S3 to S4 transition

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Traffic Light Controller S2 Exit Condition: no car waiting OR long time interval expired Complete ASM Chart for Traffic Light Controller

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Traffic Light Controller Compare with state diagram: Advantages of State Charts: Concentrates on paths and conditions for exiting a state Exit conditions built up incrementally, later combined into single Boolean condition for exit Easier to understand the design as an algorithm S0: HG S1: HY S2: FG S3: FY MEALY

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems 4. Digital Combination Lock "3 bit serial lock controls entry to locked room. Inputs are RESET, ENTER, 2 position switch for bit of key data. Locks generates an UNLOCK signal when key matches internal combination. ERROR light illuminated if key does not match combination. Sequence is: (1) Press RESET, (2) enter key bit, (3) Press ENTER, (4) repeat (2) & (3) two more times." Problem specification is incomplete: how do you set the internal combination? exactly when is the ERROR light asserted? Make reasonable assumptions: combination hardwired into next state logic vs. stored in internal register assert as soon as error is detected vs. wait until full combination has been entered ==>Our design: registered combination plus error after full combination

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Digital Combination Lock Understanding the problem: draw a block diagram … Internal Combination Operator Data Inputs: Reset Enter Key-In L0, L1, L2 Outputs: Unlock Error

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Finite State Machine Word Problems Digital Combination Lock Derive the ASM or the State Diagram Implementation

Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No HW #16 -- Section 8.5