Altifigence Academy

7 / 63 · Concept

Boolean algebra, equivalent transformations and implementation cost

Transform circuits with De Morgan's laws and factoring, while distinguishing logical equivalence from timing.

Equivalent expressions produce the same output for every input

Simplifying a combinational circuit is not just about shortening an expression. Preserve its function while considering logic depth, fan-in, fan-out and actual library cells. Start by reading ++ and multiplication in Boolean algebraBoolean algebra Algebra of 0, 1, AND, OR and NOT. The plus sign usually denotes OR here, whose rules differ from integer addition. as OR and AND.

A+AB=A,A+A‾B=A+BA+AB=A,\qquad A+\overline A B=A+B

Verify the second identity by cases: when A=1A=1, both sides are 1; when A=0A=0, both sides equal BB. Be able to explain the meaning even after applying a memorized identity.

Read NAND and NOR structures with De Morgan's laws

AB‾=A‾+B‾,A+B‾=A‾ B‾\overline{AB}=\overline A+\overline B,\qquad \overline{A+B}=\overline A\,\overline B

For example, Y=AB+ACY=AB+AC equals A(B+C)A(B+C). The former can use two ANDs and one OR; the latter one OR and one AND. But with different input arrival times or loads, fewer gates do not always mean a faster circuit.

The consensus theorem is also useful:

AB+A‾C+BC=AB+A‾CAB+\overline A C+BC=AB+\overline A C

When BC=1BC=1, either A=0A=0 makes A‾C=1\overline A C=1, or A=1A=1 makes AB=1AB=1. Thus BCBC is redundant for the steady-state function. Removing it can, however, change hazards during transitions. We will address that distinction in the later delay lesson.

Each column below represents one ABC input combination, not elapsed time. Check that the two outputs agree in every column. Gate counts and paths may differ while the function for stable 0/1 inputs remains the same.

Equivalence of AB + AC and A(B + C)
View waveform data
Wave data: each character is one interval; a dot holds the previous state; p is a clock cycle.
SignalWaveBus values
ABC23452345000 → 001 → 010 → 011 → 100 → 101 → 110 → 111
AB+AC0....1..
A(B+C)0....1..

What constitutes an equivalence check?

Call the original and optimized outputs y_ref and y_opt. For a small input space, compare every input. Passing one or two examples is not enough to conclude equivalence.

SystemVerilog
assign y_ref = (a & b) | (a & c);
assign y_opt = a & (b | c);
assign mismatch = y_ref ^ y_opt;

mismatch must be 0 for all eight combinations of 0/1 inputs. Four-state simulation involving X/Z and equivalence of sequential circuits require additional conditions. Stating exactly what has been established is a basic habit in design review.

Try it yourself

Simplify F=A‾B+AB+AB‾F=\overline A B+AB+A\overline B and state how many input combinations must be checked.

Read the explanation

The first two terms give B(A‾+A)=BB(\overline A+A)=B, so F=B+AB‾=A+BF=B+A\overline B=A+B. There are two variables, hence four combinations to check. Equivalent expressions do not imply equal propagation delays in the two implementations.

Your choice applies to this browser. Change it any time using the footer.