Finite State Machine (1A) Young Won Lim 6/9/18

Similar documents
FSM Examples. Young Won Lim 11/6/15

Sequential Circuit Timing. Young Won Lim 11/6/15

Relations (3A) Young Won Lim 3/27/18

Finite State Machine (FSM)

Automata Theory (2A) Young Won Lim 5/31/18

Synchronous Sequential Circuit Design. Digital Computer Design

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Synchronous Sequential Logic

Sequential Circuit Design

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

Mealy & Moore Machines

Matrix Transformation (2A) Young Won Lim 11/10/12

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Topic 8: Sequential Circuits

Different encodings generate different circuits

CPE100: Digital Logic Design I

Digital Design. Sequential Logic

Finite-state machines (FSMs)

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Higher Order ODE's (3A) Young Won Lim 7/7/14

Digital Electronics Sequential Logic

ALU, Latches and Flip-Flops

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

Lecture 7: Sequential Networks

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

Chapter 7 Sequential Logic

State and Finite State Machines

General Vector Space (2A) Young Won Lim 11/4/12

Higher Order ODE's (3A) Young Won Lim 12/27/15

Sequential logic and design

FSM model for sequential circuits

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

The Growth of Functions (2A) Young Won Lim 4/6/18

Detect Sensor (6B) Eddy Current Sensor. Young Won Lim 11/19/09

Example: vending machine

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

Sequential vs. Combinational

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

ELCT201: DIGITAL LOGIC DESIGN

Expected Value (10D) Young Won Lim 6/12/17

Matrix Transformation (2A) Young Won Lim 11/9/12

Root Locus (2A) Young Won Lim 10/15/14

CT Rectangular Function Pairs (5B)

or 0101 Machine

Differentiation Rules (2A) Young Won Lim 1/30/16

Fourier Analysis Overview (0A)

General CORDIC Description (1A)

Lecture 7: Logic design. Combinational logic circuits

Topic 8: Sequential Circuits. Bistable Devices. S-R Latches. Consider the following element. Readings : Patterson & Hennesy, Appendix B.4 - B.

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Introduction to Computers & Programming

Chapter 3. Chapter 3 :: Topics. Introduction. Sequential Circuits

CSE 140 Midterm 2 Tajana Simunic Rosing. Spring 2008

Lecture 10: Synchronous Sequential Circuits Design

Design of Datapath Controllers

Fundamentals of Computer Systems

FYSE420 DIGITAL ELECTRONICS

Sequential Logic Worksheet

Chapter 3. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 3 <1>

Digital Design 2010 DE2 1

Implication (6A) Young Won Lim 3/17/18

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

EE141- Spring 2007 Digital Integrated Circuits

P2 (10 points): Given the circuit below, answer the following questions:

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

Time Allowed 3:00 hrs. April, pages

Propositional Logic Logical Implication (4A) Young W. Lim 4/11/17

Fundamentals of Digital Design

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

Lecture 3 Review on Digital Logic (Part 2)

Background Trigonmetry (2A) Young Won Lim 5/5/15

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

State & Finite State Machines

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization

Homework #4. CSE 140 Summer Session Instructor: Mohsen Imani. Only a subset of questions will be graded

Sequential Circuit Analysis

Capacitor Young Won Lim 06/22/2017

Chapter 7. Synchronous Sequential Networks. Excitation for

Propositional Logic Resolution (6A) Young W. Lim 12/12/16

Sequential Circuits. Circuits with state. Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. L06-1

Clocked Sequential Circuits UNIT 13 ANALYSIS OF CLOCKED SEQUENTIAL CIRCUITS. Analysis of Clocked Sequential Circuits. Signal Tracing and Timing Charts

Lecture 9: Sequential Logic Circuits. Reading: CH 7

Higher Order ODE's (3A) Young Won Lim 7/8/14

DFT Frequency (9A) Each Row of the DFT Matrix. Young Won Lim 7/31/10

Review for Final Exam

COMPUTER SCIENCE TRIPOS

Introduction to ODE's (0A) Young Won Lim 3/9/15

CSE140: Digital Logic Design Registers and Counters

Propositional Logic Logical Implication (4A) Young W. Lim 4/21/17

Signal Functions (0B)

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

14.1. Unit 14. State Machine Design

Sequential Synchronous Circuit Analysis

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Chapter 3 Digital Logic Structures

Timing Constraints in Sequential Designs. 63 Sources: TSR, Katz, Boriello & Vahid

Transcription:

Finite State Machine (A) 6/9/8

Copyright (c) 23-28 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free ocumentation License, Version.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free ocumentation License". Please send corrections (or suggestions) to youngwlim@hotmail.com. This document was produced by using LibreOffice and Octave. 6/9/8

FSM and igital Logic Circuits Latch FlipFlop Registers Timing Mealy machine Moore machine Traffic Lights Examples https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 3 6/9/8

NOR-based SR Latch SET / RESET SET S= = RESET S= = R= = R= = https://en.wikipedia.org/wiki/flip-flop_(electronics) FSM Overview (A) 4 6/9/8

NOR-based SR Latch HOL HOL S= =old HOL S= =old R= =old R= =old https://en.wikipedia.org/wiki/flip-flop_(electronics) FSM Overview (A) 5 6/9/8

NOR-based SR Latch SET begins RST begins SET begins RST begins S R SET S= = S= R= S= R= S= R= S= R= S= R= S= S= R= R= S= R= R= = RESET S= = R= = Hold begins Hold begins Hold begins Hold begins HOL S= R= =old =old https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 6 6/9/8

NOR-based SR Latch States HOL RESET SET NOR based SR Latch S R S= R= S= R= S= R= S= R= S= R= SET S= R= = = = = = = RESET S= R= = = S= R= HOL S= R= =old =old https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 7 6/9/8

SR Latch States HOL, RESET SET HOL, SET SET S= R= = = RESET S= R= = = RESET HOL S= R= =old =old https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 8 6/9/8

NOR-based Latch SET / RESET https://en.wikipedia.org/wiki/flip-flop_(electronics) = C= SET S= = R= = C R S = C= RESET S= = R= = C R S FSM Overview (A) 9 6/9/8

NOR-based Latch HOL https://en.wikipedia.org/wiki/flip-flop_(electronics) C R =X C= HOL S= R= =old =old S C R =X C= HOL S= R= =old =old S FSM Overview (A) 6/9/8

NOR-based Latch Set / Reset / Hold SET begins RST begins SET begins RST begins https://en.wikiversity.org/wiki/the_necessities_in_igital_esign C C transparent opaque transparent opaque Hold begins Hold begins FSM Overview (A) 6/9/8

NOR-based Latch transparent / opaque https://en.wikiversity.org/wiki/the_necessities_in_igital_esign C C= C= C= transparent opaque transparent transparent C opaque C input output input output FSM Overview (A) 2 6/9/8

NOR-based Latch States HOL RESET SET NOR based Latch C C C= =X C= = C= = C= =X C= = = = C= = = = https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 3 6/9/8

Latch States C Opaque, Opaque, Transparent Transparent Transparent Trans C= = = = Trans C= = = = Transparent Opaque C= =old =X =old https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 4 6/9/8

Master-Slave FlipFlops Y C C C Y https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 5 6/9/8

Master-Slave FlipFlop Master Latch Y Y Slave Latch Y Master-Slave F/F https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 6 the hold output of the master is transparently reaches the output of the slave this value is held for another half period 6/9/8

Master Slave FlipFlop transparent / opaque transparent falling edge transparent falling edge transparent C opaque opaque opaque opaque else input output input output https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 7 6/9/8

Master-Slave FlipFlop Falling Edge Master Latch Y CK CK C CK C Y CK CK Slave Latch https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 8 6/9/8

Latch & FlipFlop Level Sensitive Latch CK= transparent CK= opaque CK C Edge Sensitive FlipFlop CK= transparent else opaque CK https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 9 6/9/8

FlipFlop with Enable () EN= Regular Flip Flop Sampling input @ posedge of CK EN CK EN= Holding Flip Flop Sampling output @ posedge of CK EN CK https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 2 6/9/8

FlipFlop with Enable (2) EN CK EN CK EN EN CK https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 2 6/9/8

Registers 3 3 3 3 Inputs to FFs 2 2 Outputs of FFs 2 Register 2 CLK https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 22 6/9/8

FF Timing (Ideal) 3 3 2 2 Inputs to FFs 3: Register Outputs of FFs 3: https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 23 6/9/8

States State (t) th edge (t+) th edge (t+2) th edge (t+3) th edge (t+4) th edge (t+5) th edge Inputs Outputs 3 3 2 2 Register 3: 3: (t) (t+) (t+2) (t+3) (t+4) (t+5) https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 24 6/9/8

Sequence of States (t) th edge (t+) th edge (t+2) th edge (t+3) th edge (t+4) th edge (t+5) th edge Inputs State Outputs 3 3 2 2 3:?????? Register 3: (t) (t+) (t+2) (t+3) (t+4) (t+5) Find inputs to FFs which will make outputs in this sequence https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 25 6/9/8

How to change current state Next State Current State NextSt gate delay Compute NextSt from CurrSt, Ta, Tb 3 3 CurrSt comb 2 Register 2 This NextSt becomes a new CurrSt Compute NextSt Current State input Next State CurrSt <= NextSt https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 26 6/9/8

Finding FF Inputs Next State Current State uring the t th clock edge period, 3 2 3 2 Comb Next State Logic Compute the next state (t+) using the current state (t) and other external inputs Place it to FF inputs After the next clock edge, (t+) th, the computed next state (t+) becomes the current state FSM inputs https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 27 6/9/8

Method of Finding FF Inputs 3: 3: (t+) (t+2) (t+3) (t+4) (t+5) (t+6) (t) (t+) (t+2) (t+3) (t+4) (t+5) Find the boolean functions 3, 2,, in terms of 3, 2,,, and external FSM inputs for all possible cases. FSM Inputs (t+) (t) + Inputs Current State (t) input Next State (t+) FSM Overview (A) 28 6/9/8

State Transition 3: 3: (t+) (t) (t+) Compute the next state using the current state and external inputs in the current clock cycle (t+) 3 3 2 2 comb Register (t) Inputs FSM Inputs Next State https://en.wikiversity.org/wiki/the_necessities_in_igital_esign Current State FSM Overview (A) 29 After the next clock edge, the computed next state (FF Inputs) becomes the current state (FF Outputs) 6/9/8

Traffic Lights Example https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 3 6/9/8

FSM Inputs and Outputs L B Traffic Lights - Outputs L A L B T B Sensor - Inputs L A T A T A L A T A T B T B L B https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 3 6/9/8

Four States T A = L B L B L A L A T A = L A L A L B L B GR YR T B = L B L B L A L A T B = L A L A L B L B RY RG https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 32 6/9/8

State Transition iagrams and Tables GR T A = T A = YR S S T A T B S' S' X X X X X X X X S S 2 L A L A L B L B RY T B = RG G Y R R R R G Y T B = G: Y: R: FSM Overview (A) 33 6/9/8

Next State Functions S and S 2 S S T A T B S' S' S S T A T B S' X X X X X X X X S S S S T B S S T B X X X X X X X X S' = S S + S S = S + S S S T A T B S' S' = S + S S' = S S T A + S S T B https://en.wikiversity.org/wiki/the_necessities_in_computer_esign S S T A S S T B X X X X X X X X S' = S S T A + S S T B FSM Overview (A) 34 6/9/8

Output Functions : L A, L A, L B, L B S S 2 L A L A L B L B S S 2 L A S S 2 L A L A =S L A =S S L A =S L A =S S L B =S L B =S S S S 2 L B S S 2 L B L B =S L B =S S https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 35 6/9/8

Moore FSM inputs T A NextSt gate delay Compute NextSt from CurrSt, Ta, Tb T B Next State S' Current State S CurrSt This NextSt becomes a new CurrSt clk S' states : S : S : S2 : S3 S S S outputs L A L A L B L B outputs (LA/LB) : Green : Yellow : Red : X Compute NextSt CurrSt <= NextSt https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 36 6/9/8

Moore FSM Implementation inputs T A Inputs T A T B T B Current State S S Next State S' Current State S' S S' = S + S Next States clk states : S : S : S2 : S3 S S S S' = S S T A + S S T B L A =S L A =S S L B =S L B =S S outputs S' = S + S S' = S S T A + S S T B Current State S S L A L A L Outputs B L L A =S L B B=S L A =S S L B =S S outputs (LA/LB) : Green : Yellow : Red : X https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 37 6/9/8

Next State Functions S and S 2 S S T A T B S' S' X X X X X Current State FSM Inputs Next State (S S ) (T A T B ) (S S ) X X X {,,,} {,,,} {,,,} S' = S + S S' = S S T A + S S T B https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 38 6/9/8

Cartesian Product S S T A T B S' S' X X X X X X X X Current State FSM Inputs Next State (S S ) (T A T B ) (S S ) {,,,} {,,,} {,,,} S S T A T B S' S' FSM Overview (A) 39 6/9/8

Output Functions : L A, L A, L B, L B S S 2 L A L A L B L B Current State (S S ) FSM Output (L A, L A, L B, L B ) G : Y : R : {,,, } {,,,} L A =S L A =S S L B =S L B =S S https://en.wikiversity.org/wiki/the_necessities_in_computer_esign FSM Overview (A) 4 6/9/8

Moore FSM FSM Inputs Next State Current State FSM Outputs Next State Combinational Logic State Register Output Combinational Logic clock https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 4 6/9/8

Mealy FSM FSM Inputs Next State Current State FSM Outputs Next State Combinational Logic State Register Output Combinational Logic clock https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 42 6/9/8

State iagram ST2 ST ST time E: Entry Action active output moore X: Exit Action active output moore I: Input Action active output mealy state output https://en.wikipedia.org/wiki/finite-state_machine FSM Overview (A) 43 6/9/8

Acceptors Acceptor FSM: parsing the string "nice" https://en.wikipedia.org/wiki/finite-state_machine FSM Overview (A) 44 6/9/8

Recognizers Representation of a finite-state machine; determines whether a binary number has an even number of s, where S is an accepting state. https://en.wikipedia.org/wiki/finite-state_machine FSM Overview (A) 45 6/9/8

Classifiers A classifier is a generalization of a finite state machine that, similar to an acceptor, produces a single output on termination but has more than two terminal states https://en.wikipedia.org/wiki/finite-state_machine FSM Overview (A) 46 6/9/8

Transducers Transducers generate output based on a given input and/or a state using actions. They are used for control applications and in the field of computational linguistics. https://en.wikipedia.org/wiki/finite-state_machine FSM Overview (A) 47 6/9/8

Acceptors, Recognizers, Transducers acceptors: either accept the input or not recognizers: either recognize the input transducers: generate output from given input https://cs.stanford.edu/people/eroberts/courses/soco/projects/24-5/automata-theory/basics.html FSM Overview (A) 48 6/9/8

General Transducers Transducers are used in electronic communications systems to convert signals of various physical forms to electronic signals, and vice versa. In this example, the first transducer could be a microphone, and the second transducer could be a speaker. https://en.wikipedia.org/wiki/transducer FSM Overview (A) 49 6/9/8

Transducers : Moore and Mealy Machines Fig. 7 Transducer FSM: Mealy model example There are two input actions (I:): "start motor to close the door if command_close arrives" Fig. 6 Transducer FSM: Moore model example "start motor in the other direction to open the door if command_open arrives". https://en.wikipedia.org/wiki/finite-state_machine FSM Overview (A) 5 6/9/8

Moore machine example output does not depend on inputs https://en.wikipedia.org/wiki/moore_machine FSM Overview (A) 5 6/9/8

Mealy machine input / output output does depend on inputs https://en.wikipedia.org/wiki/mealy_machine FSM Overview (A) 52 6/9/8

Mathematical Model transducers () A finite-state transducer is a sextuple (Σ, Γ, S, s, δ, ω), where: Σ is the input alphabet (a finite non-empty set of symbols). Γ is the output alphabet (a finite, non-empty set of symbols). S is a finite, non-empty set of states. s is the initial state, an element of S. δ is the state-transition function: δ : S Σ S ω is the output function. Moore machine : ω : S Γ Mealy machine : ω : S Σ Γ (Σ, Γ, S, s, δ, ω) (I, O, S, f, g, σ) https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 53 6/9/8

Mathematical Model transducers (2) If the output function is a function of a state and input alphabet (ω : S Σ Γ) that definition corresponds to the Mealy model, and can be modelled as a Mealy machine. If the output function depends only on a state (ω : S Γ) that definition corresponds to the Moore model, and can be modelled as a Moore machine. A finite-state machine with no output function at all is known as a semiautomaton or transition system. https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 54 6/9/8

Mathematical Models acceptors A deterministic finite state machine or acceptor deterministic finite state machine is a quintuple (Σ, S, s, δ, F), where: output set {, } Σ is the input alphabet (a finite, non-empty set of symbols). S is a finite, non-empty set of states. s is an initial state, an element of S. δ is the state-transition function: δ : S Σ S F is the set of final states, a (possibly empty) subset of S. output function ω A set of accepted states https://en.wikiversity.org/wiki/the_necessities_in_igital_esign FSM Overview (A) 55 6/9/8

Finite State Tranducers and Acceptors limited finite state machine (Σ, S, δ) finite state acceptor (Σ, S, s, δ, F) finite-state transducer (Σ, Γ, S, s, δ, ω) Finite State Automaton (FSA) Finite State Machine (FSM) Σ is the input alphabet (a finite non-empty set of symbols). S is a finite, non-empty set of states. δ is the state-transition function: δ : S Σ S s is the initial state, an element of S. F is the set of final states, a (possibly empty) subset of S. Γ is the output alphabet (a finite, non-empty set of symbols). ω is the output function. FSM Overview (A) 56 6/9/8

References [] http://en.wikipedia.org/ [2] 6/9/8