Finite State Machines 4
Finite State Machines 4
Consideratransitiontablebelow:
Current State Input q0 0 q1 q2 q3 0 q3 3 q0 q2 q1 NextState Output
1 0 1 1 0
0 q1 1 q3 q2 q0
1 1 0 0 1
37
MealytoMooreConversion
Determinethenumberofdifferentoutputassociatedwith qi inthenextstatecolumn. Wesplitqi intodifferentstatesaccordingtodifferent outputassociatedwithit.Forexample,supposeinthenext statecolumnoftheabovesampletransitiontableofmealy machine,theoutputassociatedwithq1is"0"inthefirst nextstatecolumnand"1"inthesecondnextstatecolumn. sowesplit litq1 1into i t q10 10and dq11 11states. t t similarly i il l check h k othersandsplitthem. Afterapplyingtheconversionsteps,wegettwostates(q1 and dq2) 2)that th tareassociated i t dwith ithdiff different toutputs t t (0and d1). 1) sowesplitbothstatesintoq10,q11andq20,q21. Nowthetransitiontablebecomes
38
MealytoMooreConversion
Consideratransitiontablebelow:
Current State Input q0 0 q10 q11 q20 q21 q3 0 q3 3 q0 q0 q21 q21 q10 NextState Output
1 0 1 1 1 1 0
1 1 0 0 0 0 1
39
MooreModel
PresentState I Input t q0 q10 q11 q20 q21 q3 0 q3 q0 q0 q21 q21 q10 NextState 1 q11 q3 q3 q20 q20 q0 1 0 1 0 1 0 Output
40
MealyModel
Convertthefollowing gMealy yMachinetoMooreMachine
10/0 00/1 /
Example
MealyMachine:
PS A B 00 A,0 A,1 01 10 (x,y) A,1 B,0 B,0 B,0 (NS,z)
MooreMachine:
PS A0 A1 B 00 01 A0 A1 A0 A1 A1 B 10 (x,y) B B B z 0 1 0
MooreMachine
00
MooreMachine
10
10 01
A0/0
10 01 00 00
B/0
A1/1
01
MooretoMealyConversion
Considerthestatetableg givenbelow
CurrentState 0 A B C D B D C A Next State 1 C C B D 1 0 1 1 Output
44
MooreMealy yConversion
ForMooretoMealyconversion,rewritethetableasifitisaMealy machinewithoutthecorrespondingoutputinformation.
CurrentState Input A B C D CurrentState Input A B C D 0 B D C A 0 B D C A NextState 1 C C B D
45
Next State 1 C C B D
Output 1 0 1 1 Output 0 1
MooretoMealyConversion
NowintheMooremachine,theoutputoftheAis1,somaketheoutput ofAinthemealymachinenextstatecolumnoftheabovetableis1.same processisrepeatedforB,CandD.
CurrentState Input A B C D 0 B D C A NextState 1 C C B D 1 0 Output 1
46
MooretoMealyConversion
NowintheMooremachine,theoutputoftheAis1,somaketheoutput ofAinthemealymachinenextstatecolumnoftheabovetableis1.same processisrepeatedforB,CandD.
Current State Input A B C D 0 B D C A NextState 1 C C B D 1 0 0 0 Output 1
47
MooretoMealyConversion
NowintheMooremachine,theoutputoftheAis1,somaketheoutput ofAinthemealymachinenextstatecolumnoftheabovetableis1.same processisrepeatedforB,CandD.
Current State Input A B C D 0 B D C A NextState 1 C C B D 1 1 0 0 Output 1 1 1 0
48
MooretoMealyConversion
NowintheMooremachine,theoutputoftheAis1,somaketheoutput ofAinthemealymachinenextstatecolumnoftheabovetableis1.same processisrepeatedforB,CandD.
Current State Input A B C D 0 B D C A NextState 1 C C B D 0 0 1 1 1 Output 1 1 1 0 1
49
StateDiagram
50
Recheck
Doesthisreally ywork?Letusredotheconversion( (Mealy yto Moore)thatwelookedatearlier.
51
StateTransitionTable
CurrentState 0 a b c d a a d a NextState 1 b c c b 0 0 0 1 Output
52
MooreMealy yConversion
ForMooretoMealyconversion,rewritethetableasifitisaMealy machinewithoutthecorrespondingoutputinformation.
CurrentState Next State Output
0 a b c d
CurrentState
1 b c c b
NextState
a a d a 0 1 b c c b
0 0 0 1
Output 0 1
a b c d
a a d a
53
MooreMealy yConversion
ForMooretoMealyconversion,rewritethetableasifitisaMealy machinewithoutthecorrespondingoutputinformation.
CurrentState Next State Output
0 a b c d
CurrentState
1 b c c b
NextState
a a d a 0 1 b c c b
0 0 0 1
Output 0 0 0 1 0 1 0 0 0 0
54
a b c d
a a d a
MooretoMealyConversion
Itcanbeseenthatstatesaanddareidenticalandcanbe merged.Thenumberofstatesarenotreducedto3,withnew statetable,
CurrentState NextState Output 0 0 0 1 1 0 0 0
0 a b c a a a
1 b c c
55
56
57
58
59
60