next up previous contents index

[ENGN3213 Home]

   
Formal Definition of Finite State Machines

  We know that combinational logic circuits are described formally using Boolean algebra, a mathematical formalism. State machines are also described in mathematical terms, as follows.

Finite sets:

  These sets can be symbolic, not necessarily binary. E.g.

\begin{displaymath}X = \{ {\rm\ up, \ down, \ stop } \ \}
\end{displaymath}

These values or symbols reflect the meaning of the state machine specification. For binary implementation we would use a binary encoding.

Functions:

The function f is called the next state function, and h is called the output function.

  Equations. Moore machine:

 \begin{displaymath}% latex2html id marker 95
\begin{array}{rl}
s(t+1) & = f(s(t)...
...
z(t) & = h(s(t)) \ \ \ \ {\rm - output \ equation}
\end{array}\end{displaymath} (3)

  Equations. Mealey machine:

 \begin{displaymath}% latex2html id marker 106
\begin{array}{rl}
s(t+1) & = f(s(t...
... & = h(s(t),x(t)) \ \ \ \ {\rm - output \ equation}
\end{array}\end{displaymath} (4)

In these equations t indicates time, and so the equations specify how the value of the state s=s(t+1) at time t+1 is determined by the state value s=s(t) at time t and the input x=x(t) at time t. The equations are a description of the sequential operation of the machine. The outputs are specified in either of two ways, corresponding to the names Moore machine and Mealey machine. The only difference is that a Mealey output may depend explicitly on the current input value x(t) whereas a Moore output depends only on the current state s(t).

The FSM black-box model is illustrated in Figure 50.


  
Figure 50: Finite state machine (FSM).
\begin{figure}
\begin{center}
\epsfig{file=images/seqimg1.eps}\end{center}\end{figure}

Example. For the Up/Down/Stop counter, we have

\begin{displaymath}\begin{array}{rl}
X & = \{ {\rm\ up, \ down, \ stop } \ \} \\...
..., \ s4 } \ \} \\
Z & = \{ {\rm\ odd, \ even } \ \}
\end{array}\end{displaymath}

Example. For the vending machine controller, we have

\begin{displaymath}\begin{array}{rl}
X & = \{ {\rm\ coins, \ return, \ change-av...
...e-candy, \ return-all-coins, \ return-change } \ \}
\end{array}\end{displaymath}


next up previous contents index

[ENGN3213 Home]

ANU Engineering - ENGN3213