3.1.9 · D4Boolean Algebra & Logic Gates

Exercises — Sum of products (SOP) form

3,594 words16 min readBack to topic

A quick reminder of the only three tools you need, so nothing is assumed:

Figure — Sum of products (SOP) form

How to read Figure s01. The left column is one entry per input row, labelled with the input bits (top row , then , , going down) — these are the four possible inputs of a 2-variable function. The right column is the output of the single minterm evaluated on each of those rows. Only the row (labelled "row 10") turns orange and its output cell turns green with a bold 1; every other output cell stays white with a 0. The red arrow points at that one firing row. That is the whole message: a minterm is a row-detector — 1 on exactly one row, 0 on all the rest. When you build SOP you OR together the detectors of the winning rows. Keep this picture in view as you work Exercises 2.1, 4.1 and 5.3.


Level 1 — Recognition

Exercise 1.1

Which of these are in SOP form (an OR of AND-terms)? Answer yes/no for each.

  • (a)
  • (b)
  • (c)
  • (d)
Recall Solution

SOP = the outermost operator is OR, and each piece it joins is a pure AND of literals (a single literal counts as a one-literal product). Use the precedence rules above to find the outermost operator: OR binds loosest, so it is applied last and therefore sits on the "outside".

  • (a) Yes. Outer is ; pieces and are ANDs. ✓
  • (b) No. Outer operator is AND (two bracketed sums multiplied). That is POS shape, not SOP.
  • (c) Yes. A single product term is a valid (one-term) SOP.
  • (d) Yes. Outer is ; each piece is a single literal (a product of one literal). ✓

Exercise 1.2

In the minterm (variables ), which single input row makes it equal 1?

Recall Solution

A minterm equals 1 only when every literal is 1 simultaneously.

  • (plain ), , . So the row is — i.e. binary = row 5. Every other row makes at least one literal 0, so the AND is 0.

Level 2 — Application

Exercise 2.1

Build the canonical SOP for this truth table.

A B F
0 0 0
0 1 1
1 0 1
1 1 0
Recall Solution

Step 1 — pick the 1-rows. at rows and . Step 2 — write each minterm using the rule "0 gets a hat" — the overbar (variable is 0 → draw the hat/bar; 1 → leave bare):

  • Row :
  • Row : Step 3 — OR the winners: This is the XOR function (see logic gates). In the shorthand (OR the minterms of these row numbers), the 1-rows are = row 1 and = row 2, so canonical form .

Exercise 2.2

Convert the expression into (non-canonical) SOP.

Recall Solution

Note the brackets are load-bearing: by the precedence rules would mean , a different function — the brackets force the OR to happen first. The shape "variable AND a bracketed OR" is a product-of-sums seed. We use the distributive law () because it is the one law that turns an AND-over-OR into an OR-of-ANDs — exactly the SOP direction. Outer operator is now OR, each piece an AND → valid SOP with two terms.


Level 3 — Analysis

Figure — Sum of products (SOP) form

How to read Figure s02. Two mini truth tables side by side. Left (): the column runs ; the column is its flip ; the result column is — a solid green stripe = always 1. Right (): the two input columns are identical copies of ; the result column equals itself () — proving OR-with-yourself is a no-op. These two green patterns are the visual receipts for the two laws.

Exercise 3.1

Simplify to the fewest literals, then say how many gates you saved.

Recall Solution

Group and factor using Boolean Algebra Laws. First group the two terms sharing : (used complement law — the green stripe on the left of Figure s02). Now: Apply absorption in the form (here , , and ): Gate count: original = three 2-input ANDs + one 3-input OR. Final = a single 2-input OR gate. Same truth table, far cheaper circuit.

Exercise 3.2

Are and the same function? Prove it.

Recall Solution

Method — simplify and compare. Group first two (share ): . Absorption (since with ). Cross-check by truth table (both give except when ): rows , row . Identical.


Level 4 — Synthesis

Exercise 4.1

A safety light must turn ON when at least two of three switches are ON (majority vote). Design in canonical SOP, then simplify.

Recall Solution

Step 1 — list the 1-rows (two or three switches on). Reading each row as the input triple , the 1-rows are . Step 2 — minterms (0→bar, 1→plain):

  • Step 3 — canonical SOP: Step 4 — simplify by pairing with each of the other three (it shares two literals with each): Why is OR-ing these three factored results the same as the original four minterms? We use the idempotent law (right side of Figure s02): OR-ing a term with itself changes nothing, so we may duplicate for free: . Rewrite the four-minterm sum as Every one of the four original minterms still appears at least once inside those brackets (, , each once, and three times), and no new row is introduced — each bracket only pairs with an existing minterm. So the OR of the three factored terms lights up on exactly the same four rows. Therefore: Read it: "any two switches together." The K-map in Figure s03 gives the same three pairs visually — each looped pair of adjacent 1-cells collapses to one two-literal term.
Figure — Sum of products (SOP) form

How to read Figure s03. This is a Karnaugh map — a 2-by-4 grid where every cell is one of the eight rows of the truth table, arranged so that neighbouring cells differ in exactly one bit. Columns are labelled by in the order (Gray-code order, so adjacency works), rows by ( on top, below). We write a 1 in the four cells (our majority 1-rows) and 0 elsewhere. Three coloured loops each enclose a pair of adjacent 1-cells: the blue loop = , orange = , green = . A loop that spans two cells drops the one variable that changes across it — that is the visual version of the factoring we did in the algebra. OR the three loops → , matching the boxed answer.

Exercise 4.2

Expand (variables ) to canonical SOP.

Recall Solution

Each term is missing a variable. Multiply the missing variable in as — this changes nothing (that is the complement law, the green stripe in Figure s02: is always 1, and multiplying by 1 is harmless) but it reveals the hidden minterms. Combine and drop the duplicate (by the idempotent law ): Rows: (m0), (m2), (m3). ✓


Level 5 — Mastery

Exercise 5.1 (edge / degenerate)

Give the SOP form of the constant function over variables , and of .

Recall Solution

: every row outputs 1, so OR all minterms: (Simplifies right back to : .) : there are no 1-rows, so there are no minterms to OR. The canonical SOP is the empty sum, which by convention equals . Why must an empty OR equal 0? An OR asks "is at least one input 1?". Its neutral/identity value is 0, because OR-ing onto anything leaves it unchanged (). So starting an OR "accumulator" at 0 and then adding no terms leaves it at 0 — nothing ever turned it on. (Set-algebra analogy: the union of no sets is the empty set; nobody was ever added, so nothing is inside.) You cannot list winners when nobody wins — the degenerate case.

Exercise 5.2

A circuit outputs 1 exactly when the 2-bit number (with the high bit) is not equal to in binary. Write canonical SOP, then simplify, and state the gate count.

Recall Solution

Step 1 — find the forbidden row. means → row = m2. So only at m2; everywhere else. Step 2 — canonical SOP over the remaining rows : Step 3 — simplify. Group first two (share ): . Step 4 — gate count: just one NOT (for ) and one 2-input OR. Compare: the complement view says the single 0-row gives POS directly — the same answer, confirming both methods agree.

Exercise 5.3

Using Truth Tables, verify that equals its own canonical SOP over .

Recall Solution

Expand each term to full minterms (insert the missing variable via ):

  • rows (m7), (m6).
  • rows (m3), (m1). Collect: . Truth-table check — build the full table for and read off where it is 1:
row A B C
0 0 0 0 0 0 0
1 0 0 1 0 1 1
2 0 1 0 0 0 0
3 0 1 1 0 1 1
4 1 0 0 0 0 0
5 1 0 1 0 0 0
6 1 1 0 1 0 1
7 1 1 1 1 0 1

The 1-rows are exactly — a one-to-one match with the four minterms. ✓


Active Recall

Recall Rapid self-check
  1. Outer operator that identifies SOP? → OR.
  2. Which bit gets the bar (the "hat") in a minterm? → The 0 bit.
  3. SOP of ? → Empty sum (no minterms; 0 is OR's identity).
  4. Law used to inject a missing variable? → Multiply by (complement law).
  5. Law (absorption).
  6. Law that lets you duplicate a term for free? → Idempotent .
  7. Precedence order strongest→weakest? → NOT, then AND, then OR.

Connections