Presentation is loading. Please wait.

Presentation is loading. Please wait.

State Machines (Closed Loop / Moore) Synch 2.1  Paul R. Godin Updated: January 2008.

Similar presentations


Presentation on theme: "State Machines (Closed Loop / Moore) Synch 2.1  Paul R. Godin Updated: January 2008."— Presentation transcript:

1 State Machines (Closed Loop / Moore) Synch 2.1  Paul R. Godin Updated: January 2008

2 Synchronous Counters In a synchronous design, each Flip-Flop receives its own clock input, significantly reducing the instances of glitches. This module investigates how to provide a sequential output in any sequence desired. Synch 2.2

3 Synchronous Counters With each Flip-Flop receiving its own edge, there exists the flexibility to “steer” the output of each flip- flop independently by applying input states from an external source at the appropriate time. Synch 2.3 DQ0 or 1 Edge 0 or 1

4 State Machines A state machine is a device that will provide a sequence of binary numbers that may not follow a natural count sequence. An example of a state machine count: Synch 2.4 000 010 110 001 State Diagram

5 Starting and Recycling When first applying power to the circuit the starting output is typically all low (000…). When designing a state machine this and any other unwanted state must be taken into account. Note that the recycling point is not necessarily all low (000…) Synch 2.5 000 010 110 001 State Diagram

6 State Table Synch 2.6 PresentNext QAQA QBQB QCQC QAQA QBQB QCQC 000010 010110 110001 001000

7 Input versus Output states For state machine counts, the input to steer the output of each of the Flip-Flops can come from the outputs of any of the other Flip-Flops. By the use of external gates (if necessary), specific, usable sequences of Flip-Flop outputs can be used to create the necessary next input levels. K-Mapping techniques can be used to record and simplify the available outputs to create these inputs. Synch 2.7

8 Transition Tables It is necessary to know what inputs to the Flip-Flops are necessary to create the desired output states. Transition tables help define the operation of the Flip- Flop based on input states. Synch 2.8

9 Transition Tables D-Flip-Flop Transition Table The present and the next states of the outputs are indicated. The arrows indicate after the clocking edge. The input is what is required for the output transition to occur. Synch 2.9 Note: You must be able to build this table on your own.

10 Transition Tables J-K Flip-Flop Transition Table Indicated are the present and next Q-output states. If the flip-flop toggles or holds, indicate that binary value. Also note that both the J and K inputs need to be determined. The “X” indicates “Don’t Care” states (can be ‘1’ or ‘0’ input). Synch 2.10 Note: You must be able to build this table on your own.

11 J-K Flip Flop Transition Table Synch 2.11 Hold or Reset Toggle or Set Toggle or Reset Hold or Set States Note each output of the J-K Flip-Flop is the result of 2 possible states.

12 K-Mapping D-Flip-Flop Synch 2.12

13 Building a K-Map To build a K-Map the following is needed: ◦ State Diagram of the output sequence ◦ State Table of the output sequence ◦ Transition Table for the Flip-Flop we intend to use  Present and Next outputs  Necessary inputs to create those outputs Synch 2.13 000 010 110 001

14 K-Mapping a Sequence: Step 1 Draw the State Table and State Diagram of the output sequence. ( We will use our previous sequence example): Synch 2.14 000 010 110 001 State DiagramState Table

15 K-Mapping a Sequence: Step 2 Determine the type of Flip-Flop and its Transition Table. For this example, we will use the D Flip-Flop: Synch 2.15 Transition Table

16 Present NextInput Q C Q B Q A D C D B D A 00100010 00010001 01100110 01000100 00100010 11001100 K-Mapping a Sequence: Step 3 Synch 2.16 Build the State Table with the inputs indicated: 010 1 1 0 0 0 1 0 0 0

17 Present NextInput Q C Q B Q A D C D B D A 00100010 00010001 01100110 01000100 00100010 11001100 K-Mapping a Sequence: Step 3 Synch 2.17 Build the State table with the inputs indicated: 010 Animated 1 1 0 0 0 1 0 0 0

18 K-Mapping a Sequence: Step 4 Produce K-Mapping Tables for each output: Synch 2.18 00 01 11 10 0 1 QAQA QCQBQCQB Present NextInput Q C Q B Q A D C D B D A 00100010 00010001 01100110 01000100 00100010 11001100 010 1 1 0 0 0 1 0 0 0 DCDC 010X010X 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB DBDB 110X110X 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB DADA 001X001X 0XXX0XXX

19 K-Mapping a Sequence: Step 4 Produce K-Mapping Tables for each output: Synch 2.19 00 01 11 10 0 1 QAQA QCQBQCQB Present NextInput Q C Q B Q A D C D B D A 00100010 00010001 01100110 01000100 00100010 11001100 010 1 1 0 0 0 1 0 0 0 DCDC 010X010X 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB DBDB 110X110X 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB DADA 001X001X 0XXX0XXX 000 010 ANIMATEDANIMATED

20 K-Mapping a Sequence: Step 5 Simplify, using K-Mapping rules, and determine the inputs. Synch 2.20 00 01 11 10 0 1 QAQA QCQBQCQB DCDC 010X010X 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB DBDB 110X110X 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB DADA 001X001X 0XXX0XXX D A =Q C D C =Q C Q B D B =Q C Q A

21 K-Mapping a Sequence: Step 6 Draw the Circuit Diagram, and verify its operations. Synch 2.21

22 K-Mapping J-K Flip-Flop Synch 2.22

23 Building a K-Map To build a K-Map, needed are: ◦ State Diagram of the output sequence ◦ State Table of the output sequence ◦ Transition Table for the Flip-Flop we intend to use  Present and Next outputs  Necessary inputs to create those outputs Synch 2.23 000 010 110 001

24 K-Mapping a Sequence: Step 1 Draw the State Table and State Diagram of the output sequence. ( We will use our previous sequence example): Synch 2.24 000 010 110 001 State DiagramState Table

25 K-Mapping a Sequence: Step 2 Determine the type of Flip-Flop and its Transition Table. For this example, we will use the J-K Flip-Flop: Synch 2.25 Transition Table

26 K-Mapping a Sequence: Step 3 Synch 2.26 Build the State Table with the inputs indicated: 0 X 1 X 0 X PresentNextInput Q C Q B Q A J C K C J B K B J A K A 00100010 00010001 01100110 01000100 00100010 11001100 1 X X 0 0 X X 1 X 1 1 X 0 X 0 X X 1

27 K-Mapping a Sequence Step 3 Synch 2.27 0 X 1 X 0 X PresentNextInput Q C Q B Q A J C K C J B K B J A K A 00100010 00010001 01100110 01000100 00100010 11001100 1 X X 0 0 X X 1 X 1 1 X 0 X 0 X X 1 Animated Build the State table with the inputs indicated:

28 K-Mapping a Sequence: Step 4a Produce K-Mapping Tables for each output: Synch 2.28 00 01 11 10 0 1 QAQA QCQBQCQB JCJC 01XX01XX 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB KCKC XX1XXX1X XXXXXXXX 00 01 11 10 0 1 QAQA QCQBQCQB JBJB 1XXX1XXX 0XXX0XXX 0 X 1 X 0 X PresentNextInput Q C Q B Q A J C K C J B K B J A K A 00100010 00010001 01100110 01000100 00100010 11001100 1 X X 0 0 X X 1 X 1 1 X 0 X 0 X X 1

29 K-Mapping a Sequence: Step 4a Produce K-Mapping Tables for each output: Synch 2.29 00 01 11 10 0 1 QAQA QCQBQCQB JCJC 01XX01XX 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB KCKC XX1XXX1X XXXXXXXX 00 01 11 10 0 1 QAQA QCQBQCQB JBJB 1XXX1XXX 0XXX0XXX 0 X 1 X 0 X PresentNextInput Q C Q B Q A J C K C J B K B J A K A 00100010 00010001 01100110 01000100 00100010 11001100 1 X X 0 0 X X 1 X 1 1 X 0 X 0 X X 1 000 010 ANIMATEDANIMATED

30 K-Mapping a Sequence: Step 4b Produce K-Mapping Tables for each output: Synch 2.30 00 01 11 10 0 1 QAQA QCQBQCQB KBKB X01XX01X XXXXXXXX 00 01 11 10 0 1 QAQA QCQBQCQB JAJA 001X001X XXXXXXXX 00 01 11 10 0 1 QAQA QCQBQCQB KAKA XXXXXXXX 1XXX1XXX 0 X 1 X 0 X PresentNextInput Q C Q B Q A J C K C J B K B J A K A 00100010 00010001 01100110 01000100 00100010 11001100 1 X X 0 0 X X 1 X 1 1 X 0 X 0 X X 1

31 K-Mapping a Sequence: Step 5a Simplify, using K-Mapping rules, and determine the inputs. Synch 2.31 J C =Q B K C =1 00 01 11 10 0 1 QAQA QCQBQCQB JCJC 01XX01XX 0XXX0XXX 00 01 11 10 0 1 QAQA QCQBQCQB KCKC XX1XXX1X XXXXXXXX 00 01 11 10 0 1 QAQA QCQBQCQB JBJB 1XXX1XXX 0XXX0XXX J B =Q A

32 K-Mapping a Sequence: Step 5b Simplify, using K-Mapping rules, and determine the inputs. Synch 2.32 00 01 11 10 0 1 QAQA QCQBQCQB KBKB X01XX01X XXXXXXXX 00 01 11 10 0 1 QAQA QCQBQCQB JAJA 001X001X XXXXXXXX 00 01 11 10 0 1 QAQA QCQBQCQB KAKA XXXXXXXX 1XXX1XXX K B =Q C J A =Q C K A =1

33 K-Mapping a Sequence: Step 6 Draw the Circuit Diagram, and verify its operations. Synch 2.33

34 Questions Which of the flop-flops is simpler to use for state machine counting? What would happen if all the flip-flops were changed from negative to positive edge devices? In what instances would we use custom count sequences? Synch 2.34

35 Review Customized state machine counting can be accomplished by using synchronous counter design. K-Mapping is useful in simplifying state machine design. Transition tables take the previous state into account for determining the digital state of the output. Synch 2.35

36 Exercise Design a counter with the following sequence: ◦ 0000-0101-1101-1111-1000-1101 ◦ Using D-Flip Flops ◦ Using J-K Flip-Flops Verify the sequence using EWB Synch 2.36

37 END Synch 2.37 ©Paul R. Godin prgodin @ gmail.com


Download ppt "State Machines (Closed Loop / Moore) Synch 2.1  Paul R. Godin Updated: January 2008."

Similar presentations


Ads by Google