boolean-algebra

Mastering Sum of Products (SOP): Your Guide to Boolean Function Simplification

Denny Denny
7 min read
Diagram showing the conversion of a truth table into a Sum of Products Boolean expression with AND-OR gate implementation.
Sum of Products (SOP) provides a systematic method for converting any truth table into a gate-level digital circuit.

The fundamental challenge of digital design is translating a desired behavior — a set of rules expressed as a truth table — into a physical arrangement of logic gates. How do you bridge this gap systematically, without guesswork?

The answer is the Sum of Products (SOP) form. SOP provides a mechanical, repeatable method for converting any truth table into a working gate-level circuit. It is the first major step in moving from abstract requirements to tangible hardware.

What is Sum of Products?

At its core, the Sum of Products form is a way of writing a Boolean expression by OR-ing together one or more AND terms. In Boolean algebra, we often refer to the OR operation as a “sum” and the AND operation as a “product.”

Consider the following expression:

Y=(AB)+(AB)Y = (A \cdot \overline{B}) + (\overline{A} \cdot B)

Here, (AB)(A \cdot \overline{B}) is one product term, and (AB)(\overline{A} \cdot B) is another. The + symbol represents the OR operation, or the “sum” of these products. This structure directly translates into a two-level circuit: a first level of AND gates feeding into a second level of a single OR gate. This predictability is the source of its power.

The Atomic Unit: Minterms

To build any SOP expression from a truth table, we first need to understand its fundamental building block: the minterm. A minterm is a special product term that contains every variable in the function, either in its true or complemented form.

For a function with three variables (A, B, C), there are 23=82^3 = 8 possible minterms. Each minterm corresponds to exactly one row of the truth table.

The rule for creating a minterm is simple:

  • If the variable’s value in the row is 1, use the variable directly (e.g., A).
  • If the variable’s value in the row is 0, use the variable’s complement (e.g., A\overline{A}).

Let’s list the minterms for a 3-variable system:

MintermBinary (ABC)Expression
m0m_0000ABC\overline{A} \cdot \overline{B} \cdot \overline{C}
m1m_1001ABC\overline{A} \cdot \overline{B} \cdot C
m2m_2010ABC\overline{A} \cdot B \cdot \overline{C}
m3m_3011ABC\overline{A} \cdot B \cdot C
m4m_4100ABCA \cdot \overline{B} \cdot \overline{C}
m5m_5101ABCA \cdot \overline{B} \cdot C
m6m_6110ABCA \cdot B \cdot \overline{C}
m7m_7111ABCA \cdot B \cdot C

Notice that each minterm will only evaluate to 1 for its specific combination of inputs. For instance, m5m_5 (ABCA \cdot \overline{B} \cdot C) is only true when A=1, B=0, and C=1. For all other seven input combinations, it is false. Minterms are precision tools for targeting individual rows of a truth table.

From Truth Table to SOP: A 3-Step Method

With minterms understood, converting any truth table into an SOP expression is a straightforward, mechanical process.

Let’s use a “2-out-of-3 Majority” function as our example. The output Y is 1 only when two or more inputs are 1.

ABCYMinterm
0000
0010
0100
0111ABC\overline{A} \cdot B \cdot C
1000
1011ABCA \cdot \overline{B} \cdot C
1101ABCA \cdot B \cdot \overline{C}
1111ABCA \cdot B \cdot C

Step 1: Identify all rows where the output is 1. In our example, the output Y is 1 for input combinations 011, 101, 110, and 111.

Step 2: Write the minterm for each of these rows. Using our table above, the corresponding minterms are m3,m5,m6,m_3, m_5, m_6, and m7m_7.

Step 3: OR all the minterms together. This gives us the final SOP expression for the function:

Y=(ABC)+(ABC)+(ABC)+(ABC)Y = (\overline{A} \cdot B \cdot C) + (A \cdot \overline{B} \cdot C) + (A \cdot B \cdot \overline{C}) + (A \cdot B \cdot C)

This is known as the canonical SOP form because it is a direct, unsimplified sum of all the relevant minterms. It perfectly describes the function, and we can build a circuit from it immediately.

Common Pitfall: Canonical vs. Minimal Form

A common point of confusion for students is assuming the canonical SOP is the final answer. While it is functionally correct, it is almost never the most efficient implementation. It often uses more gates and more inputs than necessary.

Look at our majority function expression again. We can simplify it using Boolean algebra:

Y=(ABC)+(ABC)+(ABC)+(ABC)Y = (\overline{A} \cdot B \cdot C) + (A \cdot \overline{B} \cdot C) + (A \cdot B \cdot \overline{C}) + (A \cdot B \cdot C) Y=BC(A+A)+AC(B+B)+AB(C+C)Y = B \cdot C \cdot (\overline{A} + A) + A \cdot C \cdot (\overline{B} + B) + A \cdot B \cdot (\overline{C} + C)

This algebraic approach works but is error-prone for larger expressions. A Karnaugh Map provides a visual method for SOP simplification. By grouping the 1s from our truth table in a K-map, we quickly find a much simpler expression:

Y=(AB)+(AC)+(BC)Y = (A \cdot B) + (A \cdot C) + (B \cdot C)

This minimal SOP form implements the exact same logic but requires only three 2-input AND gates and one 3-input OR gate, a significant improvement over the four 3-input AND gates and one 4-input OR gate of the canonical form. The lesson is clear: the first SOP you derive is your starting point for optimization, not your destination.

Simulating on digisim.io

Let’s build the unsimplified, canonical version of our majority circuit to prove the concept. This is the best way to internalize the link between the equation and the hardware.

  1. Set up Inputs: Drag three Input components from the toolbar onto your canvas. Label them A, B, and C.
  2. Create the Minterms (Product Terms):
  • For the first minterm, ABC\overline{A} \cdot B \cdot C, you’ll need one NOT gate for input A. Wire the output of this NOT gate, along with inputs B and C, into a 3-input AND gate.
  • Repeat this process for the other three minterms: (ABC)(A \cdot \overline{B} \cdot C), (ABC)(A \cdot B \cdot \overline{C}), and (ABC)(A \cdot B \cdot C). You will have a total of four 3-input AND gates.
  1. Create the Sum: Wire the outputs of all four AND gates into a single 4-input OR gate.
  2. Add the Output: Connect the output of the final OR gate to an Output component (or an LED for visual feedback).

Now, test your circuit! Toggle the A, B, and C inputs. You will see that the output is only active when at least two inputs are high, exactly matching our original truth table. You have successfully translated a specification into a working digital logic circuit.

The SOP-to-NAND-NAND Connection

One of the most important properties of SOP is its direct mapping to NAND-NAND logic. In CMOS technology, NAND gates are physically smaller and faster than AND or OR gates. Fortunately, any SOP expression can be converted to a two-level NAND-NAND circuit using De Morgan’s Laws.

The conversion is mechanical. Starting with our minimal majority function:

Y=AB+AC+BCY = AB + AC + BC

Apply double negation (which does not change the value):

Y=AB+AC+BCY = \overline{\overline{AB + AC + BC}}

Apply De Morgan’s Law to the outer bar:

Y=ABACBCY = \overline{\overline{AB} \cdot \overline{AC} \cdot \overline{BC}}

Each AB\overline{AB} is a NAND operation, and the outer bar over their product is also a NAND. The result is a two-level NAND-NAND circuit: three 2-input NAND gates feeding one 3-input NAND gate. This is logically identical to the AND-OR implementation but uses only one type of gate, which simplifies manufacturing and cell libraries.

Real-World Use

The Sum of Products form is embedded in the architecture of modern computing.

  1. Programmable Logic Arrays (PLAs): These are integrated circuits used for implementing complex combinational logic. A PLA’s internal structure is a direct physical manifestation of the SOP concept. It consists of a programmable “AND-plane” (to create product terms) followed by a programmable “OR-plane” (to sum the products). Engineers define a function by specifying which connections to make in these planes, effectively building a custom SOP circuit in hardware.
  2. Memory Address Decoding: When a CPU needs to read from or write to a specific location in memory, it places an address on the address bus. Decoder circuits within the memory controller must identify which memory chip and which row/column to activate. This logic is often implemented using SOP. For example, a signal to enable a specific block of RAM might be Enable_Block_3 = A_{15} \cdot A_{14} \cdot \overline{A_{13}}. This product term ensures that block is only selected when the high-order address bits match that specific pattern. The logic for the entire memory map is a sum of such product terms.

The SOP form provides a reliable, systematic path from an idea to a circuit. It guarantees that any Boolean function, no matter how complex, can be expressed and built using a standard two-level AND-OR (or NAND-NAND) gate structure.

Ready to put this into practice? Open digisim.io and build the majority-vote circuit. Start with the canonical 4-minterm version, verify it against the truth table, then simplify to the 3-term minimal form and confirm that both produce identical outputs.