In the last part we covered sequential circuits, in this part we’ll cover Finite State Machines.
FSMs are a type of sequential circuit, there are two main types of FSMs, Moore and Mealy.
Definition 1 (Moore and Mealy FSMs)
- Moore FSMs
- Outputs depend only on the state.
- Mealy FSMs
- Outputs depend on both state and primary inputs.
1-1 Detector
A 1-1 detector, generates an output, , whenever the input, is 1 twice in a row (clock cycles).
- Moore
- The output, , should be equal to 1 in the clock cycle that follows the detection of the second
- Mealy
- The output, , should be equal to 1 in the same clock cycle when the second, is detected.
Since the state table for the Mealy type will be shorter, since we have fewer states. The end result will result in a simpler circuit. But remember that they do not have the same logical function!
Most of the tasks can be realized by Moore-type FSM, as well as by Mealy-type FSM, although these two types of FSMs don’t have the exact same logic function.
Compared to Moore-type FSMs, Mealy-type FSMs have the following features:
- Fewer states;
- Quicker response;
- Usually, simpler circuit implementation;
- But, sometimes longer critical path, all the way from input to output
(v.s. Moore: from state registers to output)
- One solution: registered outputs in Mealy
State Assignments
Some state assignments are better than others. The state assignment influences the complexity of the state machine.
The combinational logic required in the state machine design is dependent on the state assignment.
Types of state assignment:
- Binary encoding: states Flip-Flops
- Gray-code encoding: states Flip-Flops
- One-hot encoding: states Flip-Flops
State minimization
Definition 2 (Equivalent states)
Two states and are said to be equivalent if and only if for every possible input sequence, the same output sequence will be produced regardless of whether or is the initial state.
Partition
Definition 3 (Partition)
A partition consists of one or more blocks, where each block comprises a subset of states that may be equivalent, but the states in a given block are definitely not equivalent to the states in other blocks.
For example:
Here, and are “blocks”.