Title: Synthesis of Moore Machine Controllable Die Example
1Synthesis of Moore MachineControllable Die
Example
- ECE-331, Digital Design
- Dr. Ron Hayne
- Electrical and Computer Engineering
2Controllable Die Word Problem
- Design an FSM to Simulate the Roll of a Die by
Lighting up Combinations of 7 Lights to Form the
Various Faces of a Die. - Assume the Die Is Controlled by Starting and
Stopping a Clock Sufficiently Fast That User
Cannot Make It Stop on a Particular Number. - Use Binary Encoded States
3Controllable Die Word Problem
- Include a Cheat/(Honest-Bar) Switch
- C 0, outputs 1, 2, 3, 4, 5, 6
- C 1, outputs 1, 2, 3, 4, 5, 6, 6
- Design the Minimum Machine by Considering State 7
a Dont Know. - Use D FFs to Store the State.
- Implement as a synchronous Moore Machine.
4Die Face of 7 lights
56 Die Face Patterns
1
2
3
4
5
6
6Synchronous Moore Machine
Input
Comb Ckt
Output
Present State
Next State
Output Is Only a Function of Present State
Clock
7 Moore Die FSM
- M ( S, I, O, ?, ? )
- S 0, 1, 2, 3, 4, 5, 6, 7
- I C 0, 1 Honest, Cheat
- O a, b, c, d, e, f, g 7 lights
- ? State/Output Diagram
- ? State/Output Diagram
8State Diagram Key
9Moore Die FSM Abbreviated State Diagram
?
?
?
10Flip-Flop Excitation Table
Q Q D T S R J K
0 0 0 0 0 d 0 d
0 1 1 1 1 0 1 d
1 0 0 1 0 1 d 1
1 1 1 0 d 0 d 0
11Controllable Die State Table (1)
In Present State Present State Present State NextState NextState NextState Excit. Variables Excit. Variables Excit. Variables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables
mt C Q2 Q1 Q0 Q2 Q1 Q0 D2 D1 D0 a b c d e f g die
0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1
1 0 0 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 2
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
12Moore Die FSM Abbreviated State Diagram
?
?
?
13Controllable Die State Table (1)
In Present State Present State Present State NextState NextState NextState Excit. Variables Excit. Variables Excit. Variables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables
mt C Q2 Q1 Q0 Q2 Q1 Q0 D2 D1 D0 a b c d e f g die
0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1
1 0 0 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 2
2 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 3
3 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 1 1 4
4 0 1 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 5
5 0 1 0 1 0 0 0 0 0 0 1 1 1 0 1 1 1 6
6 0 1 1 0 TBD TBD TBD d d d 1 1 1 0 1 1 1 6
7 0 1 1 1 TBD TBD TBD d d d d d d d d d d d
14Moore Die FSM Abbreviated State Diagram
?
?
?
15Controllable Die State Table (2)
In Present State Present State Present State NextState NextState NextState Excit. Variables Excit. Variables Excit. Variables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables
mt C Q2 Q1 Q0 Q2 Q1 Q0 D2 D1 D0 a b c d e f g die
8 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1
9 1 0 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 2
10 1 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 3
11 1 0 1 1 1 0 0 1 0 0 1 1 0 0 0 1 1 4
12 1 1 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 5
13 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 1 1 6
14 1 1 1 0 0 0 0 0 0 0 1 1 1 0 1 1 1 6
15 1 1 1 1 TBD TBD TBD d d d d d d d d d d d
16Minimization
- Minimization Is Carried Out on All Output
Variables and Excitation Variables - D-FFs Are Easy to Design with Because NS
Excitation Variables - Other FFs Require Application of Excitation Table
Depending on Type of FF
17Minimization Example
18After Minimization (1)
In Present State Present State Present State NextState NextState NextState Excit. Variables Excit. Variables Excit. Variables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables
mt C Q2 Q1 Q0 Q2 Q1 Q0 D2 D1 D0 a b c d e f g die
0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1
1 0 0 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 2
2 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 3
3 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 1 1 4
4 0 1 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 5
5 0 1 0 1 0 0 0 0 0 0 1 1 1 0 1 1 1 6
6 0 1 1 0 0 0 0 0 0 0 1 1 1 0 1 1 1 6
7 0 1 1 1 1 0 0 1 0 0 1 1 1 0 1 1 1 6
19After Minimization (2)
In Present State Present State Present State NextState NextState NextState Excit. Variables Excit. Variables Excit. Variables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables OutputVariables
mt C Q2 Q1 Q0 Q2 Q1 Q0 D2 D1 D0 a b c d e f g die
8 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1
9 1 0 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 2
10 1 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 3
11 1 0 1 1 1 0 0 1 0 0 1 1 0 0 0 1 1 4
12 1 1 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 5
13 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 1 1 6
14 1 1 1 0 0 0 0 0 0 0 1 1 1 0 1 1 1 6
15 1 1 1 1 1 1 0 1 1 0 1 1 1 0 1 1 1 6
20State Diagram After Determining Dont Know States
6
21Self-Starting
- Two Choices to Insure Proper Machine Operation
- Start machine in known state when power up
- RC circuit connected to asynchronous clear
input of state FFs initializes state to state 0 - Minimize and verify that if machine starts in
unallowed state, or erroneously gets to unallowed
state, that it will jump back into proper
operating state
22Self-Starting
- Depending on Machine Application, Self-Starting
May Not Be Enough or Minimization May Cause
Hazardous Operation - Launch weapon
- Start equipment unexpectedly
23Self-Starting Alternative
- Do Not Design Minimum Machine, but Define All
States and Outputs So That No Hazardous Situation
Exists - More Costly, but Risk Associated With Not Doing
It May Demand It - Die Example Is Self-starting Therefore Does Not
Require Redesign
24Design with J-K Flip-flops
Q Q D T S R J K
0 0 0 0 0 d 0 d
0 1 1 1 1 0 1 d
1 0 0 1 0 1 d 1
1 1 1 0 d 0 d 0
25Controllable Die State Table (1)
In Present State Present State Present State NextState NextState NextState Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables
mt C Q2 Q1 Q0 Q2 Q1 Q0 J2 K2 J1 K1 J0 K0
0 0 0 0 0 0 0 1 0 d
1 0 0 0 1 0 1 0 0 d
2 0 0 1 0 0 1 1 0 d
3 0 0 1 1 1 0 0 1 d
4 0 1 0 0 1 0 1 d 0
5 0 1 0 1 0 0 0 d 1
6 0 1 1 0 TBD TBD TBD d d d d d d
7 0 1 1 1 TBD TBD TBD d d d d d d
26Controllable Die State Table (2)
In Present State Present State Present State NextState NextState NextState Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables
mt C Q2 Q1 Q0 Q2 Q1 Q0 J2 K2 J1 K1 J0 K0
8 1 0 0 0 0 0 1 0 d
9 1 0 0 1 0 1 0 0 d
10 1 0 1 0 0 1 1 0 d
11 1 0 1 1 1 0 0 1 d
12 1 1 0 0 1 0 1 d 0
13 1 1 0 1 1 1 0 d 0
14 1 1 1 0 0 0 0 d 1
15 1 1 1 1 TBD TBD TBD d d d d d d
27Minimization
28Minimization
29Controllable Die State Table (1)
In Present State Present State Present State NextState NextState NextState Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables
mt C Q2 Q1 Q0 Q2 Q1 Q0 J2 K2 J1 K1 J0 K0
0 0 0 0 0 0 0 1 0 0
1 0 0 0 1 0 1 0 0 1
2 0 0 1 0 0 1 1 0 1
3 0 0 1 1 1 0 0 1 1
4 0 1 0 0 1 0 1 0 0
5 0 1 0 1 0 0 0 0 1
6 0 1 1 0 0 TBD TBD 0 1 d d d d
7 0 1 1 1 0 TBD TBD 1 1 d d d d
30Controllable Die State Table (2)
In Present State Present State Present State NextState NextState NextState Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables
mt C Q2 Q1 Q0 Q2 Q1 Q0 J2 K2 J1 K1 J0 K0
8 1 0 0 0 0 0 1 0 0
9 1 0 0 1 0 1 0 0 0
10 1 0 1 0 0 1 1 0 1
11 1 0 1 1 1 0 0 1 1
12 1 1 0 0 1 0 1 0 0
13 1 1 0 1 1 1 0 0 0
14 1 1 1 0 0 0 0 0 1
15 1 1 1 1 0 TBD TBD 1 1 d d d d
31End of Lecture
- Controllable Die e.g.
- Moore Machine
- Dont Cares
- Dont Knows (TBD states)
- Self-starting
32Controllable Die State Table (1)
In Present State Present State Present State NextState NextState NextState Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables
mt C Q2 Q1 Q0 Q2 Q1 Q0 J2 K2 J1 K1 J0 K0
0 0 0 0 0 0 0 1 0 0 0 d
1 0 0 0 1 0 1 0 0 1 1 d
2 0 0 1 0 0 1 1 0 1 d 0
3 0 0 1 1 1 0 0 1 1 d 1
4 0 1 0 0 1 0 1 0 0 0 d
5 0 1 0 1 0 0 0 0 1 0 d
6 0 1 1 0 0 TBD TBD 0 1 d d d d
7 0 1 1 1 0 TBD TBD 1 1 d d d d
33Controllable Die State Table (2)
In Present State Present State Present State NextState NextState NextState Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables
mt C Q2 Q1 Q0 Q2 Q1 Q0 J2 K2 J1 K1 J0 K0
8 1 0 0 0 0 0 1 0 0 0 d
9 1 0 0 1 0 1 0 0 0 1 d
10 1 0 1 0 0 1 1 0 1 d 0
11 1 0 1 1 1 0 0 1 1 d 1
12 1 1 0 0 1 0 1 0 0 0 d
13 1 1 0 1 1 1 0 0 0 1 d
14 1 1 1 0 0 0 0 0 1 d 1
15 1 1 1 1 0 TBD TBD 1 1 d d d d
34Controllable Die State Table (1)
In Present State Present State Present State NextState NextState NextState Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables
mt C Q2 Q1 Q0 Q2 Q1 Q0 J2 K2 J1 K1 J0 K0
0 0 0 0 0 0 0 1 0 0 0 d 1 d
1 0 0 0 1 0 1 0 0 1 1 d d 1
2 0 0 1 0 0 1 1 0 1 d 0 1 d
3 0 0 1 1 1 0 0 1 1 d 1 d 1
4 0 1 0 0 1 0 1 0 0 0 d 1 d
5 0 1 0 1 0 0 0 0 1 0 d d 1
6 0 1 1 0 0 TBD TBD 0 1 d d d d
7 0 1 1 1 0 TBD TBD 1 1 d d d d
35Controllable Die State Table (2)
In Present State Present State Present State NextState NextState NextState Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables Excitation Variables
mt C Q2 Q1 Q0 Q2 Q1 Q0 J2 K2 J1 K1 J0 K0
8 1 0 0 0 0 0 1 0 0 0 d 1 d
9 1 0 0 1 0 1 0 0 0 1 d d 1
10 1 0 1 0 0 1 1 0 1 d 0 1 d
11 1 0 1 1 1 0 0 1 1 d 1 d 1
12 1 1 0 0 1 0 1 0 0 0 d 1 d
13 1 1 0 1 1 1 0 0 0 1 d d 1
14 1 1 1 0 0 0 0 0 1 d 1 0 d
15 1 1 1 1 0 TBD TBD 1 1 d d d d