List of Figures
Figure 1 Washing Machine FSM diagram 5
Figure 2 CD FSM 7
Figure 3 Original figure for CD FSM 10
List of Tables
A state in the vocabulary of FSM technical terminology is all the stored data at any given point in time for which a process can be accessed (or controlled) by the program (Chaandrupatla and Delegundu, 2011).. In terms of a washing machine a state can be the washing cycle at a low temperature. In a coffee dispenser the state can be the point in a process where change (if appropriate) is returned to the user. An input plus the current state are combined so that the next state can be assigned. The output is dependent on the state and input. A transition is when one state moves into another state (Lecture notes, 2016). The two basic types of FSM are the Mealy Machine and the Moore Machine (Roth, 2014). This paper studies two processes one a simple washing machine and the other a coffee dispenser that sells either espresso or cappuccino. The processes are presented as tables as states, as transitions and as transition states. Finally, each example, the washing machine and coffee dispenser are shown in the form of a FSM.
Finite Systems Machines (FSM) are a type of mathematical model that is made by observing a process, and then extracting out all the steps in the process that represent a state. A washing machine is a process with basically three states: on, off and washing cycle. The FSM was developed in the theory of computation (Roth, 2014). Although it would be hard to find a washing machine to purchase with only three states, but they are the basic states that designers start with before adding other functions. The design of complex processes like for a washing machine with many functions added is done by laying out the process as an FSM. The idea is to breakdown a process into its most basic components; the most basic components can be identified by if they can be controlled or not (Sontag, 1998). A basic component is defined as power button on an appliance that can be controlled by pushing it (to turn the power on) or not pushing it (to leave the power off) (Sontag, 1998). Problem solving with FSM is an exercise in matching patters (Sontag, 1998). FSMs are the models that are used for computers and other appliance-controllers (in the examples below) that use sequential logic circuits (Sontag, 1998).
On the other hand, real-time systems cannot be modeled (Chaandrupatla and Delegundu, 2011). The numbers of states are limited depending on the size of memory on a computer. Therefore, it is not possible to use FSM for all systems. For many systems, the possibility for modeling with FSM is available, but the behaviors assigned might be very difficult to assign in the terms of FSM states (Chaandrupatla and Delegundu, 2011).. However the advantage of FSM design is that the system development becomes much easier (Chaandrupatla and Delegundu, 2011).
The following examples are a washing machine and a coffee dispenser because the two are two different types of FSMs. The washing machine is a Mealy machine (Roth. 2014). Mealy machines are less expensive than Moore machines and easier to use. The user only needs a few seconds to set the dial and push the button for the washing machine to wash a batch of clothes. On the other hand, the Moore machine is more expensive to build, but they react very quickly; they are faster than the Mealy machines.
Mealy machines have computations that are dependent upon the current state and outputs (Roth, 2014)..This contrasts with a Moore Machine, the coffee dispenser in this case that allows one transition for each state and input (Roth, 2014). The two types of machines are very different when you compare their practical use, but by comparing their FSM some of their similarities become apparent. Both machines need to have user interaction to start the process. The user then makes decisions so that the process continues based on the user’s choices until the end of the process.
On the other hand their differences include that the coffee dispenser’s output logic only depends upon the present state of the process (Roth, 2014).. In the washing machine example outputs are dependent on the present state and on the present inputs (Roth, 2014).). The outputs change asynchronously with the enabling clock edge for the Mealy machine, but outputs change synchronously for a Moore Machine with the clock edge that is the because the outputs change when the state changes (Roth, 2014). The counter is a Moore machine, but the counter is not a Mealy machine (Roth, 20014). The Mealy machine demonstrates the same number of states or less states than a Moore machine (Roth, 2014).
Working with FSM helps to better understand how computer language can be written with only the two symbols 0 and 1, because the processes or systems described are broken down into the smallest components (Chaandrupatla and Delegundu, 2011). The development of computers and the variety of computer software coupled with new innovations make it important to understand FSM. Recent innovations rely on finite systems models and theories at the atomic and nanoscale levels allow the production of new materials that are able to expand with heat or shrink from cold without becoming damaged (Jena, Khanna and Rao, 1992)
2.0 Washing Machine (WM)
Push the start button and the power to the washing machine turns on. Press the stop button and the washing cycle will stop completely, draining all the water from the washing drum. The third main control is the dial for the washing cycle. The dial has two sub-categories. You can wash the clothes at two different temperatures, a high temperature and a low temperature. Once the wash cycle has started at either of the temperature setting you cannot control the wash dial. The only control the person washing has is to push the stop button while the washing is going on. The states listed in table 2 are assumed to be the only states that particular washing machine can demonstrate. The washing machine is a Mealy machine, so every output is linked with a corresponding state transition, and before the end of the state transition (Chaandrupatla and Delegundu, 2011). Therefore the output is observed with the next clock pulse (Chaandrupatla and Delegundu, 2011).
2.1 WM States and Descriptions
Zero the washing machine is turned off
On – the washing machine power is turned on so the washing machine can be used Note that the pushing the start button happens after the wash dial has been set to the correct wash dial temperature setting (Eng. 6 539, 2016).
Washing cycle- clothes are washing with a low temp
Washing cycle - Clothes are washing with a high temp
Off – turn the power off so washing stops
2.2 WM Events
Assumption: These are the only states possible for the machine, the machine has a finite number of states
2.3 WM Transition table
The rows of the table are the states and the events are in the columns (Lecture notes, 2016).
The coffee dispenser sells espresso for 1 Euro and cappuccino for 2 Euros. The dispenser only takes coins no bills. The FSM is designed to show what the user’s behavior will cause the process to do. The number of coins the user adds to the dispenser signals what kind of coffee should be dispensed. The FSM can become very complicated when choices for sugar are added for example. Each new component of the process adds at least one more system action that can be drawn to help design a an appliance. The machine reacts to the user’s behavior but the path for the machine is planned during the design, the user does not have to do anything except make choice and put coins in dispenser’s slot. At the end of the process the user needs to pick their coffee and any change they might have coming to them. By this time the coffee dispenser is finished with their process and that system no longer responds to the user’s behavior.
The Moore machine is different from the Mealy machine because is is an asynchronous machine (Chaandrupatla and Delegundu, 2011). The output is not associated with the state transition, but instead with the state. Therefore the output occurs after the state transition is finished. For instance, when the user has change coming from the coffee purchase, then the change is released and after the change is released the user can take their change The state of a Moore machine is finite in the way that no other process states or states of
3.1 CD States and Descriptions
Designing the FSM for the two machines, the washing machine and the coffee dispenser turned out to be more difficult than I had expected. After I sketched out the FSM for each of the machines and thought I was finished the FSM still was done. I reviewed the actions a user takes to wash clothes and to purchase coffee several times before all the parameters of the design were met. Both of the FSM are drawn showing the steps in the process in a linear way. Some of the paths and the entire process of the washing machine could also have been drawn as cycles. Also, some of the steps could have been combined, for example, when a user decides not to purchase coffee and canceled the purchase after 0.50, 1, or 1.50 Euros had been placed in the machine; all three of the steps of the process could be combined. The three events of adding one, two or three coins can be combined when considering the start of the process to the cancelling of the process. There is a problem with combining steps that have the same begin and end, some components can be left out or assigned to the wrong action.
The Mealy and Moore machines both have a place in computational theory, because they show what to expect when dealing with states, events and transition states to build an FSM.
5.0 References
Chaandrupatla, T.R. and Delegundu, A.D. 2011. Introduction to finite elements in engineering. 4th ed. CA: Pearson.
Jena, P., Khanna, S.N., and Rao, B.K.N. (Eds.) 1992. Physics and Chemistry of Finite Systems: From Clusters to Crystals. Vol. 1. NATO Science Series. MA: Springer.
Roth, C.H. and Kinney, L.L. 2014. Fundamentals of Logic Design. Thomson Engineering. 7th ed. Canada: Engage Learning.
Sontag, E.D. 1998. Mathematical Control Theory. Deterministic Finite Dimensional Systems. 2nd ed. Book 6. MA: Springer. pp. 1-24.
6.0 Appendix
Figure 3 Original for washing machine
Figure 4 Original figure for CD FSM
Restriction: the dispenser only accepts 50 cent Euro coins; no bills are accepted