Finite State Machines 2 Two types of sequential circuits (or finite state machines ) Mealy machine Output is function of present state and present input Moore machine Output is function of present state only
Moore State Machines: Outputs determined solely by the current state
State Table Prev. State X O 2 O 1 O Next State + A B A 1 A B 1 B B 1 1 C D 1 1 1 B D 1 1 1 1 A C 1 1 B C 1 1 1 D
State Diagram
State Table NS PS AB X=0 AB X=1 AB z (=B) 00 00 1 1 01 00 1 1 1 10 10 1 11 11 1 1 Moore State Machines:
State Diagram 00 11 1 X =1 X =0 01 1 X =1 X=0 10 X =1 X =0 X =1 X =0 Moore State Machines:
Moore Machine
Moore Machine
Moore FSM – Example : State diagram C z 1 = ¤ B z = ¤ A z = ¤ w = w 1 = w 1 = w = w = w 1 =
Present Next state Output state w = w = 1 z A A B B A C C A C 1 Moore FSM – Example : State table
State Diagram
State Table
Mealy State Machines: Outputs determined by the current state and the current inputs.
State Q 2 Q 1 Q X Z State + Q + 2 Q + 1 Q + Start First 1 Start 1 Start First 1 First 1 First 1 1 Second 1 1 Success 1 First 1 Success 1 1 Start Second 1 1 Delay 1 1 1 Second 1 1 1 1 Success 1 unused 1 * * X X X X X SuccessD 1 1 Delay 1 1 1 SuccessD 1 1 1 1 Success 1 Delay 1 1 1 Delay 1 1 1 Delay 1 1 1 1 1 SuccessD 1 1
State Diagram
State Table NS P S x=0 x=1 A B AB,z AB,z 00,0 01,1 1 01,1 11,0 1 10,0 01,1 1 1 11,0 00,1 Mealy State Machines:
State Diagram 10 01 11 1/0 0/1 1/1 0/0 0/0 0/0 1/1 00 1/1 Mealy State Machines:
A w = z = ¤ w 1 = z 1 = ¤ B w = z = ¤ Reset w 1 = z = ¤ Mealy FSM – Example : State diagram