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,C are on, the four winning rows of the truth table give the Sum of Products:
Light=AˉBC+ABˉC+ABCˉ+ABC
We want to find a smaller expression that produces the exact same output with fewer gates.
Simplifying Circuits with Boolean Identities
In Boolean algebra, we write AND as multiplication, OR as addition (+), and NOT as an overbar (Aˉ), turning the laws of logical equivalence into algebraic rules for canceling redundant variables:
Factor out the shared variablesIn the last two terms of the voting circuit, A and B stay fixed while C flips between Cˉ and C.
ABCˉ+ABC=AB(Cˉ+C)
Cancel the flipping variableBecause Cˉ+C is always 1, switch C drops out of the term completely.
AB(Cˉ+C)=AB(1)=AB
So those two three-input AND gates collapse into a single two-input AND gate AB that doesn't need switch C wired into it at all.
2
Three Algebraic Simplification Moves
In our voting circuit, AˉBC and ABˉC also differ from ABC 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
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ˉ+ABCA+ABA+AˉBAˉB+C+BˉC=?=?=?=?
These three rules let us reuse terms, absorb redundant conditions, and break open long NOT bars ("break the line, change the sign"):
First, here is how cloning ABC finishes the three-judge voting circuit:
Text solution
Clone the shared termBecause ABC differs by one variable from each of the other three terms, we duplicate ABC twice using X=X+X+X so every term gets a partner.
So the voting circuit simplifies to BC+AC+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:
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=AˉB⋅Cˉ+BˉC
Break the inner NOT bar and cancel the double barSplitting the remaining bar over AˉB flips the multiplication into addition, and Aˉˉ becomes A.
AˉB⋅Cˉ+BˉC=(Aˉˉ+Bˉ)Cˉ+BˉC=(A+Bˉ)Cˉ+BˉC
Distribute and factor out the variable that doesn't matterMultiplying out Cˉ puts the expression in Sum of Products form, where C flips between the two Bˉ terms and drops out.
(A+Bˉ)Cˉ+BˉC=ACˉ+BˉCˉ+BˉC=ACˉ+Bˉ(Cˉ+C)=ACˉ+Bˉ
So the circuit reduces to ACˉ+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,10) so that combinations differing by a single variable always sit in adjacent boxes.
Building a Karnaugh Map
Text solution
Plot each 1 from the truth tableEach three-variable term fills the single box matching its (A,BC) coordinates: (0,11),(1,01),(1,10), and (1,11).
AˉBC+ABˉC+ABCˉ+ABC⟶1s at (0,11),(1,01),(1,10),(1,11)
Circle neighboring pairs and drop the variable that flipsOverlapping our bubbles on (1,11) (the visual version of cloning ABC) 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
Combine the groups with ORAdding the simplified terms from each bubble gives the minimal Sum of Products.
Light=BC+AC+AB
Stepping to any neighboring box on the Gray-code grid, including wrapping around from the far-right column 10 to the far-left column 00, 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
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
Text solution
Plot each term across all boxes where its variables matchA term missing a variable turns on whether that variable is 0 or 1, so it fills two boxes on a three-variable map.
Group the 2×2 block of four and the remaining pairAcross the four cells in columns 01 and 11, both A and B flip while C stays 1; across the pair at (1,00) and (1,01),C flips while A=1 and B=0 stay fixed.
ABˉ+AˉC+ABC=ABˉ+C
So the three-term expression simplifies to ABˉ+C.
5
Four-Variable Maps and Avoiding Redundant Groups
With four variables A,B,C,D, we use a 4×4 grid where both the rows (AB) and columns (CD) follow Gray code (00,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
Here are the steps for the second map, with 1s at (00,01),(01,01),(01,11),(01,10),(11,11), and (11,10):
Text solution
Group the lonely 1 at (00,01) firstBecause (00,01) has only one neighboring 1 on the entire map, it must pair vertically with (01,01), where B flips and drops out.
Pair (00,01),(01,01)⟶AˉCˉD
Group the lonely 1s on the right edge into the largest possible blockThe 1s at (01,10) and (11,10) belong to a single 2×2 square across rows 01,11 and columns 11,10, where A and D both flip.
Block (01,11),(01,10),(11,11),(11,10)⟶BC
Stop once every 1 is coveredBoth cells of the middle pair (01,01) and (01,11) are already inside our two groups, so we leave that pair uncircled and add our two required terms.
Output=AˉCˉD+BC
So the minimal circuit needs only two AND gates, AˉCˉD+BC, rather than three.
On a 4×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 0 and 1 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 (0000 to 1001), some binary inputs (1010 to 1111) never happen. A Don't Care cell, marked X on the K-map, represents an impossible input whose output we can freely choose to be 1 or 0 to make our bubbles as large as possible.
Don't Care Conditions
Text solution
Expand the group for (11,01) using a neighboring XTreating the X at (01,01) as a 1 turns the horizontal pair (11,01),(11,11) into the center 2×2 block of four, eliminating both A and C.
Block (01,01),(01,11),(11,01),(11,11)⟶BD
Expand the group for (00,11) using the bottom XTreating the X at (10,11) as a 1 completes all four cells of column 11, eliminating both row variables A and B.
Column (00,11),(01,11),(11,11),(10,11)⟶CD
Ignore any leftover X's once all 1s are coveredEvery 1 is now inside a group, so we treat the remaining X at (10,00) as 0 and write the sum of our two groups.
Output=BD+CD
So the X's shrink the expression all the way to BD+CD.
Stretching a bubble over a neighboring X eliminates a variable and shrinks that bubble's AND gate, whereas adding a bubble over already-covered 1s or an unneeded X adds an extra AND gate to the circuit without covering any new 1.
Stretching a bubble over an X to cover a 1 in a larger group shrinks an AND gate, while circling already-covered 1s or an unneeded X 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 0 and 1 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), clone a term if more than one neighbor needs it (A=A+A), and use absorption to drop redundant checks (A+AB=A, and A+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ˉ and A+B=Aˉ⋅Bˉ), such as AˉB+C=AˉB⋅Cˉ=(A+Bˉ)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,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ˉ fills two boxes on a 3-variable map). To group the map cleanly, always cover the lonely 1s first using the largest possible power-of-two rectangles (1,2,4,8), include Don't Care X's only when they enlarge a group covering a needed 1, and stop the moment every 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ˉ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 out of the first two terms so Bˉ+B=1 cancels B:
ABˉC+ABC+ACˉ+AˉB=AC(Bˉ+B)+ACˉ+AˉB=AC+ACˉ+AˉB
Now factor A out of the first two terms to cancel C:
AC+ACˉ+AˉB=A(C+Cˉ)+AˉB=A+AˉB
Watch out for the two common slips here: don't stop at A+AˉB thinking nothing else cancels, and don't confuse A+AˉB with A+AB=A (which would wrongly drop B and give just A). By the second absorption rule, Aˉ is redundant:
A+AˉB=(A+Aˉ)(A+B)=A+B
2
Break the NOT bars using De Morgan's Laws and simplify ACˉ+Bˉ+AˉBCˉ to a minimal Sum of Products.
Break the longest bar across the + sign first, then break the remaining bar over ACˉ.
Break the longest bar across the + sign, flipping OR to AND and canceling the double bar on B:
ACˉ+Bˉ+AˉBCˉ=(ACˉ)⋅Bˉˉ+AˉBCˉ=(ACˉ)⋅B+AˉBCˉ
Break the remaining bar over ACˉ, flipping the multiplication into addition:
(ACˉ)⋅B+AˉBCˉ=(Aˉ+Cˉˉ)B+AˉBCˉ=(Aˉ+C)B+AˉBCˉ
Be careful to keep parentheses around (Aˉ+C) when breaking the inner bar. Leaving them off writes Aˉ+CB+AˉBCˉ, which simplifies to the wrong answer Aˉ+BC. Distribute B and absorb AˉBCˉ into AˉB:
AˉB+BC+AˉBCˉ=AˉB(1+Cˉ)+BC=AˉB+BC
3
Plot the Sum of Products expression AˉC+BCˉ+ABC on a 3-variable Karnaugh map (with rows A=0,1 and Gray-code columns BC=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 fills (0,01) and (0,11),BCˉ fills (0,10) and (1,10), and ABC fills (1,11). (Make sure the columns are in Gray code 00,01,11,10; in binary counting order 00,01,10,11, the 1s at (0,01) and (0,11) are no longer side by side, so it's easy to leave (0,01) on its own as AˉBˉC and get the unsimplified answer B+AˉBˉC.)
The four 1s in columns 11 and 10, at (0,11),(0,10),(1,11), and (1,10), form a 2×2 block where A and C both flip, leaving B. Pairing the remaining uncovered 1 at (0,01) with (0,11) eliminates B and gives AˉC:
B+AˉC
4
On a 4-variable Karnaugh map with rows AB and columns CD (both in Gray code 00,01,11,10), the output is 1 at (00,00),(00,01),(00,10),(10,00),(10,01), and (10,10), and 0 everywhere else. Find the minimal Sum of Products.
Check how the top row 00 and bottom row 10, as well as the left column 00 and right column 10, wrap around to touch each other.
All six 1s sit in the top row 00 and bottom row 10, which wrap around vertically. Grouping the top-to-bottom 2×2 block at (00,00),(00,01),(10,00), and (10,01) eliminates A and D, giving BˉCˉ.
To cover the remaining 1s at (00,10) and (10,10), don't just pair them vertically as BˉCDˉ (which gives the incomplete simplification BˉCˉ+BˉCDˉ). Instead, wrap them across to the left edge to group all four corners (00,00),(00,10),(10,00), and (10,10) as a 2×2 block, which eliminates A and C to give BˉDˉ:
BˉCˉ+BˉDˉ
5
On a 4-variable Karnaugh map with rows AB and columns CD in Gray code, the output is 1 at (00,00),(00,01),(01,01),(01,11),(11,01), and (11,11), and 0 everywhere else. Circle the lonely 1s first to find the minimal Sum of Products without any redundant groups.
Start with the 1 at (00,00) and the 1 at (11,11): how many ways can each of those be grouped?
The lonely 1 at (00,00) only has one neighboring 1,(00,01), so that horizontal pair is required and gives AˉBˉCˉ.
The lonely 1s at (01,11),(11,01), and (11,11) can all be covered together by the center 2×2 block with (01,01), which gives BD.
At this point, both (00,01) and (01,01) are already covered. Circling the vertical pair between them is a common slip that adds a redundant third term AˉCˉD (giving AˉBˉCˉ+BD+AˉCˉD). Stopping now leaves:
AˉBˉCˉ+BD
6
On a 4-variable Karnaugh map with rows AB and columns CD in Gray code, the output is 1 at (00,10),(01,10),(11,10),(10,01), and (10,11), with Don't Care X's at (00,01),(10,00), and (10,10), and 0 everywhere else. Find the minimal Sum of Products.
Look at column 10 and row 10: which X's let you turn those 1s into full lines of four?
Treating the X at (10,10) as a 1 completes all four cells of column 10, eliminating A and B to give CDˉ.
Treating the X's at (10,00) and (10,10) as 1s completes all four cells of row 10, eliminating C and D to give ABˉ.
All five 1s are now covered. Don't try to cover the leftover X at (00,01) by wrapping it with (10,01) (which would add an extra gate BˉCˉD to give ABˉ+CDˉ+BˉCˉD); leave (00,01) uncircled: