bitGateLab Digital · Learn
English
Open the simulator

Learn › Topic 3

Truth tables and canonical forms: Σm and ΠM

8 min read · bitGateLab Team

Almost every digital design problem starts with a statement in words ("the alarm sounds if...") that is turned into a truth table. The next step is to get from that table an equation you can build with gates. Here you will learn the systematic method for doing it: minterms and maxterms, the canonical sum-of-products and product-of-sums forms, and the compact Σm and ΠM notation used by textbooks, simulators and Karnaugh maps.

How a truth table is ordered

With n variables there are 2n rows. They are written in ascending binary order, with the first variable as the most significant bit. That way each row is identified by a decimal number: in a table of A, B and C, the row A = 1, B = 0, C = 1 is 1012 = 5. That number is the one you will use as the minterm or maxterm index, so the order of the variables matters: change the order and the numbers change.

Minterms and sum of products

A minterm is a product (AND) that contains every variable exactly once, either complemented or uncomplemented. It is built like this: a variable that is 1 in that row goes without a bar, and one that is 0 goes with a bar. The minterm is 1 only in its own row and 0 in all the others. It is named mi, where i is the row number.

RowABCMintermMaxterm
0000m0 = ABCM0 = A + B + C
1001m1 = ABCM1 = A + B + C
2010m2 = ABCM2 = A + B + C
3011m3 = ABCM3 = A + B + C
4100m4 = ABCM4 = A + B + C
5101m5 = ABCM5 = A + B + C
6110m6 = ABCM6 = A + B + C
7111m7 = ABCM7 = A + B + C

If you sum (OR) the minterms of all the rows where the function is 1, you get an equation that is 1 in exactly those rows. That is the canonical sum of products (SOP for short), or first canonical form. In compact notation it is written F = Σm(list of rows with a 1).

Maxterms and product of sums

A maxterm is a sum (OR) that contains every variable. The rule is the opposite: a variable that is 0 in the row goes without a bar, and one that is 1 goes with a bar. A maxterm is 0 only in its own row. It is named Mi (with a capital M).

If you multiply (AND) the maxterms of all the rows where the function is 0, you get an equation that is 0 right there and 1 everywhere else: the canonical product of sums (POS), or second canonical form. It is written F = ΠM(list of rows with a 0).

The minterm and the maxterm of the same row are complements: mi = Mi. So if you know the Σm list of a function, the ΠM list is made up of all the numbers that do not appear in it.

Example 1: from the table to both forms. A three-variable function is 1 in rows 1, 3, 6 and 7.

#ABCF
00000
10011
20100
30111
41000
51010
61101
71111
  1. Compact notation: F = Σm(1, 3, 6, 7) = ΠM(0, 2, 4, 5).
  2. Canonical sum of products: F = ABC + ABC + ABC + ABC.
  3. Canonical product of sums: F = (A + B + C)(A + B + C)(A + B + C)(A + B + C).
  4. Simplify the SOP: ABC + ABC = AC and ABC + ABC = AB. So F = AC + AB.

Check in row 5 (A = 1, B = 0, C = 1): AC = 0 and AB = 0, so F = 0, the same as in the table.

Which form is better?

Both forms describe the same function, but they are not the same size. Use the one with fewer terms: if the function has few ones, Σm is shorter; if it has few zeros, ΠM is shorter. With 8 rows, a function with 2 ones has an SOP of 2 terms and a POS of 6.

The implementation matters too. A sum of products is built with AND gates feeding an OR, and that two-level structure converts directly into NAND-NAND. A product of sums is built with OR gates feeding an AND, and it converts into NOR-NOR.

Example 2: from the problem statement to the equation. A tank has three level sensors: A (low), B (middle) and C (high). Each sensor outputs 1 when the water reaches it. An "invalid level" lamp must light when the combination is physically impossible: a higher sensor active while a lower one is inactive.

  1. Valid combinations (ABC): 000, 100, 110, 111. That is, rows 0, 4, 6 and 7.
  2. The lamp lights in all the others: F = Σm(1, 2, 3, 5).
  3. Equivalently: F = ΠM(0, 4, 6, 7).
  4. Simplify: m1 + m3 = AC, m1 + m5 = BC, m2 + m3 = AB. Using m1 and m3 twice (idempotence), F = BC + AB.

Check: row 1 (001) gives BC = 1; row 2 (010) gives AB = 1; row 3 (011) gives AB = 1; row 5 (101) gives BC = 1. In 000, 100, 110 and 111 both terms are 0. It reads "C active without B" or "B active without A".

The complement of a function

If F = Σm(1, 3, 6, 7), its complement is 1 wherever F is 0: F = Σm(0, 2, 4, 5). This is useful when you want the simplified POS: you simplify F as a sum of products and then apply De Morgan. For example, F = AC + AB (check it against rows 0, 2, 4 and 5), and complementing gives F = (A + C)(A + B). If you multiply it out: AB + AC + BC, and by consensus that is AB + AC, the same result as in example 1.

To go deeper into these manipulations, review Boolean algebra; to simplify graphically, continue with Karnaugh maps.

Common mistakes

Try it in the simulator

The truth table module lets you enter a function row by row and immediately see its canonical forms and the simplified equation, so you can check every step you do by hand.

  1. Create a table with three inputs and one output.
  2. Set rows 1, 3, 6 and 7 from example 1 to 1 and leave the rest at 0.
  3. Look at the Σm and ΠM expressions that are generated and compare them with yours.
  4. Convert the table to a circuit and toggle the inputs to confirm that the output follows the table.
  5. Repeat with the tank problem and verify that the lamp lights only for the impossible combinations.

Exercises

  1. Write the minterm m9 and the maxterm M9 of a function of four variables A, B, C, D.
    Answer

    9 = 1001. m9 = ABCD and M9 = A + B + C + D.

  2. If F(A, B, C) = Σm(0, 1, 5), write F in ΠM notation.
    Answer

    F = ΠM(2, 3, 4, 6, 7).

  3. Find the canonical sum of products of a two-variable function that is 1 only when A and B are equal, and simplify it if possible.
    Answer

    F = Σm(0, 3) = AB + AB. It cannot be reduced: it is the XNOR.

  4. Write the canonical product of sums of F(A, B, C) = Σm(1, 2, 3, 4, 5, 6, 7).
    Answer

    It is 0 only in row 0, so F = ΠM(0) = A + B + C. A single three-input OR.