3.1.9 · D2Boolean Algebra & Logic Gates

Visual walkthrough — Sum of products (SOP) form

2,108 words10 min readBack to topic

This is the visual companion to the SOP topic note. Read it slowly; each step is one idea.


Step 1 — What "1" and "0" even mean

WHAT. Before any algebra, fix the meaning of the two symbols we will use forever: and .

WHY. Every later step compares things to and . If we don't nail these down, "the row where " is meaningless. We are earning our alphabet.

PICTURE. Look at the figure. A switch pushed up is (current flows, lamp glows amber). A switch pushed down is (dark). That is the whole vocabulary.

  • Here is a variable — a name for one switch whose bit we can read.
  • (say "A-bar" or "not A") is the complement: the opposite bit. If then , and if then . Picture a switch wired upside-down.

Step 2 — The two tools: AND and OR, seen as gates

WHAT. Introduce the only two operations SOP needs: (AND) and (OR).

WHY these two and not arithmetic? The symbols and look like add and multiply, but our values are bits, so we need operations that keep answers as bits. AND and OR do exactly that — and they happen to match how switches combine in real wire. That is why these tools, not schoolbook .

PICTURE. Two lamps. In the top circuit both switches are in series — the lamp lights only when both are ON: that is AND. In the bottom circuit the switches are in parallel — the lamp lights when at least one is ON: that is OR.


Step 3 — Build a "row detector": the minterm

WHAT. For a chosen combination of switches, build one AND term that is for that combination only and for every other.

WHY. SOP's whole trick is to make one gadget per winning row. If we can build a detector that fires for exactly one row, we can assemble any function from a pile of detectors. This step is the heart of everything.

PICTURE. We target the row . To make an AND term that is there, each literal must be on that row:

  • already → keep it plain: use .
  • → but AND needs a ; the opposite of is here → use .
  • already → keep it plain: use .

So the detector is . The figure shows all eight combinations of as lamps; only the target lamp glows amber, all others are dark.


Step 4 — Two switches, all four rows, four detectors

WHAT. Do the same for the smaller world of just , listing a minterm for every possible row.

WHY. Before combining detectors we want to see that they tile the whole truth table with no overlap and no gap — each row owned by exactly one minterm.

PICTURE. A map of the four rows. Each cell is labelled with the one minterm that fires there. Notice: no cell shares a minterm, and no cell is empty.

minterm ( bar, plain)
0 0
0 1
1 0
1 1

Each minterm is on its own row and on the other three — check one: needs and ; that is only row .


Step 5 — OR the winners: assembling the function

WHAT. Take a real function, keep only the minterms of rows where , and OR them together.

WHY. OR outputs if any input is . So if we OR the winning-row detectors, the result is exactly on the winning rows and on the losers — which is the function itself. This is the SOP construction.

PICTURE. Truth table below; the winning rows () are highlighted amber, and their minterms flow down into a single OR gate whose output is .

Let us prove it reproduces the table, row by row, so no case is left untested:

  • Row : , others . ✓ (table says 1)
  • Row : every minterm has a mismatched literal → . ✓ (table says 0)
  • Row : . ✓
  • Row : . ✓

Four rows, four matches. The construction is exact — and since we never used anything special about this table, every Boolean function has an SOP form.


Step 6 — Simplify: fewer gates, same lamp

WHAT. Shrink the expression using Boolean laws without changing any output.

WHY. The canonical SOP is correct but wasteful (three AND gates + an OR gate). Real circuits cost money per gate. Simplification trades big-and-honest for small-and-equal.

PICTURE. Two circuit diagrams side by side — the bulky canonical version and the lean simplified one — with a green "same truth table" seal between them.

Here because a switch is always either up or down — one of is always , so their OR is always . Then:

The step is the absorption law (see Boolean Algebra Laws): once covers the world, the term only adds the case , which is the same as just allowing . Same lamp behaviour, half the gates.


Step 7 — The degenerate cases (never skip these)

WHAT. Handle the two extreme functions: the lamp that is always off and the lamp that is always on.

WHY. Our recipe says "OR the winning rows". But what if there are no winners? Or all rows win? A rule that breaks on the edges is not a rule. Let's show it holds.

PICTURE. Left: a truth table with every (no amber rows) → nothing to OR. Right: every (all amber) → every minterm ORed.

  • All zeros ( everywhere). No winning rows, so the sum is empty. An empty OR is defined as — OR asks "is any term ?" and with no terms the honest answer is "no". So . ✓
  • All ones ( everywhere). Every row wins, so we OR all minterms. For : . On any row exactly one term is , so the OR is always ; hence . ✓ (You can also simplify it: , , and .)

Both extremes obey the same "OR the winners" rule — the recipe is complete, with no scenario left uncovered.


The one-picture summary

Everything above, compressed: read a truth table → highlight rows → each becomes a minterm ( barred, plain) → OR them → optionally simplify → build the circuit.

Recall Feynman: tell the whole walkthrough to a friend

"A bit is just a switch — up is 1, down is 0. There are two ways to combine switches: series (both must be on = AND) and parallel (any on = OR). Now here's the clever bit. Pick any single combination you care about — say switch A up, B down, C up. I can write one AND rule that lights up only for that exact combination: for each switch I write it plain if it should be up, or 'not-it' if it should be down. One wrong switch and the AND dies to 0, so it's a perfect lock for one key. To build any light-behaviour you want, I look at the table, find every row where the light should be ON, write the lock for each of those rows, and connect all the locks to one big OR. The OR shouts '1!' whenever any lock opens — which is exactly on the rows I wanted. If no rows are ON, there are no locks, and an empty OR is 0. If every row is ON, I use every lock and it's always 1. Finally I tidy up with Boolean laws to use fewer gates — same lamp, cheaper circuit. That whole story is Sum of Products."

Recall Quick self-check

Why is the AND term for row equal to ? ::: Because a minterm must be on its row; and are so they must be barred to become , and is already so it stays plain. An empty sum of minterms equals what, and why? ::: , because OR answers "is any term ?" and with no terms present the answer is "no". After simplifying to , is row still ? ::: Yes: , matching the original table.


Connections

  • Truth Tables — Step 5 reads SOP straight off the 1-rows.
  • Minterms and Maxterms — the row-detectors of Steps 3–4.
  • Product of Sums (POS) form — the mirror method built from the 0-rows.
  • Karnaugh Maps — a visual shortcut for the Step 6 simplification.
  • Boolean Algebra Laws — the identities (, absorption) used to simplify.
  • Logic Gates (AND, OR, NOT) — the series/parallel switches of Step 2 made physical.