So far we went from an expression to its table. Circuit design needs the opposite: we know what output we want for each input (the table), and we need an expression — and hence a circuit — that produces it. Two standard recipes always work.
Intuition
DNF is like writing a guest list: “let in person A, or person B, or person C”. Each guest is described exactly (“tall and wearing red and not wearing a hat”). CNF is like writing a list of forbidden cases: “the door is open unless it is case P, and unless it is case Q”. Use whichever list is shorter.
Definition 3.13 · Minterm and DNF
A minterm in x 1 , … , x n x_1, \dots, x_n x 1 , … , x n is an AND of n n n literals, one for each variable, e.g. x 1 ∧ x 2 ′ ∧ x 3 x_1 \land x_2' \land x_3 x 1 ∧ x 2 ′ ∧ x 3 ; it equals 1 for exactly one input. An expression is in disjunctive normal form (DNF, sum of products) if it is an OR of minterms.
Recipe (DNF):
Find every row where f = 1 f = 1 f = 1 .
For each such row, write the AND of all variables, putting ′ ' ′ on each variable whose value in that row is 0 .
Join these minterms with OR.
Definition 3.14 · Maxterm and CNF
A maxterm is an OR of n n n literals, one for each variable, e.g. x 1 ′ ∨ x 2 ∨ x 3 ′ x_1' \lor x_2 \lor x_3' x 1 ′ ∨ x 2 ∨ x 3 ′ ; it equals 0 for exactly one input. An expression is in conjunctive normal form (CNF, product of sums) if it is an AND of maxterms.
Recipe (CNF):
Find every row where f = 0 f = 0 f = 0 .
For each such row, write the OR of all variables, putting ′ ' ′ on each variable whose value in that row is 1 (so that the maxterm is 0 exactly in that row).
Join these maxterms with AND.
DNF CNF Built from rows where f = 1 f = 1 f = 1 f = 0 f = 0 f = 0 Each term AND of literals (minterm) OR of literals (maxterm) Complement a variable when its value is 0 1 Terms joined by OR AND Shorter when few 1s few 0s
Example 3.15 DNF and CNF of the same function
Goal. Find a DNF and a CNF for f f f with f ( 0 , 0 ) = 1 f(0,0) = 1 f ( 0 , 0 ) = 1 , f ( 0 , 1 ) = 1 f(0,1) = 1 f ( 0 , 1 ) = 1 , f ( 1 , 0 ) = 0 f(1,0) = 0 f ( 1 , 0 ) = 0 , f ( 1 , 1 ) = 1 f(1,1) = 1 f ( 1 , 1 ) = 1 (Example 10 and E13).
Step. DNF, rows with f = 1 f = 1 f = 1 : ( 0 , 0 ) → x 1 ′ ∧ x 2 ′ (0,0) \to x_1' \land x_2' ( 0 , 0 ) → x 1 ′ ∧ x 2 ′ ; ( 0 , 1 ) → x 1 ′ ∧ x 2 (0,1) \to x_1' \land x_2 ( 0 , 1 ) → x 1 ′ ∧ x 2 ; ( 1 , 1 ) → x 1 ∧ x 2 (1,1) \to x_1 \land x_2 ( 1 , 1 ) → x 1 ∧ x 2 .
Step. DNF = ( x 1 ′ ∧ x 2 ′ ) ∨ ( x 1 ′ ∧ x 2 ) ∨ ( x 1 ∧ x 2 ) = (x_1' \land x_2') \lor (x_1' \land x_2) \lor (x_1 \land x_2) = ( x 1 ′ ∧ x 2 ′ ) ∨ ( x 1 ′ ∧ x 2 ) ∨ ( x 1 ∧ x 2 ) .
Step. CNF, the only row with f = 0 f = 0 f = 0 is ( 1 , 0 ) (1, 0) ( 1 , 0 ) : complement x 1 x_1 x 1 (its value is 1), keep x 2 x_2 x 2 (its value is 0): maxterm x 1 ′ ∨ x 2 x_1' \lor x_2 x 1 ′ ∨ x 2 .
Step. Check the CNF: x 1 ′ ∨ x 2 x_1' \lor x_2 x 1 ′ ∨ x 2 is 0 only when x 1 = 1 x_1 = 1 x 1 = 1 and x 2 = 0 x_2 = 0 x 2 = 0 — exactly the 0-row of f f f .
Result. DNF = ( x 1 ′ ∧ x 2 ′ ) ∨ ( x 1 ′ ∧ x 2 ) ∨ ( x 1 ∧ x 2 ) = (x_1' \land x_2') \lor (x_1' \land x_2) \lor (x_1 \land x_2) = ( x 1 ′ ∧ x 2 ′ ) ∨ ( x 1 ′ ∧ x 2 ) ∨ ( x 1 ∧ x 2 ) , CNF = x 1 ′ ∨ x 2 = x_1' \lor x_2 = x 1 ′ ∨ x 2 (i.e. x 1 → x 2 x_1 \to x_2 x 1 → x 2 ). Here the CNF is much shorter because f f f has only one 0.
Correction · Rule for complementing variables in CNF (answer to E13)
Study material says: The answer to E13 (§3.6) builds the CNF by “applying ‘not’ to x i x_i x i if its value is 0 in the row”, and gets x 1 ∨ x 2 x_1 \lor x_2 x 1 ∨ x 2 for the function of Example 10.
Correct version: In a maxterm, complement a variable when its value in the 0-row is 1 . For the 0-row ( 1 , 0 ) (1, 0) ( 1 , 0 ) this gives x 1 ′ ∨ x 2 x_1' \lor x_2 x 1 ′ ∨ x 2 , so the CNF of f f f is x 1 ′ ∨ x 2 x_1' \lor x_2 x 1 ′ ∨ x 2 .
Why: x 1 ∨ x 2 x_1 \lor x_2 x 1 ∨ x 2 is 0 at ( 0 , 0 ) (0, 0) ( 0 , 0 ) , but f ( 0 , 0 ) = 1 f(0, 0) = 1 f ( 0 , 0 ) = 1 , so x 1 ∨ x 2 x_1 \lor x_2 x 1 ∨ x 2 does not represent f f f . x 1 ′ ∨ x 2 x_1' \lor x_2 x 1 ′ ∨ x 2 is 0 only at ( 1 , 0 ) (1, 0) ( 1 , 0 ) , which matches f f f on all four inputs. (The answer to E14(b) uses the correct rule.)
Correction · Wrong operator in the DNF answer to E14(a)
Study material says: The answer to E14(a) gives ( x 1 ∧ x 2 ∧ x 3 ) ∧ ( x 1 ∧ x 2 ′ ∧ x 3 ′ ) ∨ ( x 1 ′ ∧ x 2 ′ ∧ x 3 ′ ) (x_1 \land x_2 \land x_3) \land (x_1 \land x_2' \land x_3') \lor (x_1' \land x_2' \land x_3') ( x 1 ∧ x 2 ∧ x 3 ) ∧ ( x 1 ∧ x 2 ′ ∧ x 3 ′ ) ∨ ( x 1 ′ ∧ x 2 ′ ∧ x 3 ′ ) .
Correct version: ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ′ ∧ x 3 ′ ) ∨ ( x 1 ′ ∧ x 2 ′ ∧ x 3 ′ ) (x_1 \land x_2 \land x_3) \lor (x_1 \land x_2' \land x_3') \lor (x_1' \land x_2' \land x_3') ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ′ ∧ x 3 ′ ) ∨ ( x 1 ′ ∧ x 2 ′ ∧ x 3 ′ ) — the minterms of a DNF are joined by ∨ \lor ∨ .
Why: ( x 1 ∧ x 2 ∧ x 3 ) ∧ ( x 1 ∧ x 2 ′ ∧ x 3 ′ ) (x_1 \land x_2 \land x_3) \land (x_1 \land x_2' \land x_3') ( x 1 ∧ x 2 ∧ x 3 ) ∧ ( x 1 ∧ x 2 ′ ∧ x 3 ′ ) contains both x 2 x_2 x 2 and x 2 ′ x_2' x 2 ′ , so it is always 0; the printed expression would give 0 at input ( 1 , 1 , 1 ) (1,1,1) ( 1 , 1 , 1 ) , where f = 1 f = 1 f = 1 .
Note
DNF and CNF are rarely the smallest circuits. Engineers minimise them further with Karnaugh maps or software (Rosen, Section 12.4); that is beyond this course.
Common mistake
Using the DNF rule for CNF. In DNF you complement the variables that are 0 in the row; in CNF you complement the variables that are 1. Check your maxterm: it must be 0 in its row.
Common mistake
Joining the terms with the wrong operator. DNF = OR of ANDs; CNF = AND of ORs. Mixing them changes the function.
Key idea
Every Boolean function has a DNF (OR of one minterm per 1-row) and a CNF (AND of one maxterm per 0-row). Choose DNF when there are few 1s and CNF when there are few 0s.
TEE Exam note
“Find the Boolean expression for the function given by the table” — say which form you choose and why, list the chosen rows, write each term, join them, and check one row. E12: substituting all four inputs into the DNF of Example 10 gives 1, 0, 1, 1 for ( 0 , 0 ) , ( 1 , 0 ) , ( 0 , 1 ) , ( 1 , 1 ) (0,0), (1,0), (0,1), (1,1) ( 0 , 0 ) , ( 1 , 0 ) , ( 0 , 1 ) , ( 1 , 1 ) , matching f f f . E13: CNF x 1 ′ ∨ x 2 x_1' \lor x_2 x 1 ′ ∨ x 2 . E14(a): f f f has three 1s → DNF ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ′ ∧ x 3 ′ ) ∨ ( x 1 ′ ∧ x 2 ′ ∧ x 3 ′ ) (x_1 \land x_2 \land x_3) \lor (x_1 \land x_2' \land x_3') \lor (x_1' \land x_2' \land x_3') ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ′ ∧ x 3 ′ ) ∨ ( x 1 ′ ∧ x 2 ′ ∧ x 3 ′ ) . E14(b): g g g has three 0s, at ( 1 , 0 , 1 ) (1,0,1) ( 1 , 0 , 1 ) , ( 0 , 1 , 1 ) (0,1,1) ( 0 , 1 , 1 ) , ( 0 , 1 , 0 ) (0,1,0) ( 0 , 1 , 0 ) → CNF ( x 1 ′ ∨ x 2 ∨ x 3 ′ ) ∧ ( x 1 ∨ x 2 ′ ∨ x 3 ′ ) ∧ ( x 1 ∨ x 2 ′ ∨ x 3 ) (x_1' \lor x_2 \lor x_3') \land (x_1 \lor x_2' \lor x_3') \land (x_1 \lor x_2' \lor x_3) ( x 1 ′ ∨ x 2 ∨ x 3 ′ ) ∧ ( x 1 ∨ x 2 ′ ∨ x 3 ′ ) ∧ ( x 1 ∨ x 2 ′ ∨ x 3 ) .
Key takeaways
DNF: one minterm per row with f = 1 f = 1 f = 1 ; complement the variables that are 0; join with OR.
CNF: one maxterm per row with f = 0 f = 0 f = 0 ; complement the variables that are 1; join with AND.
Every Boolean function has both forms, so every function can be built from AND, OR, NOT gates.
Pick the form with fewer terms, then simplify further with the laws.
Practice questions Answer on paper first, then check. The explanation matters more than the letter you chose.
Question 1 · multiple choice Which minterm corresponds to the row x 1 = 1 x_1 = 1 x 1 = 1 , x 2 = 0 x_2 = 0 x 2 = 0 , x 3 = 1 x_3 = 1 x 3 = 1 ?
Check answer
Show answer Answer: B. x 1 ∧ x 2 ′ ∧ x 3 x_1 \land x_2' \land x_3 x 1 ∧ x 2 ′ ∧ x 3
In a minterm, complement the variables that are 0 (x 2 x_2 x 2 ) and join with AND. Option 3 is the maxterm for the same row, which is used in CNF.
Question 2 · multiple choice Which maxterm is 0 exactly at the input ( x 1 , x 2 ) = ( 1 , 0 ) (x_1, x_2) = (1, 0) ( x 1 , x 2 ) = ( 1 , 0 ) ?
Check answer
Show answer Answer: C. x 1 ′ ∨ x 2 x_1' \lor x_2 x 1 ′ ∨ x 2
x 1 ′ ∨ x 2 x_1' \lor x_2 x 1 ′ ∨ x 2 at ( 1 , 0 ) (1, 0) ( 1 , 0 ) is 0 ∨ 0 = 0 0 \lor 0 = 0 0 ∨ 0 = 0 , and it is 1 at every other input. Option 1 is the study material’s E13 answer; it is 0 at ( 0 , 0 ) (0, 0) ( 0 , 0 ) instead.
Question 3 · multiple choice A function of 3 variables is 1 in seven rows and 0 in one row. Which form gives the shorter expression?
A DNF, with seven minterms B DNF, with one minterm C CNF, with seven maxterms D CNF, with one maxterm
Check answer
Show answer Answer: D. CNF, with one maxterm
CNF uses one maxterm per 0-row, so it has just one term. Option 1 is correct but much longer.
Question 4 · multiple choice f ( x 1 , x 2 ) f(x_1, x_2) f ( x 1 , x 2 ) is 1 only at ( 0 , 1 ) (0, 1) ( 0 , 1 ) and ( 1 , 0 ) (1, 0) ( 1 , 0 ) . What is its DNF?
Check answer
Show answer Answer: A. ( x 1 ′ ∧ x 2 ) ∨ ( x 1 ∧ x 2 ′ ) (x_1' \land x_2) \lor (x_1 \land x_2') ( x 1 ′ ∧ x 2 ) ∨ ( x 1 ∧ x 2 ′ )
One minterm per 1-row: ( 0 , 1 ) → x 1 ′ ∧ x 2 (0,1) \to x_1' \land x_2 ( 0 , 1 ) → x 1 ′ ∧ x 2 and ( 1 , 0 ) → x 1 ∧ x 2 ′ (1,0) \to x_1 \land x_2' ( 1 , 0 ) → x 1 ∧ x 2 ′ — this is XOR. Option 4 is also 1 at ( 1 , 1 ) (1, 1) ( 1 , 1 ) , where f = 0 f = 0 f = 0 .
Question 5 · multiple choice In a DNF, how are the minterms joined?
A With AND B With NOT C With OR D With XOR
Check answer
Show answer Answer: C. With OR
DNF is an OR (“disjunction”) of ANDs. Joining minterms with AND (as in the printed answer to E14(a)) gives 0 almost everywhere.
Question 6 · short answer
Find the CNF of the function g g g that is 0 exactly at ( x 1 , x 2 , x 3 ) = ( 1 , 0 , 1 ) (x_1, x_2, x_3) = (1, 0, 1) ( x 1 , x 2 , x 3 ) = ( 1 , 0 , 1 ) , ( 0 , 1 , 1 ) (0, 1, 1) ( 0 , 1 , 1 ) and ( 0 , 1 , 0 ) (0, 1, 0) ( 0 , 1 , 0 ) , and check one maxterm.
Show worked answer One maxterm per 0-row, complementing the variables that are 1: ( 1 , 0 , 1 ) → x 1 ′ ∨ x 2 ∨ x 3 ′ (1,0,1) \to x_1' \lor x_2 \lor x_3' ( 1 , 0 , 1 ) → x 1 ′ ∨ x 2 ∨ x 3 ′ ; ( 0 , 1 , 1 ) → x 1 ∨ x 2 ′ ∨ x 3 ′ (0,1,1) \to x_1 \lor x_2' \lor x_3' ( 0 , 1 , 1 ) → x 1 ∨ x 2 ′ ∨ x 3 ′ ; ( 0 , 1 , 0 ) → x 1 ∨ x 2 ′ ∨ x 3 (0,1,0) \to x_1 \lor x_2' \lor x_3 ( 0 , 1 , 0 ) → x 1 ∨ x 2 ′ ∨ x 3 . CNF: g = ( x 1 ′ ∨ x 2 ∨ x 3 ′ ) ∧ ( x 1 ∨ x 2 ′ ∨ x 3 ′ ) ∧ ( x 1 ∨ x 2 ′ ∨ x 3 ) g = (x_1' \lor x_2 \lor x_3') \land (x_1 \lor x_2' \lor x_3') \land (x_1 \lor x_2' \lor x_3) g = ( x 1 ′ ∨ x 2 ∨ x 3 ′ ) ∧ ( x 1 ∨ x 2 ′ ∨ x 3 ′ ) ∧ ( x 1 ∨ x 2 ′ ∨ x 3 ) . Check the first maxterm at ( 1 , 0 , 1 ) (1,0,1) ( 1 , 0 , 1 ) : 0 ∨ 0 ∨ 0 = 0 0 \lor 0 \lor 0 = 0 0 ∨ 0 ∨ 0 = 0 , and at any other input at least one literal is 1.