A SET, RST, or INIT
input is not shown for the flip-flops in Figure 9.1, because this state
machine model may be designed with a SET input, a RST input, or INIT input—that is, the
required input is provided in the design specification.
The synchronous process generates the D flip-flops for the state machine design and the
following signals:
1. The present-state (PS) value after SET, RESET, or INITIALIZATION (a SET, RST, or INIT
input is not shown in Figure 9.1).
2. The present-state (PS) value after the next rising edge (or falling edge) of the clock—that is,
the value of the next state, or PS ,5 NS.
The combinational process generates the following signals:
1. The next-state (NS) value—that is, the decoded next state functions—based on the presentstate
(PS) value and the external inputs (EIs) via the cloud of combinational logic.
2. The flip-flop output values for Qs or Ys.
3. The Moore and Mealy output values (covered later).
The two-process PS/NS method requires less hardware understanding, but a more detailed
understanding of VHDL. The two-process PS/NS method is considered the preferred VHDL
coding style for complex state machine designs. By following this coding style, someone can
easily understand the code that you write, and you can understand someone else’s code.
Figure 9.2 shows a complex state machine named binary up/down counter (2 bits) with
an external input UP that is used to change the state sequence. “State name” is shortened to
“Name” in Figure 9.2. The state names are a, b, c, and d.