INTRODUCTION TO FINITE STATE MACHINES


FINITE STATE MACHINES

The finite state machines are critical for realizing the control and decision making logic in the digital syatems. Why are they called Finite State Machine? It is because the sequential logic that implements them can be in only a fixed number of states. In the finite state machines, the outputs and the next state is a function of the input and the present state. This means that the choice of the next state can depend on the value of an input and might lead to more complex behavior of the system. Since in sequential logic we need the past history of inputs to determine the output hence finite state machine prove very helpful in realizing sequential logic functions.There are basically two ways in which we can organize a sequential design. These are the Moore machine and Mealy machine design implementation which is discussed below.

WHAT IS A MOORE MACHINE?

In the Moore machines , the outputs depend only on the present state. This basically means that the inputs and the present state are mapped into flip-flop inputs to store the appropiate next state. The inputs to the logic block that computes the outputs for these machines is then the output states of the flip-flop. Hence with such a design, whenever there is a state change in response to a clock edge there is a corresponding change in the output. This means that the outputs are synchronous with the state change and the clock edge.

HOW ARE MOORE MACHINES REPRESENTED?

Since the Moore machine outputs are not dependent on the input but only on the state transitions, therefore in a Moore machine state diagram the outputs are associated with the state in which they are asserted. The transition arcs are labeled with the inputs conditions that cause the transition from the state at the tail of the arc to the state at the head of the arc.

WHAT IS A MEALY MACHINE?

Unlike the Moore machine, in a Mealy machine the outputs depend on the present state as well as the current value of the inputs. Hence the inputs to the logic block that computes the outputs for a Mealy machine, would be state outputs from flip-flop and also the present value of the inputs. This means that any change in the value of the input independent of the clock edge would be reflected in the outputs. Thus a Mealy machine are said to have asynchronous outputs.

HOW ARE MEALY MACHINE'S REPRESENTED?

Since the Mealy machine outputs are dependent on the inputs, the outputs are associated with the transition arcs rather than the state bubble. The transition arc is labelled by both inputs and outputs with a slash separating them. Unlike the Moore machines where the outputs are asserted inside the state, in a Mealy machine the outputs are asserted before we enter the state at the head of the arc.