A Critique of the Proposed National Education Policy Reform
Analysis of state machines & Conversion of models
1. Analysis: Example 2 - New State Machine
• This is now a Moore machine
– output MAXS depends only on state (Q0 and Q1)
MAXS
MAXS = Q0 ⋅ Q1
1
2. Analysis: Example 2 - New Table/Diagram
• Updated State/Output Table & Diagram
– Moore machine state diagram
output associated with state, not transition
2
3. Analysis: Example 2 - Timing Diagram
• Timing Diagram for State Machine
– Compare outputs MAX and MAXS for the Mealy
and Moore machine implementations
3
4. Conversion of Models
• Mealy to Moore machine
– If all the transitions in a Mealy model to a particular state are
associated with the same output then in the corresponding
Moore model that output becomes the state output.
T1 T1
1/0 1
T2 1/0 1/0 T2 1 A 1 B
A B
0 0
0/1 0
0/0 0
T3 T4 T3 T4
Mealy Moore
5. Conversion of Models
• Mealy to Moore machine
– If the outputs of all the transitions in a Mealy model to a
particular state are not the same, then in the corresponding
Moore model we need to insert intermediate states
T1 T1 T4
1/0 1 0
T2 0/0 1/0 T2 0 A0 B
1
A B
0 0
0/1
1/1
T3 T4 A1 1
T3 1
Mealy 1 0
Moore T4
6. Conversion of Models
• Moore to Mealy machine
– If the state transition from two different states of the same
input leads to common state then one state can be eliminated
T1 T1
1 1/0
T2 0 A0 B T2 0/0 1/0
1 A B
0 0
1/1
1 A1 1 T3
T3
1
Moore Mealy
7. Conversion of Models
• Moore to Mealy machine
– If the state transition from two different states of the same
input does not lead to the same state, then state output
becomes the output corresponding to each input transition of
that state
T1 T1
1 1/0
T2 A B T2 0/0 0/0
0 0 A B
0 0
1 1 1/0 1/1
C T3
T3 C
Moore 1 Mealy
8. Analysis: Example 3 - State Machine
X Y Q0 Q1 J0 = X·Y'
K0 = X·Y' + Y·Q1
Q0' Q1'
J0 Q0
J Q
K0 K Q
J1 = X·Q0 + Y
J1 Q1
J Q
K1
K Q
Z
Clk
K1 = Y·Q0' + X·Y'·Q0 Z = X·Q0·Q1 + Q0'·Q1'·Y
9. 1. Determine the excitation equations for the flip flop inputs
J 0 = X ⋅Y ′ J 1 = X ⋅ Q0 + Y
K 0 = X ⋅ Y ′ + Y ⋅ Q1 K1 = Y ⋅ Q0′ + X ⋅ Y ′ ⋅ Q0
2. Substitute the excitation equations into the flip flop
characteristic equations to obtain transition equations.
Q0* = J 0 ⋅ Q0′ + K 0′Q 0
characteristic equations
Q1* = J 1 ⋅ Q1′ + K1′Q1
′
Q 0* = ( X ⋅ Y ′) ⋅ Q0′ + ( X ⋅ Y ′ + Y ⋅ Q1) Q 0 transition equations
′
Q1* = ( X ⋅ Q0 + Y ) ⋅ Q1′ + ( Y ⋅ Q0′ + X ⋅ Y ′ ⋅ Q 0 ) Q1
10. Simplifying the transition equations
Q0* = ( X ⋅ Y ′) ⋅ Q0′ + ( X ⋅ Y ′ + Y ⋅ Q1) ′ Q 0
Q 0* = ( X ⋅ Y ) ⋅ Q0 + ( ( X ⋅ Y ) + ( Y ⋅ Q1) ) ⋅ Q0
( )
Q0* = X ⋅ Y ⋅ Q 0 + ( X ⋅ Y ) ⋅ ( Y ⋅ Q1) ⋅ Q0
( )(
Q0* = X ⋅ Y ⋅ Q0 + X + Y ⋅ Y + Q1 ⋅ Q0 ))
Q0* = X ⋅ Y ⋅ Q0 + ( ( X + Y ) ⋅ (Y + Q1) ) ⋅ Q0
Q0* = X ⋅ Y ⋅ Q0 + ( X ⋅ Y + X ⋅ Q1 + Y ⋅ Y + Y ⋅ Q1) ⋅ Q0
Q 0* = X ⋅ Y ′ ⋅ Q 0′ + X ′ ⋅ Y ′ ⋅ Q0 + X ′ ⋅ Q0 ⋅ Q1′ + Y ⋅ Q0 ⋅ Q1′
11. Simplifying the transition equations
Q1* = ( X ⋅ Q0 + Y ) ⋅ Q1′ + ( Y ⋅ Q0′ + X ⋅ Y ′ ⋅ Q 0 ) ′ Q1
(( ) (
Q1* = ( X ⋅ Q0 + Y ) ⋅ Q1 + Y ⋅ Q0 + X ⋅ Y ⋅ Q0 ⋅ Q1 ))
Q1* = X ⋅ Q0 ⋅ Q1 + Y ⋅ Q1 + ( Y ⋅ Q0 ) ⋅ ( X ⋅ Y ⋅ Q0 ) ) ⋅ Q1
( )(
Q1* = X ⋅ Q0 ⋅ Q1 + Y ⋅ Q1 + Y + Q0 ⋅ X + Y + Q0 ⋅ Q1 )
(( )(
Q1* = X ⋅ Q0 ⋅ Q1 + Y ⋅ Q1 + Y + Q0 ⋅ X + Y + Q0 ⋅ Q1 ))
(
Q1* = XQ0Q1 + Y Q1 + X Y + Y Y + Y Q0 + X Q 0 + YQ0 + Q0Q0 ⋅ Q1 )
Q1* = X ⋅ Q0 ⋅ Q1′ + Y ⋅ Q1′ + X ′ ⋅ Y ′ ⋅ Q1
+ Y ′ ⋅ Q 0′ ⋅ Q1 + X ′ ⋅ Q0 ⋅ Q1 + Y ⋅ Q0 ⋅ Q1
3. Determine the output equations.
Z = X ⋅ Q0 ⋅ Q1 + Y ⋅ Q0′ ⋅ Q1′ output equation
12. 4. Use transition equations and output equations to construct
transition/output table.
Transition/output table
State Input XY
Q1Q0 00 01 10 11
00 00,0 10,1 01,0 10,1
01 01,0 11,0 10,0 11,0
10 10,0 00,0 11,0 00,0
11 11,0 10,0 00,1 10,1
Next State Q1*Q0*, Z
13. 6. Name the states and substitute state names for state –
variable combinations in the transition/output table to obtain
the state/output table.
State/output table
Substituting the
state names as ‘A’ State Input XY
for Q1Q0 = 00,
‘B’ for Q1Q0 = 01, S 00 01 10 11
‘C’ for Q1Q0 = 10,
‘D’ for Q1Q0 = 11. A A,0 C,1 B,0 C,1
S is current state
& S* is next state. B B,0 D,0 C,0 D,0
C C,0 A,0 D,0 A,0
D D,0 C,0 A,1 C,1
Next State S*, Z
14. State diagram
10/0
00/0 A B 00/0
01,11/1 01,11/0
10/1 10/0
01,11/0
11/1
00/0 D C 00/0
01/0
10/0
15. Synchronous Design Process
1. Construct a state diagram and/or state/output
table corresponding to the word description or
specification
2. Minimize the number of states
3. Choose a set of state variables and assign
state variable combinations to the named
states
4. Obtain the transition/output table
5. Determine the number of flip-flops and select
the type of flip-flop to be used (D is often the
default)
6. Construct the excitation table
7. Derive excitation equations
8. Derive output equations 15
16. Design a clocked synchronous state machine
which accepts two serial strings of digits of
arbitrary length, starting with LSB and
produces the sum and carry of the two bit
streams as its output. The input bit streams
could come from two shift registers clocked
simultaneously .
Assuming Mealy machine design
Let the inputs be X and Y
Let the outputs be S and C
17. Obtaining the state Diagram
Assume initial condition to be SC = 00
Let the state be represented by state A
If XY = 00, then output SC = 00, Same
state A
= 01, then output SC = 10, goes to
state B
XY/SC = 10, then output SC = 10, goes to
state B 01,10/10
00/00 A B
= 11, then output SC = 01, goes to
state C
11/01
C
18. Obtaining the state Diagram
Assume machine has moved to state B
If XY = 00, then output SC = 00, goes to
state A
= 01, then output SC = 10, same state
B
= 10, then output SC = 10, same state
XY/SC
B
01,10/10
= 11, then output SC = 01, goes to
00/00 A B 01,10/10
state C 00/00
11/01 11/01
C
19. Obtaining the state Diagram
Assume machine has moved to state C
If XY = 00, then output SC = 10, goes to
state B
= 01, then output SC = 01, same state
C
= 10, then output SC = 01, same state
XY/SC
C
01,10/10
= 11, then output SC = 11, goes to
00/00 A B 01,10/10
state D 00/00
11/01 11/01
00/10 11/11
01,10/01 C D
20. Obtaining the state Diagram
Assume machine has moved to state D
If XY = 00, then output SC = 10, goes to
state B
= 01, then output SC = 01, goes to
state C
XY/SC = 10, then output SC = 01, goes to
01,10/10
state C 01,10/10
00/00 A B
00/00
= 11, then output SC = 11, same state
D 11/01
11/01 00/10
00/10 11/11 11/11
01,10/01 C D
01,10/01
21. Obtaining the state/output table
State/output table
State Input XY
S 00 01 10 11
A A,00 B,10 B,10 C,01
B A,00 B,10 B,10 C,01
C B,10 C,01 C,01 D,11
D B,10 C,01 C,01 D,11
Next State S*, SC
22. Equivalent States
Two states are equivalent if it is impossible to
distinguish them by observing only the current
and future outputs of the machine .
A pair of equivalent states can be replaced by a
single state.
Two states S1 and S2 are equivalent if two
conditions are true.
1. S1 and S2 must produce the same values at
the state machine output(s) for all input
combinations.
2. For each input combination S1 and S2 must
23. State Minimization
Equivalen State/output table
t states State Input XY
S 00 01 10 11
A A,00 B,10 B,10 C,01
B A,00 B,10 B,10 C,01
C B,10 C,01 C,01 D,11
D B,10 C,01 C,01 D,11
Next State S*, SC
Equivalent states
24. Minimized state/output table & state diagram
State/output table
State Input XY
S 00 01 10 11
A A,00 A,10 A,10 D,01
D A,10 D,01 D,01 D,11
Next State S*, SC
00/00 01/01
11/01
01/10 10/01
A D
10/10 11/11
00/10
State diagram
25. Assigning state variable to obtain
transition/output table
Transition/output table
State Input XY
Q 00 01 10 11
0 0,00 0,10 0,10 1,01
1 0,10 1,01 1,01 1,11
Next State Q*, SC
Encoding A = 0 and D = 1
Choosing D type flip flop