Discrete MathematicsBoolean Algebra and Logic Circuits3 of 3
Boolean Algebra and Logic Circuits · 3

Simplifying Circuits with Boolean Identities and Karnaugh Maps

Reading a Sum of Products expression straight off a truth table gives us a circuit that works, but we want to shrink that circuit so it uses as few logic gates as possible.

1

Simplifying Circuits with Boolean Identities

For a three-judge voting circuit where the light turns on whenever at least two of the three switches A,B,CA, B, C are on, the four winning rows of the truth table give the Sum of Products:

Light\displaystyle \text{Light} =AˉBC+ABˉC+ABCˉ+ABC\displaystyle = \bar{A}BC + A\bar{B}C + AB\bar{C} + ABC

We want to find a smaller expression that produces the exact same output with fewer gates.

Simplifying Circuits with Boolean Identities
AA
BB
CC
1\htmlClass{lc-green}{1}
0\htmlClass{lc-mute}{0}

In Boolean algebra, we write AND as multiplication, OR as addition (++), and NOT as an overbar (Aˉ\bar{A}), turning the laws of logical equivalence into algebraic rules for canceling redundant variables:

Distributive:A(B+C)=AB+ACA+BC=(A+B)(A+C)Complement:A+Aˉ=1A⋅Aˉ=0Identity:A⋅1=AA+0=ADomination:A+1=1A⋅0=0Double Negation:Aˉˉ=A\displaystyle \begin{aligned} \text{Distributive:} \\ A(B + C) &= AB + AC \\ A + BC &= (A + B)(A + C) \\[8pt] \text{Complement:} \\ \flips{A + \bar{A}} &= 1 \\ A \cdot \bar{A} &= 0 \\[8pt] \text{Identity:} \\ A \cdot 1 &= A \\ A + 0 &= A \\[8pt] \text{Domination:} \\ A + 1 &= 1 \\ A \cdot 0 &= 0 \\[8pt] \text{Double Negation:} \\ \bar{\bar{A}} &= A \end{aligned}
Text solution
Factor out the shared variablesIn the last two terms of the voting circuit, A\groupthree{A} and B\groupthree{B} stay fixed while C\flips{C} flips between Cˉ\flips{\bar{C}} and C\flips{C}.
ABCˉ+ABC\displaystyle \groupthree{AB}\flips{\bar{C}} + \groupthree{AB}\flips{C} =AB(Cˉ+C)\displaystyle = \groupthree{AB}(\flips{\bar{C} + C})
Cancel the flipping variableBecause Cˉ+C\flips{\bar{C} + C} is always 11, switch C\flips{C} drops out of the term completely.
AB(Cˉ+C)=AB(1)=AB\displaystyle \begin{aligned} \groupthree{AB}(\flips{\bar{C} + C}) &= \groupthree{AB}(1) \\ &= \groupthree{AB} \end{aligned}

So those two three-input AND gates collapse into a single two-input AND gate AB\groupthree{AB} that doesn't need switch CC wired into it at all.

2

Three Algebraic Simplification Moves

In our voting circuit, AˉBC\flips{\bar{A}}\groupone{BC} and ABˉC\grouptwo{A}\flips{\bar{B}}\grouptwo{C} also differ from ABCABC by just one variable, and in other circuits we often run into extra variables attached to a smaller term or long NOT bars covering a whole group:

AˉB+C‾+BˉC\displaystyle \overline{\bar{A}B + C} + \bar{B}C

We need three algebraic moves to finish simplifying the voting circuit and break apart expressions under long NOT bars.

Three Algebraic Simplification Moves
AˉBC+ABˉC+ABCˉ+ABC=?A+AB=?A+AˉB=?AˉB+C‾+BˉC=?\displaystyle \footnotesize\begin{aligned} \bar{A}BC + A\bar{B}C + AB\bar{C} + ABC &= {?} \\ A + AB &= {?} \\ A + \bar{A}B &= {?} \\ \overline{\bar{A}B + C} + \bar{B}C &= {?} \end{aligned}

These three rules let us reuse terms, absorb redundant conditions, and break open long NOT bars ("break the line, change the sign"):

Idempotent(Cloning):A=A+AA=A⋅AAbsorption:A+AB=AA+AˉB=A+BDe Morgan’sLaws:A⋅B‾=Aˉ+BˉA+B‾=Aˉ⋅Bˉ\displaystyle \begin{aligned} \text{Idempotent} && & \\ \text{(Cloning):} && A &= A + A \\ && A &= A \cdot A \\[8pt] \text{Absorption:} && A + \redundant{AB} &= A \\ && A + \redundant{\bar{A}}B &= A + B \\[8pt] \text{De Morgan's} && & \\ \text{Laws:} && \overline{A \cdot B} &= \bar{A} + \bar{B} \\ && \overline{A + B} &= \bar{A} \cdot \bar{B} \end{aligned}

First, here is how cloning ABCABC finishes the three-judge voting circuit:

Text solution
Clone the shared termBecause ABCABC differs by one variable from each of the other three terms, we duplicate ABCABC twice using X=X+X+XX = X + X + X so every term gets a partner.
AˉBC+ABˉC+ABCˉ+ABC=(AˉBC+ABC)+(ABˉC+ABC)+(ABCˉ+ABC)\displaystyle \begin{aligned} &\flips{\bar{A}}\groupone{BC} + \grouptwo{A}\flips{\bar{B}}\grouptwo{C} + \groupthree{AB}\flips{\bar{C}} + ABC \\ &= (\flips{\bar{A}}\groupone{BC} + \flips{A}\groupone{BC}) \\ &\quad + (\grouptwo{A}\flips{\bar{B}}\grouptwo{C} + \grouptwo{A}\flips{B}\grouptwo{C}) \\ &\quad + (\groupthree{AB}\flips{\bar{C}} + \groupthree{AB}\flips{C}) \end{aligned}
Factor and cancel each flipping variablePulling out the two constant variables in each pair leaves a complement sum that equals 11.
(AˉBC+ABC)+(ABˉC+ABC)+(ABCˉ+ABC)=BC(Aˉ+A)+AC(Bˉ+B)+AB(Cˉ+C)=BC(1)+AC(1)+AB(1)=BC+AC+AB\displaystyle \begin{aligned} &(\flips{\bar{A}}\groupone{BC} + \flips{A}\groupone{BC}) \\ &\quad + (\grouptwo{A}\flips{\bar{B}}\grouptwo{C} + \grouptwo{A}\flips{B}\grouptwo{C}) \\ &\quad + (\groupthree{AB}\flips{\bar{C}} + \groupthree{AB}\flips{C}) \\ &= \groupone{BC}(\flips{\bar{A} + A}) \\ &\quad + \grouptwo{AC}(\flips{\bar{B} + B}) \\ &\quad + \groupthree{AB}(\flips{\bar{C} + C}) \\ &= \groupone{BC}(1) + \grouptwo{AC}(1) + \groupthree{AB}(1) \\ &= \groupone{BC} + \grouptwo{AC} + \groupthree{AB} \end{aligned}

So the voting circuit simplifies to BC+AC+AB\groupone{BC} + \grouptwo{AC} + \groupthree{AB}, which uses no NOT gates and only two-input AND gates.

Now for the expression with a long NOT bar, AˉB+C‾+BˉC\overline{\bar{A}B + C} + \bar{B}C:

Text solution
Break the longest NOT barSplitting the top bar across the ++ sign turns the OR into an AND between the two pieces.
AˉB+C‾+BˉC\displaystyle \overline{\bar{A}B + C} + \bar{B}C =AˉB‾⋅Cˉ+BˉC\displaystyle = \overline{\bar{A}B} \cdot \bar{C} + \bar{B}C
Break the inner NOT bar and cancel the double barSplitting the remaining bar over AˉB\bar{A}B flips the multiplication into addition, and Aˉˉ\bar{\bar{A}} becomes AA.
AˉB‾⋅Cˉ+BˉC=(Aˉˉ+Bˉ)Cˉ+BˉC=(A+Bˉ)Cˉ+BˉC\displaystyle \begin{aligned} \overline{\bar{A}B} \cdot \bar{C} + \bar{B}C &= (\bar{\bar{A}} + \bar{B})\bar{C} + \bar{B}C \\ &= (A + \bar{B})\bar{C} + \bar{B}C \end{aligned}
Distribute and factor out the variable that doesn't matterMultiplying out Cˉ\bar{C} puts the expression in Sum of Products form, where C\flips{C} flips between the two Bˉ\groupone{\bar{B}} terms and drops out.
(A+Bˉ)Cˉ+BˉC=ACˉ+BˉCˉ+BˉC=ACˉ+Bˉ(Cˉ+C)=ACˉ+Bˉ\displaystyle \begin{aligned} &(A + \bar{B})\bar{C} + \bar{B}C \\ &= A\bar{C} + \groupone{\bar{B}}\flips{\bar{C}} + \groupone{\bar{B}}\flips{C} \\ &= A\bar{C} + \groupone{\bar{B}}(\flips{\bar{C} + C}) \\ &= A\bar{C} + \groupone{\bar{B}} \end{aligned}

So the circuit reduces to ACˉ+BˉA\bar{C} + \groupone{\bar{B}}.

3

Building a Karnaugh Map

When a Sum of Products has many terms, hunting by eye for pairs that differ in one variable gets messy. A Karnaugh map (or K-map) is a truth table redrawn as a 2D grid in Gray code order (00,01,11,1000, 01, 11, 10) so that combinations differing by a single variable always sit in adjacent boxes.

Building a Karnaugh Map
AˉBC\bar{A}BC
ABCABC
011\mathclap{0}\hspace{0.77em}\mathclap{1}\hspace{0.77em}\mathclap{1}
111\mathclap{1}\hspace{0.77em}\mathclap{1}\hspace{0.77em}\mathclap{1}
AA
BB
CC
Light\text{Light}
Row 4\htmlClass{lc-mute}{\text{Row } 4}
011\mathclap{0}\hspace{1.26em}\mathclap{1}\hspace{1.26em}\mathclap{1}
1\htmlClass{lc-green}{1}
Row 5\htmlClass{lc-mute}{\text{Row } 5}
100\mathclap{1}\hspace{1.26em}\mathclap{0}\hspace{1.26em}\mathclap{0}
0\htmlClass{lc-mute}{0}
Row 6\htmlClass{lc-mute}{\text{Row } 6}
101\mathclap{1}\hspace{1.26em}\mathclap{0}\hspace{1.26em}\mathclap{1}
1\htmlClass{lc-green}{1}
Row 7\htmlClass{lc-mute}{\text{Row } 7}
110\mathclap{1}\hspace{1.26em}\mathclap{1}\hspace{1.26em}\mathclap{0}
1\htmlClass{lc-green}{1}
Row 8\htmlClass{lc-mute}{\text{Row } 8}
111\mathclap{1}\hspace{1.26em}\mathclap{1}\hspace{1.26em}\mathclap{1}
1\htmlClass{lc-green}{1}
AA
BCBC
0000
0101
1111
1010
00
11
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
BC\htmlClass{lc-blue}{BC}
AC\htmlClass{lc-pink}{AC}
AB\htmlClass{lc-violet}{AB}
Text solution
Plot each 1\outone{1} from the truth tableEach three-variable term fills the single box matching its (A,BC)(A, BC) coordinates: (0,11)(0, 11), (1,01)(1, 01), (1,10)(1, 10), and (1,11)(1, 11).
AˉBC+ABˉC+ABCˉ+ABC⟶1s at (0,11), (1,01), (1,10), (1,11)\displaystyle \begin{aligned} &\bar{A}BC + A\bar{B}C + AB\bar{C} + ABC \\ &\quad \longrightarrow \text{1s at } (0, 11),\ (1, 01), \\ &\qquad\qquad\qquad\ (1, 10),\ (1, 11) \end{aligned}
Circle neighboring pairs and drop the variable that flipsOverlapping our bubbles on (1,11)(1, 11) (the visual version of cloning ABCABC) gives one vertical pair and two horizontal pairs.
Vertical pair (0,11) and (1,11):A flips (0→1)  ⟹  BCHorizontal pair (1,01) and (1,11):B flips (0→1)  ⟹  ACHorizontal pair (1,11) and (1,10):C flips (1→0)  ⟹  AB\displaystyle \begin{aligned} &\text{Vertical pair } (0, 11) \text{ and } (1, 11): \\ &\qquad \flips{A} \text{ flips } (0 \to 1) \implies \groupone{BC} \\[6pt] &\text{Horizontal pair } (1, 01) \text{ and } (1, 11): \\ &\qquad \flips{B} \text{ flips } (0 \to 1) \implies \grouptwo{AC} \\[6pt] &\text{Horizontal pair } (1, 11) \text{ and } (1, 10): \\ &\qquad \flips{C} \text{ flips } (1 \to 0) \implies \groupthree{AB} \end{aligned}
Combine the groups with ORAdding the simplified terms from each bubble gives the minimal Sum of Products.
Light\displaystyle \text{Light} =BC+AC+AB\displaystyle = \groupone{BC} + \grouptwo{AC} + \groupthree{AB}

Stepping to any neighboring box on the Gray-code grid, including wrapping around from the far-right column 1010 to the far-left column 0000, flips only a single bit, even when those two combinations sit several rows apart in the truth table.

Every step to a neighboring box on a Karnaugh map, even across the outer edges, flips just one bit and can pair up rows that sit far apart in the truth table.
4

Missing Variables and Groups of Four

Instead of starting from a truth table, we might be handed a Sum of Products where some terms are already missing a variable:

ABˉ+AˉC+ABC\displaystyle A\bar{B} + \bar{A}C + ABC

We want to plot these shorter terms onto a three-variable K-map and simplify the whole expression at once.

Missing Variables and Groups of Four
ABˉ+AˉC+ABCA\bar{B} + \bar{A}C + ABC
AA
BCBC
0000
0101
1111
1010
00
11
AA
BCBC
0000
0101
1111
1010
00
11
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
C\htmlClass{lc-blue}{C}
ABˉ\htmlClass{lc-pink}{A\bar{B}}
Text solution
Plot each term across all boxes where its variables matchA term missing a variable turns on whether that variable is 00 or 11, so it fills two boxes on a three-variable map.
ABC⟶(1,11)ABˉ (missing C)⟶(1,00)and (1,01)AˉC (missing B)⟶(0,01)and (0,11)\displaystyle \begin{aligned} ABC &\longrightarrow (1, 11) \\ A\bar{B} \text{ (missing } \flips{C}\text{)} &\longrightarrow (1, 00) \\ &\qquad \text{and } (1, 01) \\ \bar{A}C \text{ (missing } \flips{B}\text{)} &\longrightarrow (0, 01) \\ &\qquad \text{and } (0, 11) \end{aligned}
Group the 2×22 \times 2 block of four and the remaining pairAcross the four cells in columns 0101 and 1111, both A\flips{A} and B\flips{B} flip while C\groupone{C} stays 11; across the pair at (1,00)(1, 00) and (1,01)(1, 01), C\flips{C} flips while A=1\grouptwo{A} = 1 and B=0\grouptwo{B} = 0 stay fixed.
ABˉ+AˉC+ABC\displaystyle A\bar{B} + \bar{A}C + ABC =ABˉ+C\displaystyle = \grouptwo{A\bar{B}} + \groupone{C}

So the three-term expression simplifies to ABˉ+C\grouptwo{A\bar{B}} + \groupone{C}.

5

Four-Variable Maps and Avoiding Redundant Groups

With four variables A,B,C,DA, B, C, D, we use a 4×44 \times 4 grid where both the rows (ABAB) and columns (CDCD) follow Gray code (00,01,11,1000, 01, 11, 10). We want to spot groups that wrap across opposite edges and corners, while avoiding extra bubbles that add unnecessary gates.

Four-Variable Maps and Avoiding Redundant Groups
ABAB
CDCD
0000
0101
1111
1010
0000
0101
1111
1010
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
ABAB
CDCD
0000
0101
1111
1010
0000
0101
1111
1010
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
BˉDˉ\htmlClass{lc-pink}{\bar{B}\bar{D}}
BD\htmlClass{lc-blue}{BD}
ABAB
CDCD
0000
0101
1111
1010
0000
0101
1111
1010
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
AˉCˉD\htmlClass{lc-blue}{\bar{A}\bar{C}D}
BC\htmlClass{lc-pink}{BC}
redundant\text{redundant}

Here are the steps for the second map, with 1\outone{1}s at (00,01)(00, 01), (01,01)(01, 01), (01,11)(01, 11), (01,10)(01, 10), (11,11)(11, 11), and (11,10)(11, 10):

Text solution
Group the lonely 1\outone{1} at (00,01)(00, 01) firstBecause (00,01)(00, 01) has only one neighboring 1\outone{1} on the entire map, it must pair vertically with (01,01)(01, 01), where B\flips{B} flips and drops out.
Pair (00,01),(01,01)⟶AˉCˉD\displaystyle \text{Pair } (00, 01), (01, 01) \longrightarrow \groupone{\bar{A}\bar{C}D}
Group the lonely 1\outone{1}s on the right edge into the largest possible blockThe 1\outone{1}s at (01,10)(01, 10) and (11,10)(11, 10) belong to a single 2×22 \times 2 square across rows 01,1101, 11 and columns 11,1011, 10, where A\flips{A} and D\flips{D} both flip.
Block (01,11),(01,10),(11,11),(11,10)⟶BC\displaystyle \begin{aligned} \text{Block } & (01, 11), (01, 10), \\ & (11, 11), (11, 10) \longrightarrow \grouptwo{BC} \end{aligned}
Stop once every 1\outone{1} is coveredBoth cells of the middle pair (01,01)(01, 01) and (01,11)(01, 11) are already inside our two groups, so we leave that pair uncircled and add our two required terms.
Output\displaystyle \text{Output} =AˉCˉD+BC\displaystyle = \groupone{\bar{A}\bar{C}D} + \grouptwo{BC}

So the minimal circuit needs only two AND gates, AˉCˉD+BC\groupone{\bar{A}\bar{C}D} + \grouptwo{BC}, rather than three.

On a 4×44 \times 4 map, doubling a rectangular loop, whether it sits in the center, wraps across opposite edges, or links all four corners, flips one additional variable between 00 and 11 and removes it from the product term.

Every time you double a loop on the map, one more variable flips and drops out, even when the loop wraps around the edges or corners.
6

Don't Care Conditions

In hardware like a single-digit keypad (00000000 to 10011001), some binary inputs (10101010 to 11111111) never happen. A Don't Care cell, marked XX on the K-map, represents an impossible input whose output we can freely choose to be 11 or 00 to make our bubbles as large as possible.

Don't Care Conditions
ABAB
CDCD
0000
0101
1111
1010
0000
0101
1111
1010
0\htmlClass{lc-mute}{0}
1\htmlClass{lc-mute}{1}
3\htmlClass{lc-mute}{3}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
5\htmlClass{lc-mute}{5}
7\htmlClass{lc-mute}{7}
6\htmlClass{lc-mute}{6}
12\htmlClass{lc-mute}{12}
13\htmlClass{lc-mute}{13}
15\htmlClass{lc-mute}{15}
14\htmlClass{lc-mute}{14}
8\htmlClass{lc-mute}{8}
9\htmlClass{lc-mute}{9}
11\htmlClass{lc-mute}{11}
10\htmlClass{lc-mute}{10}
11
22
33
44
55
66
77
88
99
00
0→00000 \to 0000
9→10019 \to 1001
A different circuit, not the keypad\text{A different circuit, not the keypad}
ABAB
CDCD
0000
0101
1111
1010
0000
0101
1111
1010
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
X\htmlClass{lc-green}{X}
X\htmlClass{lc-green}{X}
X\htmlClass{lc-mute}{X}
CD\htmlClass{lc-pink}{CD}
BD\htmlClass{lc-blue}{BD}
Text solution
Expand the group for (11,01)(11, 01) using a neighboring XXTreating the XX at (01,01)(01, 01) as a 1\outone{1} turns the horizontal pair (11,01),(11,11)(11, 01), (11, 11) into the center 2×22 \times 2 block of four, eliminating both A\flips{A} and C\flips{C}.
Block (01,01),(01,11),(11,01),(11,11)⟶BD\displaystyle \begin{aligned} \text{Block } & (01, 01), (01, 11), \\ & (11, 01), (11, 11) \longrightarrow \groupone{BD} \end{aligned}
Expand the group for (00,11)(00, 11) using the bottom XXTreating the XX at (10,11)(10, 11) as a 1\outone{1} completes all four cells of column 1111, eliminating both row variables A\flips{A} and B\flips{B}.
Column (00,11),(01,11),(11,11),(10,11)⟶CD\displaystyle \begin{aligned} \text{Column } & (00, 11), (01, 11), \\ & (11, 11), (10, 11) \longrightarrow \grouptwo{CD} \end{aligned}
Ignore any leftover XX's once all 1\outone{1}s are coveredEvery 1\outone{1} is now inside a group, so we treat the remaining XX at (10,00)(10, 00) as 00 and write the sum of our two groups.
Output\displaystyle \text{Output} =BD+CD\displaystyle = \groupone{BD} + \grouptwo{CD}

So the XX's shrink the expression all the way to BD+CD\groupone{BD} + \grouptwo{CD}.

Stretching a bubble over a neighboring XX eliminates a variable and shrinks that bubble's AND gate, whereas adding a bubble over already-covered 1\outone{1}s or an unneeded XX adds an extra AND gate to the circuit without covering any new 1\outone{1}.

Stretching a bubble over an XX to cover a 1\outone{1} in a larger group shrinks an AND gate, while circling already-covered 1\outone{1}s or an unneeded XX just adds an extra gate.

Key concepts

Every simplification, whether by algebra or by K-map, comes down to spotting when a variable flips between 00 and 11 without changing the output.

When an expression has only two or three terms that already share factors, simplify it directly with Boolean algebra rather than drawing a map: factor out shared variables to cancel a flipping bit (ABCˉ+ABC=AB(Cˉ+C)=AB\groupthree{AB}\flips{\bar{C}} + \groupthree{AB}\flips{C} = \groupthree{AB}(\flips{\bar{C} + C}) = \groupthree{AB}), clone a term if more than one neighbor needs it (A=A+AA = A + A), and use absorption to drop redundant checks (A+AB=AA + \redundant{AB} = A, and A+AˉB=A+BA + \redundant{\bar{A}}B = A + B). If a long NOT bar stretches across a group, you must break it with De Morgan's Laws before its pieces can combine with anything outside the bar: break the longest bar first and flip the operator underneath (A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B} and A+B‾=Aˉ⋅Bˉ\overline{A + B} = \bar{A} \cdot \bar{B}), such as AˉB+C‾=AˉB‾⋅Cˉ=(A+Bˉ)Cˉ\overline{\bar{A}B + C} = \overline{\bar{A}B} \cdot \bar{C} = (A + \bar{B})\bar{C}.

Once an expression is a Sum of Products with several terms (or comes from a truth table), switch to a K-map. Label the rows and columns in Gray code (00,01,11,1000, 01, 11, 10) so adjacent cells, including opposite edges and all four corners, always differ in a single variable. A term missing a variable fills every box where its remaining variables match (so ABˉA\bar{B} fills two boxes on a 3-variable map). To group the map cleanly, always cover the lonely 1\outone{1}s first using the largest possible power-of-two rectangles (1,2,4,81, 2, 4, 8), include Don't Care XX's only when they enlarge a group covering a needed 1\outone{1}, and stop the moment every 1\outone{1} is covered so you never add a redundant gate.

7

Practice

1

Use Boolean identities (factoring and absorption) to simplify ABˉC+ABC+ACˉ+AˉBA\bar{B}C + ABC + A\bar{C} + \bar{A}B to a minimal Sum of Products.

Look at the first two terms: which two variables stay the same while the third one flips?

Factor AC\groupone{AC} out of the first two terms so Bˉ+B=1\flips{\bar{B} + B} = 1 cancels B\flips{B}:
ABˉC+ABC+ACˉ+AˉB=AC(Bˉ+B)+ACˉ+AˉB=AC+ACˉ+AˉB\displaystyle \begin{aligned} &\groupone{A}\flips{\bar{B}}\groupone{C} + \groupone{A}\flips{B}\groupone{C} + A\bar{C} + \bar{A}B \\ &= \groupone{AC}(\flips{\bar{B} + B}) + A\bar{C} + \bar{A}B \\ &= \groupone{AC} + A\bar{C} + \bar{A}B \end{aligned}
Now factor A\grouptwo{A} out of the first two terms to cancel C\flips{C}:
AC+ACˉ+AˉB=A(C+Cˉ)+AˉB=A+AˉB\displaystyle \begin{aligned} \grouptwo{A}\flips{C} + \grouptwo{A}\flips{\bar{C}} + \bar{A}B &= \grouptwo{A}(\flips{C + \bar{C}}) + \bar{A}B \\ &= \grouptwo{A} + \bar{A}B \end{aligned}
Watch out for the two common slips here: don't stop at A+AˉBA + \bar{A}B thinking nothing else cancels, and don't confuse A+AˉBA + \bar{A}B with A+AB=AA + AB = A (which would wrongly drop BB and give just AA). By the second absorption rule, Aˉ\redundant{\bar{A}} is redundant:
A+AˉB=(A+Aˉ)(A+B)=A+B\displaystyle \begin{aligned} \grouptwo{A} + \redundant{\bar{A}}B &= (\flips{A + \bar{A}})(A + B) \\ &= A + B \end{aligned}
2

Break the NOT bars using De Morgan's Laws and simplify ACˉ+Bˉ‾+AˉBCˉ\overline{A\bar{C} + \bar{B}} + \bar{A}B\bar{C} to a minimal Sum of Products.

Break the longest bar across the ++ sign first, then break the remaining bar over ACˉA\bar{C}.

Break the longest bar across the ++ sign, flipping OR to AND and canceling the double bar on BB:
ACˉ+Bˉ‾+AˉBCˉ=(ACˉ)‾⋅Bˉˉ+AˉBCˉ=(ACˉ)‾⋅B+AˉBCˉ\displaystyle \begin{aligned} \overline{A\bar{C} + \bar{B}} + \bar{A}B\bar{C} &= \overline{(A\bar{C})} \cdot \bar{\bar{B}} + \bar{A}B\bar{C} \\ &= \overline{(A\bar{C})} \cdot B + \bar{A}B\bar{C} \end{aligned}
Break the remaining bar over ACˉA\bar{C}, flipping the multiplication into addition:
(ACˉ)‾⋅B+AˉBCˉ=(Aˉ+Cˉˉ)B+AˉBCˉ=(Aˉ+C)B+AˉBCˉ\displaystyle \begin{aligned} &\overline{(A\bar{C})} \cdot B + \bar{A}B\bar{C} \\ &= (\bar{A} + \bar{\bar{C}})B + \bar{A}B\bar{C} \\ &= (\bar{A} + C)B + \bar{A}B\bar{C} \end{aligned}
Be careful to keep parentheses around (Aˉ+C)(\bar{A} + C) when breaking the inner bar. Leaving them off writes Aˉ+CB+AˉBCˉ\bar{A} + CB + \bar{A}B\bar{C}, which simplifies to the wrong answer Aˉ+BC\bar{A} + BC. Distribute BB and absorb AˉBCˉ\groupone{\bar{A}B}\flips{\bar{C}} into AˉB\groupone{\bar{A}B}:
AˉB+BC+AˉBCˉ=AˉB(1+Cˉ)+BC=AˉB+BC\displaystyle \begin{aligned} &\groupone{\bar{A}B} + BC + \groupone{\bar{A}B}\flips{\bar{C}} \\ &= \groupone{\bar{A}B}(1 + \flips{\bar{C}}) + BC \\ &= \groupone{\bar{A}B} + BC \end{aligned}
3

Plot the Sum of Products expression AˉC+BCˉ+ABC\bar{A}C + B\bar{C} + ABC on a 3-variable Karnaugh map (with rows A=0,1A = 0, 1 and Gray-code columns BC=00,01,11,10BC = 00, 01, 11, 10) and simplify it.

Each two-variable term is missing one variable, so how many boxes does each one fill on the 8-box grid?

Plot each term in every cell where its variables match: AˉC\bar{A}C fills (0,01)(0, 01) and (0,11)(0, 11), BCˉB\bar{C} fills (0,10)(0, 10) and (1,10)(1, 10), and ABCABC fills (1,11)(1, 11). (Make sure the columns are in Gray code 00,01,11,1000, 01, 11, 10; in binary counting order 00,01,10,1100, 01, 10, 11, the 1\outone{1}s at (0,01)(0, 01) and (0,11)(0, 11) are no longer side by side, so it's easy to leave (0,01)(0, 01) on its own as AˉBˉC\bar{A}\bar{B}C and get the unsimplified answer B+AˉBˉCB + \bar{A}\bar{B}C.)
The four 1\outone{1}s in columns 1111 and 1010, at (0,11)(0, 11), (0,10)(0, 10), (1,11)(1, 11), and (1,10)(1, 10), form a 2×22 \times 2 block where A\flips{A} and C\flips{C} both flip, leaving B\groupone{B}. Pairing the remaining uncovered 1\outone{1} at (0,01)(0, 01) with (0,11)(0, 11) eliminates B\flips{B} and gives AˉC\grouptwo{\bar{A}C}:
B+AˉC\displaystyle \groupone{B} + \grouptwo{\bar{A}C}
4

On a 4-variable Karnaugh map with rows ABAB and columns CDCD (both in Gray code 00,01,11,1000, 01, 11, 10), the output is 11 at (00,00)(00, 00), (00,01)(00, 01), (00,10)(00, 10), (10,00)(10, 00), (10,01)(10, 01), and (10,10)(10, 10), and 00 everywhere else. Find the minimal Sum of Products.

Check how the top row 0000 and bottom row 1010, as well as the left column 0000 and right column 1010, wrap around to touch each other.

All six 11s sit in the top row 0000 and bottom row 1010, which wrap around vertically. Grouping the top-to-bottom 2×22 \times 2 block at (00,00)(00, 00), (00,01)(00, 01), (10,00)(10, 00), and (10,01)(10, 01) eliminates A\flips{A} and D\flips{D}, giving BˉCˉ\groupgreen{\bar{B}\bar{C}}.
To cover the remaining 11s at (00,10)(00, 10) and (10,10)(10, 10), don't just pair them vertically as BˉCDˉ\bar{B}C\bar{D} (which gives the incomplete simplification BˉCˉ+BˉCDˉ\bar{B}\bar{C} + \bar{B}C\bar{D}). Instead, wrap them across to the left edge to group all four corners (00,00)(00, 00), (00,10)(00, 10), (10,00)(10, 00), and (10,10)(10, 10) as a 2×22 \times 2 block, which eliminates A\flips{A} and C\flips{C} to give BˉDˉ\groupone{\bar{B}\bar{D}}:
BˉCˉ+BˉDˉ\displaystyle \groupgreen{\bar{B}\bar{C}} + \groupone{\bar{B}\bar{D}}
5

On a 4-variable Karnaugh map with rows ABAB and columns CDCD in Gray code, the output is 11 at (00,00)(00, 00), (00,01)(00, 01), (01,01)(01, 01), (01,11)(01, 11), (11,01)(11, 01), and (11,11)(11, 11), and 00 everywhere else. Circle the lonely 11s first to find the minimal Sum of Products without any redundant groups.

Start with the 11 at (00,00)(00, 00) and the 11 at (11,11)(11, 11): how many ways can each of those be grouped?

The lonely 11 at (00,00)(00, 00) only has one neighboring 11, (00,01)(00, 01), so that horizontal pair is required and gives AˉBˉCˉ\groupone{\bar{A}\bar{B}\bar{C}}.
The lonely 11s at (01,11)(01, 11), (11,01)(11, 01), and (11,11)(11, 11) can all be covered together by the center 2×22 \times 2 block with (01,01)(01, 01), which gives BD\groupgreen{BD}.
At this point, both (00,01)(00, 01) and (01,01)(01, 01) are already covered. Circling the vertical pair between them is a common slip that adds a redundant third term AˉCˉD\redundant{\bar{A}\bar{C}D} (giving AˉBˉCˉ+BD+AˉCˉD\groupone{\bar{A}\bar{B}\bar{C}} + \groupgreen{BD} + \redundant{\bar{A}\bar{C}D}). Stopping now leaves:
AˉBˉCˉ+BD\displaystyle \groupone{\bar{A}\bar{B}\bar{C}} + \groupgreen{BD}
6

On a 4-variable Karnaugh map with rows ABAB and columns CDCD in Gray code, the output is 11 at (00,10)(00, 10), (01,10)(01, 10), (11,10)(11, 10), (10,01)(10, 01), and (10,11)(10, 11), with Don't Care XX's at (00,01)(00, 01), (10,00)(10, 00), and (10,10)(10, 10), and 00 everywhere else. Find the minimal Sum of Products.

Look at column 1010 and row 1010: which XX's let you turn those 11s into full lines of four?

Treating the XX at (10,10)(10, 10) as a 1\outone{1} completes all four cells of column 1010, eliminating A\flips{A} and B\flips{B} to give CDˉ\groupone{C\bar{D}}.
Treating the XX's at (10,00)(10, 00) and (10,10)(10, 10) as 1\outone{1}s completes all four cells of row 1010, eliminating C\flips{C} and D\flips{D} to give ABˉ\grouptwo{A\bar{B}}.
All five 1\outone{1}s are now covered. Don't try to cover the leftover XX at (00,01)(00, 01) by wrapping it with (10,01)(10, 01) (which would add an extra gate BˉCˉD\redundant{\bar{B}\bar{C}D} to give ABˉ+CDˉ+BˉCˉD\grouptwo{A\bar{B}} + \groupone{C\bar{D}} + \redundant{\bar{B}\bar{C}D}); leave (00,01)(00, 01) uncircled:
ABˉ+CDˉ\displaystyle \grouptwo{A\bar{B}} + \groupone{C\bar{D}}