1 / 22

One-Hot Encoded Finite State Machines

One-Hot Encoded Finite State Machines. InA’. A. InA’. InA. D. B. Z. InA. InB. C. Z. InB’. Example State Machine. State A = 00 State B = 01 State C = 10 State D = 11. D Q. D Q. Example Machine Implementation. Q1. N1 = Q1•Q0’ + Q1’•Q0•InA N0 = Q1•Q0’•InB + Q1’•Q0’•InA

fell
Download Presentation

One-Hot Encoded 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. One-Hot EncodedFinite State Machines ECEn 224

  2. InA’ A InA’ InA D B Z InA InB C Z InB’ Example State Machine State A = 00 State B = 01 State C = 10 State D = 11 ECEn 224

  3. D Q D Q Example Machine Implementation Q1 N1 = Q1•Q0’ + Q1’•Q0•InA N0 = Q1•Q0’•InB + Q1’•Q0’•InA Z = Q1’•Q0 + Q1•Q0’ Q0’ N1 Q1 Q1’ Q0 InA CLK Q1 Q0’ InB N0 Q0 • Logic Used: • 9 gates • 21 gate inputs • 2 flip flops Q1’ Q0’ InA CLK Q1’ Q0 Z Q1 Q0’ ECEn 224

  4. Choose a Different Encoding • A=1000, B=0100, C=0010, D=0001 Because of the state encodings,there are many illegal states.This TT with all these input don’t cares is the result This is called a one-hot encoding. Only one state bit is on at a time ECEn 224

  5. One-Hot Encoding Results • Will require 4 flip flops • One per state • Call the current state bits A, B, C, and D • Call the next state bits NA, NB, NC, and ND InA’ A By inspection we see: NA = A•InA’ + B•InA’ + D NB = A•InA NC = B•InA + C•InB’ ND = C•InB Z = B + C InA’ InA D B Z InA InB C Z InB’ ECEn 224

  6. D Q D Q D Q D Q One-Hot Implementation A B InA’ NA NC B InA A C InA’ C InB’ D CLK CLK NB ND A C B D InA InB CLK CLK B • Logic Used: • 9 gates • 19 gate inputs • 4 flip flops Z C ECEn 224

  7. One-Hot Observations • Choosing a one-hot encoding results in many, many don’t cares in transition table • Minimization results in simpler IFL and OFL • Requires more flip flops • Can do one-hot design by inspection • Without using transition tables… ECEn 224

  8. Another One-Hot Example x’ A x y’z B y’z’ y C ECEn 224

  9. D Q D Q D Q State Encoding and Structure NA A With one-hot encoding, each state has its own flip flop. ‘A’ is the name of a state and it is the name of the wire coming out of the flip flop for state ‘A’. The same holds true for states ‘B’ and ‘C’ NB B NC C ECEn 224

  10. One-Hot Encodings By Inspection x’ When is A the next state? Look at the arcs entering state A NA = A•x’ + B•y’z + C A x y’z B y’z’ y C ECEn 224

  11. One-Hot Encodings By Inspection x’ When is A the next state? Look at the arcs entering state A NA = A•x’ + B•y’z + C A x y’z B y’z’ y C ECEn 224

  12. One-Hot Encodings By Inspection x’ When is A the next state? Look at the arcs entering state A NA = A•x’ + B•y’z + C A x y’z B y’z’ y C ECEn 224

  13. One-Hot Encodings By Inspection x’ When is A the next state? Look at the arcs entering state A NA = A•x’ + B•y’z + C A x y’z B y’z’ y C Similar reasoning leads to: NB = A•x + B•y’z’NC = B•y ECEn 224

  14. The Key Lock Problem – One-Hot Version There will be 6 flip flops One for each state ECEn 224

  15. Key Lock Input Forming Logic NA = (PUSHED’•A) + (ECNT3’•E) + (WAITDONE•F) + (LOCKED•D) NB = (PUSHED’•B)+(PUSHED•7•A) NC = (PUSHED’•C)+(PUSHED•8•B) ND = (LOCKED’•D)+(PUSHED•9•C) NE = (PUSHED•7’•A) + (PUSHED•8’•B) + (PUSHED•9’•C) NF = (ECNT3•E) + (WAITDONE’•F) ECEn 224

  16. Key Lock Output Forming Logic ERROR = ECEn 224

  17. Key Lock Output Forming Logic ERROR = E INC = ECEn 224

  18. Key Lock Output Forming Logic ERROR = E INC = (PUSHED•7’•A) + (PUSHED•8’•B) + (PUSHED•9’•C) CLRTIMER = ECEn 224

  19. Key Lock Output Forming Logic ERROR = E INC = (PUSHED•7’•A) + (PUSHED•8’•B) + (PUSHED•9’•C) CLRTIMER = ECNT3•E CLRCNTR = ECEn 224

  20. Key Lock Output Forming Logic ERROR = E INC = (PUSHED•7’•A) + (PUSHED•8’•B) + (PUSHED•9’•C) CLRTIMER = ECNT3•E CLRCNTR = (WAITDONE•F) + (LOCKED•D) UNLOCK = ECEn 224

  21. Key Lock Output Forming Logic ERROR = E INC = (PUSHED•7’•A) + (PUSHED•8’•B) + (PUSHED•9’•C) CLRTIMER = ECNT3•E CLRCNTR = (WAITDONE•F) + (LOCKED•D) UNLOCK = (PUSHED•9•C) ECEn 224

  22. Other State Encoding Techniques • You have learned the 2 extremes • Fully encoded (8 states  3 state bits) • One-hot encoded (8 states  8 state bits) • A range of options exist in between • A good choice of encoding • Can minimize IFL and OFL complexity • Algorithms have been developed for this… • Beyond the scope of this class ECEn 224

More Related