Hardware Reference
In-Depth Information
3.7 State-Encoding Options
This section describes the main codes used for encoding the states of an FSM.
The most common encoding alternatives are sequential (also called binary ), Gray ,
Johnson , and one-hot , all illustrated in i gure 3.9a for an eight-state FSM. Note that
the i rst two require three bits, the third requires four bits, and the last one requires
eight bits.
To illustrate the encoding options further, let us consider a machine with the fol-
lowing i ve states (using VHDL notation):
type state is (A, B, C, D, E);
3.7.1 Sequential Binary Encoding
The states are encoded using the conventional binary code (increasing order of cor-
responding decimal values; see i gure 3.9a). For the type state above, three bits would
be needed, resulting A = “000” (decimal value = 0), B = “001” (= 1), C = “010” (= 2),
D = “011” (= 3), and E = “100” (= 4).
The advantage of this encoding is that it requires the smallest number of l ip-l ops;
with N l ip-l ops ( N bits), up to 2 N states can be encoded. The disadvantage is that it
might require more combinational logic than other encoding options (illustrated in
exercises 3.2 and 3.3), so the resulting circuit might be slightly slower.
Figure 3.9
(a) Main encoding options for an eight-state machine. (b) Regular sequential binary counter with
outputs converted to Gray code. (c) Johnson counter. (d) One-hot counter.
Search WWH ::




Custom Search