1 / 24

ECE2030 Introduction to Computer Engineering Lecture 16: Finite State Machines

ECE2030 Introduction to Computer Engineering Lecture 16: Finite State Machines. Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech. MEALY MACHINE. MOORE MACHINE. Inputs X(t). Outputs Z(t). Inputs X(t). Combinational circuits. Combinational circuits.

dai
Download Presentation

ECE2030 Introduction to Computer Engineering Lecture 16: Finite State Machines

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. ECE2030 Introduction to Computer EngineeringLecture 16: Finite State Machines Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech

  2. MEALY MACHINE MOORE MACHINE Inputs X(t) Outputs Z(t) Inputs X(t) Combinational circuits Combinational circuits Storage Element S(t) Storage Element S(t) Outputs Z(t) Z(t) = {S(t), X(t)} Z(t) = {S(t)} Mealy and Moore Machines

  3. State and State Diagram • A state represents the machine snapshot at a given clock period • A clock is typically used to synchronize the state transition • A graph consists of a set of • Circles: • Each represents a state • Use double circle to represent the initial state • Directed arc: each represents a state transition • Inputs/outputs • Mealy machine: • Label input/output along each arc • Moore machine: • Label input along each arc • Label output inside the circle (i.e. state)

  4. a/p a b Sk Sj Sk/p Sj/q b/p a/q a b/q b State Diagrams A Mealy machine example A Moore machine example Example: State: S(t) {Sk, Sj} Inputs: X(t)  {a, b} Outputs: Z(t) {p, q} Initial state: S(0) = Sk

  5. 0/0 S0 S1 1/0 0/0 1/1 0/0 0/0, 1/1 S1 S0 1/0 State Diagram Examples (Mealy)

  6. 0 0, 1 S0/0 S1/1 1 State Diagram Examples (Moore) 0 S0/1 S1/0 1 0 1

  7. Design Example: Sequence Recognizer • A sequential circuit that recognizes the occurrence of a particular bit sequence • Input: X(t)  {0, 1} • Output: Z(t)  {0, 1}

  8. Sequence Recognizer Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 X(t) 1 0 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 Z(t) 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1

  9. S1 S2 S3 Sequence Recognizer Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 X(t) 1 0 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 Z(t) 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 1/1 1/0 0/0 1/0 S0 1/0 0/0 0/0 0/0 A Meanly Machine

  10. State Table 1/1 1/0 0/0 1/0 00 01 10 11 1/0 0/0 0/0 0/0

  11. Logic Circuits Design Steps • Generate a Boolean function for • Each external output • Each state encoded bit • Simplify the Boolean functions • Draw a D F/F (or register) for each state encoded bit • Draw logic circuits for • External outputs • Each inputs of state encoded bits • Input of state encoded bits = the next state • Output of state encoded bits = the current state

  12. Logic Circuits Design N1 P1P0 X N0 P1P0 X

  13. X D0 F/F D0 F/F N0 N0 P0 P0 1 1 2 2 Z D1 F/F N1 P1 1 2 Logic Circuits Design

  14. Example 2 • Input: X(t)  {a, b, c} • Output: Z(t)  {q, p}

  15. c SEE/p SOO/p SOE/p a State Diagram b a b c C SEO/q b b a c a A Moore Machine

  16. b a b c C 01/q b b a c a c 00/p 10/p 11/p a State Table SEE = 00 SEO = 01 SOO = 10 SOE = 11 a = 00 b = 01 c = 10 p = 0 q = 1

  17. Logic Circuit Design N1 X1X0 P1P0 N0 X1X0 P1P0 Z X1X0 P1P0

  18. D0 F/F N0 P0 1 2 Z X0 D1 F/F N1 P1 1 2 Logic Circuit Design X1

  19. Vending Machine State Machine • Dispense a Coke when depositing 15 ¢ • Inputs • 5 = a nickel • 10 = a dime • BC = bad coin (including quarters in this example) • Outputs • R = reject • C = coke • N = no coke

  20. 5/N 5 ¢ 10/C 5/C 10/C 10/N 5/N 10 ¢ State Diagram BC/R 0 ¢ BC/R BC/R

  21. 10/C 5/C 10/C 5/N State Table 5/N BC/R 0 ¢ (00) 5 ¢ (01) BC/R 10/N 10 ¢ (10) BC/R 5: 00 10: 01 BC: 10 N: 00C: 01 R: 10

  22. Logic Circuits Design N1 X1X0 P1P0 N0 X1X0 P1P0

  23. Logic Circuits Design C1 X1X0 P1P0 C0 X1X0 P1P0

  24. X1 X0 P1 P0 D0 F/F N0 P0 1 2 D1 F/F N1 P1 1 2 C0 C1 Logic Circuits of the Vending Machine

More Related