1 / 12

State Machine

State Machine.

chaylse
Download Presentation

State Machine

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. State Machine Definition of 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. Like this:

  2. Examples of State Machine There are numerous examples of everyday devices that are controlled by a state machine: Traffic Light Garage Door Numeric Keypad Vending Machine

  3. State Machine Block Diagram ... ... ... ... Input Combo Logic Memory Flip-Flops Output Combo Logic Output(s) Input(s) Clock

  4. State Machine Design Steps • Create State Graph • Determine State Variables & Assign • Encode Outputs to States • Create State Transition Table • Write & Simplify Design Equations • Design Circuit

  5. How to make a state graph Make a bubble for each state. Say you want to display the numbers 415 over and over again in that order. There are 3 states: State 0 = 4 State 1 = 1 State 2 = 5

  6. State Machine Design Example • Example: • Design a state machine that will count out the three digits 4 1 5 • Whenever the Enable is a logic (1), the outputs will continuously cycle through the three values 4,1, 5. Whenever the Enable is a logic (0), the outputs will hold at their current values. “4”  “1”  “5” C3 C2 C1 C0 Numbers Enable Clock

  7. Anatomy of a State Graph Input Variable ( EN) (Enable switch) When it’s 0 stay in the same state EN = 0 S0 Qa Qb 0 0 A=1 B=0 C=0 State “Bubble” EN = 1 Transition Arc This is where to go when EN=1 State Variables (i.e. Qa & Qb) Says this is state 00 Output Variables What is displayed At state 0 a 4 (100) is displayed

  8. Step #1 : Create State Graph for “415” EN = 0 S0 EN = 1 “4” S1 EN = 1 EN = 0 “1” S2 “5” EN = 1 EN = 0

  9. Step #2 & 3 : Assign variables, Encode Outputs to States EN = 0 S0 EN = 1 EN = 1 Qa Qb 0 0 “4” C2=1 C1=0 C0=0 S1 EN = 0 Qa Qb 0 1 “1” C2=1 C1=0 C0=1 C2=0 C1=0 C0=1 S2 Qa Qb 1 0 “5” EN = 1 EN = 0

  10. Step #3 : Create State Transition Table Assuming that you are using D flip flops, Da is the input to flip flop A, Db to B

  11. Write and simplify equations The flip flops need to receive the signal so that on the next clock pulse they will change to the next state The next state is determined by the current state and the input. In this case if the Enable is true, it moves to the next state or else if stays at the current output. Da = Qb EN + Qa Db = Qa’ Qb’ EN + Qb EN’ C2 = Qb C1 = 0 (always off) C0 = Qa + Qb

  12. Step #5 : Circuit Design Da = Qb EN + Qa These are the inputs to the flip flops Db = Qa’ Qb’ EN + Qb EN’ Flip flop b Flip flop a ENABLE clock C2 = Qb These are the output signals C1 = 0 (always off) C0 = Qa + Qb We will finish the circuit in class

More Related