1 / 18

FINITE STATE MACHINES (FSMs)

This article discusses finite state machines (FSMs) and their application in sequential circuit design. It covers the concepts of state memory, next state logic, output logic, and different types of FSMs. The article also explains state diagrams, analysis of FSMs with D flip-flops, and provides examples for sequential circuit design methodology.

julianp
Download Presentation

FINITE STATE MACHINES (FSMs)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FINITE STATE MACHINES (FSMs) Dr. Konstantinos Tatas

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

  3. 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

  4. 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

  5. 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

  6. 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

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

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

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

  10. 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

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

  12. A B x A+ B+ DA DB JA KA JB KB 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 State/excitation table ACOE161 - Digital Logic for Computers - Frederick University

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

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

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

  16. 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

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

  18. Example • Design the circuit for the left and right indicator lights in a car. • Inputs: • Clock: Frequency equal to the flashing rate • Reset: for initializing flip-flops • Left, Right: normally zero, remain one for the duration of the turn • Emergency: Rising edge active, both lights should be flashing ACOE161 - Digital Logic for Computers - Frederick University

More Related