State Machine Design State Machine Design Digital Electronics

Slides:



Advertisements
Similar presentations
Sequential Circuits Storage elements
Advertisements

State Machine Design Procedure
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Sequential logic circuits. 2 Outline Sequential Circuit Models –Asynchronous –Synchronous Latches Flip-Flops.
1 Lecture 23 More Sequential Circuits Analysis. 2 Analysis of Combinational Vs. Sequential Circuits °Combinational : Boolean Equations Truth Table Output.
ECE 331 – Digital System Design Introduction to and Analysis of Sequential Logic Circuits (Lecture #20) The slides included herein were taken from the.
ECE 331 – Digital System Design
EECC341 - Shaaban #1 Lec # 14 Winter Clocked Synchronous State-Machines Such machines have the characteristics: –Sequential circuits designed.
Give qualifications of instructors: DAP
Overview Finite State Machines
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.
Chapter 9 Counters.
Lecture 21 Overview Counters Sequential logic design.
EKT 124 / 3 DIGITAL ELEKTRONIC 1
1 EENG 2710 Project Synchronous Counters. 2 Counters Counter: A Sequential Circuit that counts pulses. Used for Event Counting, Frequency Division, Timing,
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
Mid3 Revision Prof. Sin-Min Lee. 2 Counters 3 Figure 9--1 A 2-bit asynchronous binary counter. Asynchronous Counter Operation.
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
State Machine Design State Machine Design Digital Electronics
Digital Computer Design Fundamental
T Flip-Flop A T (toggle) flip-flop is a complementing flip-flop and can be obtained from a JK flip-flop when the two inputs are tied together. When T =
Boolean Algebra and Digital Logic
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Circuit, State Diagram, State Table
Chap 4. Sequential Circuits
Digital Logic Design Sequential circuits
Sequential Logic Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer Organization and.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
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.
Counters Dr. Rebhi S. Baraka Logic Design (CSCI 2301) Department of Computer Science Faculty of Information Technology The Islamic University.
CE1110: Digital Logic Design Sequential Circuits.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
Review of Digital Logic Design Concepts OR: What I Need to Know from Digital Logic Design (EEL3705)
9/15/09 - L21 Sequential Circuit Analaysis Copyright Joanne DeGroat, ECE, OSU1 Sequential Circuit Analysis.
Computer Organization & Programming Chapter 5 Synchronous Components.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Complete Example.
2017/4/24 1.
Lecture 5. Sequential Logic 2 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
FINITE STATE MACHINES (FSMs)
DLD Lecture 26 Finite State Machine Design Procedure.
1 Finite State Machines (FSMs) Now that we understand sequential circuits, we can use them to build: Synchronous (Clocked) Finite State Machines Finite.
ANALYSIS OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
Finite State Machines Prof. Sirer COMP 303 Koç University.
Analysis and Synthesis of Synchronous Sequential Circuits A “synchronizing” pulse/edge signal (clock) controls the operation of the memory portion of the.
Registers; State Machines Analysis Section 7-1 Section 5-4.
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapter 4 – Part 4 Tom Kaminski & Charles.
SYEN 3330 Digital SystemsJung H. Kim 1 SYEN 3330 Digital Systems Chapter 6 – Part 4.
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.
Sequential Logic Circuit Design Eng.Maha Alqubali.
TOPIC : Introduction to Sequential Circuits UNIT 1: Modeling and Simulation Module 4 : Modeling Sequential Circuits.
LATCHED, FLIP-FLOPS,AND TIMERS
Sequential logic design principles
Asynchronous Inputs of a Flip-Flop
ECE 301 – Digital Electronics
Sequential logic circuits
ECE 3130 – Digital Electronics and Design
Analysis of Synchronous Sequential Circuits
EEL 3705 / 3705L Digital Logic Design
Analysis of Synchronous Sequential Circuits
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
State Machine Design State Machine Design Digital Electronics
MTE 202, Summer 2016 Digital Circuits Dr.-Ing. Saleh Hussin
FINITE STATE MACHINES.
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
State Machine Design State Machine Design Digital Electronics
Presentation transcript:

State Machine Design State Machine Design Digital Electronics Lesson 3.4 State Machine Design State Machine Design Project Lead The Way, Inc. Copyright 2009

State Machine Design This presentation will Define a state machine. Digital Electronics Lesson 3.4 State Machine Design State Machine Design This presentation will Define a state machine. Provide several examples of everyday items that are controlled by state machines. Illustrate the block diagram for a state machine. Review the design steps in the state machine design process. Provide an example of a simple state machine design. Introductory Slide / Overview of Presentation Project Lead The Way, Inc. Copyright 2009

Definition of a State Machine State Machine Design Digital Electronics Lesson 3.4 State Machine Design Definition of a State Machine State Machine A synchronous sequential circuit, consisting of a sequential logic section and a combinational logic section, whose outputs and internal flip-flops progress through a predictable sequence of states in response to a clock and other input signals. Floyd, T. (2006). Digital fundamentals. Upper Saddle River, NY: Pearson Education. Project Lead The Way, Inc. Copyright 2009

Examples of State Machines State Machine Design Digital Electronics Lesson 3.4 State Machine Design Examples of State Machines Many everyday devices are controlled by state machines. Traffic Light Garage Door Numeric Keypad Vending Machine This slide provides three simple state machine applications. Ask students to consider other applications that they think may utilize state machines. Project Lead The Way, Inc. Copyright 2009

State Machine Block Diagram State Machine Design Digital Electronics Lesson 3.4 State Machine Design State Machine Block Diagram Input Combo Logic Memory Flip-Flops Output Combo Logic ... ... ... Output(s) Input(s) ... This the block diagram of a complete state machine. Clock Project Lead The Way, Inc. Copyright 2009

State Machine Design Steps Digital Electronics Lesson 3.4 State Machine Design State Machine Design Steps Create State Graph Determine State Variables and Assign Encode Outputs to States Create State Transition Table Write and Simplify Design Equations Design Circuit These are the six design steps for designing a state machine. Project Lead The Way, Inc. Copyright 2009

Anatomy of a State Graph State Machine Design Digital Electronics Lesson 3.4 State Machine Design Anatomy of a State Graph Transition Arc (For Input X=0) S0 Qa Qb 0 0 Y=0 & Z=1 X = 0 X = 1 Input Variable (X) State (S0) State “Bubble” Transition Arc (For Input X=1) A state graph shows the sequence of states that the state machine will transition to on each clock transition. Each state “bubble” is labeled (S0, S1, S2). These labels are arbitrary. Each transition arc is labeled with the value(s) of the input variable(s) that make the transition occur. Each state is assigned the value of the output(s) when the state machine is in that state. The state variable are the outputs of the flip-flops, so they are typically called Qa, Q0, Q1, Qz, etc. Each state is assigned state variables. The number of state variables is determined by the number of states according the following function: # States <= 2(# state variables) ; For example: 2 States Requires - 1 State Variable 4 States Requires - 2 State Variable 8 States Requires - 3 State Variable 16 States Requires - 4 State Variable There will be the occasion when a design has unused states. For example, if your design requires 6 states, you will need 3 state variables (6 <= 23). Thus, there will be a total of eight states (23 = 8), and only six will be used. State Variables (Qa & Qb) Output Variables (Y & Z) Project Lead The Way, Inc. Copyright 2009

State Machine Design Example Digital Electronics Lesson 3.4 State Machine Design State Machine Design Example Example: Design a state machine that will count out the last four digits of the phone number 585-476-4691. In addition to the clock input, this design has a second input called Enable (EN). Whenever the Enable is a logic (1), the outputs will continuously cycle through the four values 4,6,9,1. Whenever the Enable is a logic (0), the outputs will hold at their current values. For this design any form of combinational logic may be used, but the sequential logic must be limited to D flip-flops. “4”  “6”  “9”  “1” Design specifications for a simple state machine. Phone Numbers Enable Clock C3 C2 C1 C0 Project Lead The Way, Inc. Copyright 2009

Step #1: Create State Graph State Machine Design Digital Electronics Lesson 3.4 State Machine Design Step #1: Create State Graph EN = 0 S0 “4” EN = 1 EN = 1 EN = 0 S3 “1” S1 “6” EN = 0 This design has only one input (EN), so each state bubble should have two transition arcs, one for EN=0 and one for EN=1. This design has four possible output conditions (“4” – “6” – “9” – “1”); thus, the design requires four state bubbles. S2 “9” EN = 1 EN = 1 EN = 0 Project Lead The Way, Inc. Copyright 2009

Step #2: Determine State Variables and Assign State Machine Design Digital Electronics Lesson 3.4 State Machine Design EN = 0 S0 Qa Qb 0 0 “4” EN = 1 EN = 1 EN = 0 S3 Qa Qb 1 1 “1” S1 Qa Qb 0 1 “6” EN = 0 With four states, this design requires two state variables (4 = 22). These state variables are labeled Qa and Qb. This labeling is arbitrary but does use the recommended Q notation (these are the flip-flop outputs). Note: Qx and Qy or Q0 and Q1 would also work. The four combinations of the two state variables (00, 01, 10, and 11) are assigned to the four states (S0, S1, S2, S3). S2 Qa Qb 1 0 “9” EN = 1 EN = 1 EN = 0 Project Lead The Way, Inc. Copyright 2009

Step #3: Encode Outputs to States State Machine Design Digital Electronics Lesson 3.4 State Machine Design Step #3: Encode Outputs to States EN = 0 S0 Qa Qb 0 0 “4” EN = 1 EN = 1 C3=0 C2=1 C1=0 C0=0 EN = 0 S3 Qa Qb 1 1 “1” S1 Qa Qb 0 1 “6” EN = 0 In order to display the output in binary, encode from base-ten output count into base-two (binary). Because the largest output count is “9”, four output variables are needed to represent this number in binary (“9” = 1001). These output variables will be labeled C3, C2, C1, and C0. Thus, for example, in state S0 the output “4” encoded into binary would be 0100 (C3=0, C2=1, C1=0, and C0=0). Repeat this process for the three remaining states. C3=1 C2=0 C1=0 C0=1 C3=0 C2=0 C1=0 C0=1 S2 Qa Qb 1 0 “9” C3=0 C2=1 C1=1 C0=0 EN = 1 EN = 1 EN = 0 Project Lead The Way, Inc. Copyright 2009

Step #3: Create State Transition Table State Machine Design Digital Electronics Lesson 3.4 State Machine Design Step #3: Create State Transition Table State Inputs Outputs Present Input Next F/F Encoded Qa Qb EN Qa* Qb* Da Db C3 C2 C1 C0 S0 1 S1 S2 S3 State transition table for the design example. Project Lead The Way, Inc. Copyright 2009

Step #4: Write and Simplify Design Equations State Machine Design Step #4: Write and Simplify Design Equations Digital Electronics Lesson 3.4 State Machine Design These are the design equations. The simplification (Boolean or K-Mapping) is left as a potential exercise for the students. Project Lead The Way, Inc. Copyright 2009

Step #5: Circuit Design Final state machine design. Digital Electronics Lesson 3.4 State Machine Design Step #5: Circuit Design Final state machine design. Project Lead The Way, Inc. Copyright 2009

Block Diagram / Schematic State Machine Design Digital Electronics Lesson 3.4 State Machine Design Block Diagram / Schematic Mapping of the final state machine design to the general block diagram for a state machine. The final output from the state machine can then be the input into a BCD seven segment decoder. This will allow the phone number to be viewed on a 7-segment display. Project Lead The Way, Inc. Copyright 2009