How to Generate State and Output Equations from a Logic Diagram?
- Identify the number of inputs, outputs and flip-flops in the logic diagram.
- For each D Flip-flop: Form the equation of the input, D, for each flip-flop.
- The state equation tells what value would be saved at the next edge of clock and is represented by the name of the flip-flop.
- For example, \(\mathsf{A(t+1) = \dots{}}\)
- For Each Non-flip-flop or Combinational Output: Form the equation and name it correspondingly.
- The output equation tells what value would be saved immediately on the wire and is represented by the name of the output signal.
- For example, \(\mathsf{y = \dots{}}\) or \(\mathsf{y(t) = \dots{}}\)
Example: Extract the State and Output Equations from the given Logic Diagram
The logic diagram below illustrates a sequential circuit built using D flip-flops.
Step 1: Identify the number of inputs, outputs and flip-flops in the logic diagram
When examining a sequential circuit, you first need to identify its core components. Aside from the standard clock and reset lines, let’s break down the signals and memory elements in this specific design:
- Total Inputs: 1 (External input \(\mathsf{x}\))
- Total Flip-Flops: 2 D-type flip-flops (Outputs \(\mathsf{A}\) and \(\mathsf{B}\))
- Total Combinational Outputs: 1 (Output \(\mathsf{y}\))
Identifying the Circuit Type
Notice that output \(\mathsf{y}\) is generated through combinational logic rather than directly from a flip-flop. This characteristic makes it a Mealy-type circuit.
(If the outputs depended strictly on the flip-flop states alone, it would be a Moore-type circuit. We will cover the differences between Mealy and Moore machines in more detail later in the course).
Step 2: For each D Flip-flop: Form the equation of the input, D, for each flip-flop
Next, trace the logic gates feeding into each memory element to determine how the circuit updates.
Flip-flop A’s input is driven by an OR gate connected to two AND terms (\(\mathsf{Ax}\) and \(\mathsf{Bx}\)). Meanwhile, flip-flop B’s input comes directly from \(\mathsf{\overline{A}x}\).
From these connections, we can derive the next-state equations for the circuit:
\begin{align*}
\mathsf{A(t+1) }& \mathsf{ =Ax+Bx=(A+B)x}\\
\mathsf{B(t+1) }& \mathsf{ =\overline{A}x}
\end{align*}
Step 3: For Each Non-flip-flop or Combinational Output: Form the equation and name it correspondingly
Finally, determine the circuit’s output equation. The combinational output \(\mathsf{y}\) is formed by combining \(\mathsf{\overline{x}}\) with \(\mathsf{(A + B)}\) using an AND operation, resulting in:
\[\mathsf{y=(A+B)\overline{x}}\]
The circuit is redrawn here with each state and output equation written along side it: