FINITE STATE MACHINES (FSMs)

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

Finite State Machines (FSMs)
State-machine structure (Mealy)
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Synchronous Sequential Logic
Computing Machinery Chapter 5: Sequential Circuits.
Sequential Logic Design with Flip-flops
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
ECE 331 – Digital System Design
Give qualifications of instructors: DAP
FINITE STATE MACHINES (FSMs) Dr. Konstantinos Tatas.
ECE 301 – Digital Electronics
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)
ENGIN112 L25: State Reduction and Assignment October 31, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 25 State Reduction and Assignment.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR1 Sequential Circuit Design.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
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
Synchronous Circuit Design (Class 10.1 – 10/30/2012) CSE 2441 – Introduction to Digital Logic Fall 2012 Instructor – Bill Carroll, Professor of CSE.
Circuit, State Diagram, State Table
Chapter 8 -- Analysis and Synthesis of Synchronous Sequential Circuits.
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.,
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits Previously, we described the basic building blocks of sequential circuits,
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.
Digital Circuits State Reduction and Assignment State Reduction reductions on the number of flip-flops and the number of gates a reduction in the.
DESIGN OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
1 State Reduction Goal: reduce the number of states while keeping the external input-output requirements unchanged. State reduction example: a: input 0.
A sequential logic circuit (a.k.a. state machine) consists of both combinational logic circuit(s) and memory devices (flip flops). The combinational circuits.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Introduction to Sequential Logic Design Finite State-Machine Analysis.
Week #7 Sequential Circuits (Part B)
Sequential Networks and Finite State Machines
Figure 8.1. The general form of a sequential circuit.
Introduction to Sequential Logic Design
ANALYSIS OF SEQUENTIAL CIRCUITS
© Copyright 2004, Gaetano Borriello and Randy H. Katz
Sequential logic design principles
Adapted by Dr. Adel Ammar
FIGURE 5.1 Block diagram of sequential circuit
CSCE 211: Digital Logic Design
ECE 301 – Digital Electronics
CSCE 211: Digital Logic Design
CENG 241 Digital Design 1 Lecture 11
State Reduction and State Assignment
Digital Design Fundamentals
Sequential Networks and Finite State Machines
CSCE 211: Digital Logic Design
CSE 140L Discussion Finite State Machines.
CSCE 211: Digital Logic Design
ECE 3130 – Digital Electronics and Design
Recap D flip-flop based counter Flip-flop transition table
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
MTE 202, Summer 2016 Digital Circuits Dr.-Ing. Saleh Hussin
Lecture No. 32 Sequential Logic.
DESIGN OF SEQUENTIAL CIRCUITS
FINITE STATE MACHINES.
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
CSCE 211: Digital Logic Design
ECE 352 Digital System Fundamentals
ECE 352 Digital System Fundamentals
Announcements Assignment 7 due now or tommorrow Assignment 8 posted
CSE 370 – Winter Sequential Logic-2 - 1
COE 202: Digital Logic Design Sequential Circuits Part 3
Presentation transcript:

FINITE STATE MACHINES (FSMs) Dr. Konstantinos Tatas

ACOE161 - Digital Logic for Computers - Frederick University Finite State Machine A generic model for sequential circuits used in sequential circuit design ACOE161 - Digital Logic for Computers - Frederick University

Finite state machine block diagram State memory: Set of n flip-flops that hold the state of the machine (up to 2^n distinct states) Next state logic: Combinational circuit that determines the next state as a function of the current state and the input Output logic: Combinational circuit that determines the output as a function of the current state and the input ACOE161 - Digital Logic for Computers - Frederick University

Finite State Machine types Mealy machine: The output depends on the current state and input Moore machine: The output depends only on the current state State = output state machine: A Moore type FSM where the current state is the output ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University State diagram A state diagram represents the states as circles and the transitions between them as arrows annotated with inputs and outputs   ACOE161 - Digital Logic for Computers - Frederick University

Analysis of FSMs with D flip-flops Determine the next state and output functions Use the functions to create a state/output table that specifies every possible next state and output for any combination of current state and input ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University EXAMPLE ACOE161 - Digital Logic for Computers - Frederick University

Next state equations and state table for example y 1 A+=Ax+Bx B+=A΄x Y=(A+B)x΄ ACOE161 - Digital Logic for Computers - Frederick University  

ACOE161 - Digital Logic for Computers - Frederick University A+=Ax+Bx B+=A΄x Y=(A+B)x΄ A B x A+ B+ y 1 ACOE161 - Digital Logic for Computers - Frederick University

Sequential circuit design methodology From the description of the functionality or the state/timing diagram find the state table Encode the states if the state table contains letters Find the necessary number of flip-flops Select flip/flop type From the state table, find the excitation tables and output tables Using Karnaugh maps find the flip-flop input logic expressions Draw the circuit logic diagram ACOE161 - Digital Logic for Computers - Frederick University

Example: Design the sequential circuit of the following state diagram ACOE161 - Digital Logic for Computers - Frederick University

State/excitation table DA DB JA KA JB KB   1 ACOE161 - Digital Logic for Computers - Frederick University      

Karnaugh maps for combinational circuit ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University Circuit logic diagram ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University Example: counter ACOE161 - Digital Logic for Computers - Frederick University

Self-correcting state machines The previous example did not include two possible states “011” and “111”. If the counter unexpectedly falls into one of those states there are two possibilities: The counter will recover by entering a valid state after a finite number of cycles (self-correcting) The counter will stay in a non-valid state until the f/fs are reset (not self-correcting) Finite state machines should be designed to be self correcting by assigning non-valid states to a valid next state (no don’t cares in the excitation table) ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University Example Design a self-correcting one-digit BCD counter ACOE161 - Digital Logic for Computers - Frederick University

State minimization/assignment Often the state of the circuit is not also the output and therefore the states are named abstractly State minimization and state assignment are then required State minimization is the simplification of the state diagram so that a circuit with less states produces the same output sequence State assignment is the process of assigning a binary number to each state ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University Example State values are not important just the input/output sequence States are symbolized with letters ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University State table Current state Input Next state Output a 1 b c d e f g ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University State equivalence Current state Input Next state Output a 1 b c d e f g Two states are equivalent if for any element of the input set both produce the same output and send the circuit to the same state or an equivalent one. One of the two equivalent states can be eliminated from the state diagram ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University State minimization Current state Input Next state Output a 1 b c d e f g d d e ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University State assignment Since we don’t care about the actual flip-flop values for each state we can assign each state to any binary number we like as long as each state is assigned a unique binary number If we use 3 bits to encode the states, we have possible encodings state Encoding 1 (binary) Encoding 2 (Gray) Encoding 3 a 000 b 001 010 100 c 011 d 101 e 111 ACOE161 - Digital Logic for Computers - Frederick University

ACOE161 - Digital Logic for Computers - Frederick University One-hot encoding One flip-flop per state encoding Leads to greater number of flip-flops than binary encoding but possibly to simpler logic state Encoding 1 (binary) 2 (Gray) Encoding 3 (one-hot) a 000 00001 b 001 010 00010 c 011 00100 d 101 01000 e 100 111 10000 ACOE161 - Digital Logic for Computers - Frederick University