This document describes the design of a finite state machine (FSM) to control a simple washing machine. The washing machine has 6 states: off, fill water 1, drain 1, fill water 2, rinse, and drain 2. The FSM will use 3 D-flip flops to represent the 3 state bits and control the water inlet, drum motor speed, and other functions based on the current state. Block diagrams, state diagrams, truth tables, and logic circuits are provided to illustrate the FSM design.
A Wash machineController
We are going to design a simple FSM that
controls a wash machine using D-flops.
The wash machine has the following states : off ,
fill water 1 , drain 1, fill water 2 , rinse , drain 2 .
The user start the washer by plugging it to the
power supply .
3.
A Wash machineController
Wash
Machine
Controller
START
L (0,1)
OW
WS
DS
R
OW
Hot
water
Cold
water
M
{ Wash machine Controller Specification }
4.
A Wash machineController
There is one contol line to its water feed (OW).
Choice of hot or cold water wash done manually by
the user for simplicity.
In this simple washing machine there will be a drum
motor that have two rotation speeds : low speed for
wash cycle & high speed for the drain cycle.
To contol the speed of the motor we have two outputs
(sighals) from the wash contoller : WS for low speed ,
and DS for high speed .
5.
Block Diagram
Washmachine
controller have two
blocks : FSM block &
timer block.
Timer is a counter
that have a logic
circuit to reset it .
FSM
Timer
OW
WS
DS
R
L (0,1)
CLK
STAR
T
T
6.
State Diagram
Input /Outputs
T / OW , WS , DS
, R
OFF
000
Fill
water
001
wash
010
Drain
011
Fill
water
2 100
Rinse
101
drain
2
0/0000
0/1000
1/1001
1/0101
0/0100
1/0011
0/00101/10010/1000
1/0101
0/0100
1/0011
0/0010
1/0010
7.
Truth Table forthe washing machine :
For the FSM circuit , we will need:
Three D flip-flops to represent the three state bits
.
The inputs for the 3 F/Fs will the next state
because as we know D = Q+ .
E become 1 when the user plug the machine to
the power supply.