Section 2 · 12 min read
Boolean algebra and minimization
Boolean laws, canonical forms, counting Boolean functions, Karnaugh maps, the Quine-McCluskey method and functional completeness, with GATE-style worked problems.
On this page
What GATE asks from this topic
Almost every GATE CS paper has one or two questions here. The common forms are: simplify an expression, find the minimal SOP or POS of a function given as a list of minterms (often with don't-cares), count prime implicants or essential prime implicants, check whether two expressions are equal, and count Boolean functions with some property. All of them reward a fast, careful K-map and a solid grip on a handful of laws.
Boolean algebra basics
A Boolean variable takes values 0 or 1. The operations are AND (), OR () and NOT (). Precedence: NOT, then AND, then OR.
Laws you must know cold
| Law | AND form | OR form |
|---|---|---|
| Identity | ||
| Null | ||
| Idempotent | ||
| Complement | ||
| Absorption | ||
| Redundant literal | ||
| Distributive | ||
| De Morgan | ||
| Consensus |
The second distributive law () has no counterpart in ordinary arithmetic, and it is the one students forget.
Consensus. In , the variable appears in true form in one term and complemented in the other. The consensus term is the product of the rest, . It is always redundant. The same idea in a K-map: is a group that straddles the two groups and and covers nothing new.
Duality
The dual of an expression swaps AND with OR and swaps 0 with 1, leaving literals alone. If an identity holds, its dual also holds. Do not confuse the dual with the complement: the complement also inverts every literal (De Morgan). For example, the dual of is , and the complement is .
A function is self-dual if , which is the same as . The majority function and are self-dual.
XOR identities
, and XNOR is its complement. Useful facts: XOR is associative and commutative, , , , and . A chain is 1 exactly when an odd number of inputs are 1.
Canonical forms
A minterm of variables is a product containing every variable once, true or complemented; it is 1 for exactly one input. A maxterm is a sum containing every variable once; it is 0 for exactly one input.
- Sum of minterms: lists the inputs where .
- Product of maxterms: lists the inputs where .
The two lists are complementary: for three variables. The complement is of the indices missing from .
Index convention: with variables , the minterm index is , so is the most significant bit. Always check which variable the question treats as the MSB.
Counting Boolean functions
These come up as 1-mark numerical questions. For variables there are input rows.
| Kind of function | Count |
|---|---|
| All functions | |
| Self-dual | (inputs pair up with their complements) |
| Symmetric (depends only on number of 1s) | |
| Neutral (equal number of 0s and 1s) | |
| Functions with |
The reasoning is always the same: identify which rows are forced to agree, count the free rows , answer .
Karnaugh maps
A K-map arranges the truth table so that cells next to each other differ in exactly one variable. Rows and columns follow Gray code order: 00, 01, 11, 10. The map wraps around: the left and right edges are adjacent, the top and bottom edges are adjacent, and in a 4-variable map the four corners form one group.
Groups and what they mean
A group must be a rectangle of cells, all 1 (or don't-care). A group of cells in an -variable map is a product term with literals. Bigger groups mean fewer literals.
- Implicant: any valid group (product term that implies ).
- Prime implicant (PI): a group that cannot be enlarged.
- Essential prime implicant (EPI): a PI that covers at least one 1-cell no other PI covers. Every minimal SOP contains every EPI.
Procedure for minimal SOP
- Plot the 1s and don't-cares.
- Find all prime implicants. Start with the largest possible groups.
- Mark the essential ones: look for 1-cells that sit in only one PI.
- Cover the remaining 1s with as few PIs as possible, and among equal counts, the fewest literals.
Don't-cares ( or ) can be included in a group when it helps make the group larger, and ignored otherwise. A PI that covers only don't-cares is never used. When counting prime implicants, GATE answers normally count PIs that cover at least one real 1; if a question is ambiguous, this is the reading to use.
Minimal POS
Group the 0s instead of the 1s. This gives a minimal SOP for . Apply De Morgan to get the POS for : each product term in becomes a sum term with every literal complemented. The literal count of the minimal POS equals the literal count of the minimal SOP of .
Cyclic maps
Some functions have no essential prime implicant at all: every 1-cell lies in exactly two PIs, arranged in a ring. on three variables is the standard example: six PIs, no EPIs, and two different minimal covers of three terms each. A question that asks "how many minimal SOP expressions" usually has a cyclic map underneath.
The Quine-McCluskey (tabular) method
This is the K-map process done as a table, and it works for any number of variables.
- Write each minterm (and don't-care) in binary. Group them by the number of 1s.
- Compare each term in group with each term in group . If they differ in exactly one bit, combine them, writing a dash in that bit, and tick both. Two terms with dashes can combine only if the dashes are in the same positions and exactly one other bit differs.
- Repeat on the new list until nothing combines. Unticked terms are the prime implicants.
- Build the prime implicant chart: rows are PIs, columns are the real minterms (not don't-cares). A column with a single mark gives an EPI.
- Remove EPIs and the columns they cover. Use row dominance, column dominance or Petrick's method on what is left.
The tabular method is slow by hand, so GATE tests it through its rules, for example which pairs of implicants can be merged.
Functional completeness
A set of operations is functionally complete if every Boolean function can be built from it. Quick tests:
- NAND alone and NOR alone are complete.
- and are complete (De Morgan gives the missing one).
- A set fails if all of its operations preserve 0 (output 0 on all-zero input), or all preserve 1, or all are monotone, or all are linear (XOR form), or all are self-dual. These are Post's five conditions. A set is complete exactly when it escapes all five.
For example preserves 0 and is not complete, but is, since . Implication with constant 0 is complete because and .
Worked examples
Worked example 1: Algebraic simplification
Simplify .
Solution. By the second distributive law, . Then .
Check one row: gives in the original and . Good.
Worked example 2: K-map with don't-cares
Find the minimal SOP and minimal POS of .
Solution. The map (rows , columns ):
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | 0 | 1 | 1 | 0 |
| 01 | 0 | 1 | 1 | X |
| 11 | X | X | 0 | 0 |
| 10 | 0 | 1 | 0 | 0 |
- covers 1, 3, 5, 7. It is the only PI covering 3 and 7, so it is essential.
- covers 1, 5, 9, 13 (13 is a don't-care). It is the only PI covering 9, so it is essential.
All 1s are covered. Minimal SOP: , 4 literals.
For the POS, group the 0s (using don't-cares where they help): the 0s are 0, 2, 4, 8, 10, 11, 14, 15. covers every even cell (0, 2, 4, 8, 10, 14, using don't-cares 6 and 12). covers 10, 11, 14, 15. So and , 3 literals. Here the POS is cheaper than the SOP, which happens often enough that GATE asks for both.
Note that the don't-cares were assigned differently for the SOP (13 treated as 1) and the POS (12 and 6 treated as 0). That is allowed: each minimal form uses the assignment that suits it, but the two forms may then disagree on don't-care inputs.
Worked example 3: Counting PIs and EPIs
For , find the number of prime implicants, the essential ones, and the minimal SOP.
Solution.
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | 1 | 1 | 0 | 1 |
| 01 | 0 | 1 | 1 | 1 |
| 11 | 0 | 0 | 0 | 1 |
| 10 | 1 | 1 | 0 | 1 |
Prime implicants:
| PI | Minterms |
|---|---|
| 0, 1, 8, 9 | |
| 0, 2, 8, 10 (four corners) | |
| 2, 6, 10, 14 | |
| 1, 5 | |
| 5, 7 | |
| 6, 7 |
That is 6 PIs. Minterm 9 is only in , and minterm 14 is only in , so these two are essential. Minterms 0, 2, 8, 10 also lie in , but they are already covered, so that PI is not needed.
After the EPIs, minterms 5 and 7 remain. The single PI covers both. Minimal SOP:
Answer: 6 PIs, 2 EPIs, 3 terms with 7 literals. Note that is a 4-cell prime implicant that is not in the minimal cover. Big does not mean necessary.
Worked example 4: Equality by consensus
Is ?
Solution. The consensus of and is . Since is redundant, so is anything it contains: , so is covered whenever it is 1 (if , then either making , or making ). The identity holds.
Worked example 5: Self-dual count with a constraint
How many self-dual functions satisfy ?
Solution. Inputs pair as (000,111), (001,110), (010,101), (011,100). Self-duality makes each pair carry complementary outputs, so there are 4 free bits. Fixing uses up the first pair's choice ( must be 1). Free bits left: 3. Answer: .
Common traps
- Forgetting that K-map edges wrap, especially the four corners in a 4-variable map.
- Writing K-map rows in binary order (00, 01, 10, 11) instead of Gray order. The groups then look wrong.
- Using a don't-care-only group in the final answer, or counting it as a needed term.
- Assuming the largest group is always in the minimal cover. Worked example 3 shows a 4-cell PI that is redundant.
- Mixing up the dual and the complement.
- Reading the minimal POS literal count off the SOP map. Group the 0s separately.
- Getting the MSB wrong when a question names variables in an unusual order, for example .
- In the tabular method, merging terms whose dashes are in different positions.
- Saying is complete. Without NOT (or a non-monotone gate) it is not.
Quick revision
- Key laws: ; ; consensus .
- Dual: swap AND/OR and 0/1. Complement: dual plus invert every literal.
- variables: functions, self-dual, symmetric.
- A -cell group in an -variable map has literals.
- PI: cannot grow. EPI: only PI covering some 1-cell. Minimal SOP = all EPIs plus the cheapest cover of the rest.
- Minimal POS: group the 0s, then De Morgan.
- Cyclic maps have zero EPIs and more than one minimal cover.
- Tabular method: combine terms differing in one bit with dashes aligned; unticked terms are PIs.
- Complete sets: {NAND}, {NOR}, {AND, NOT}, {OR, NOT}, {AND, XOR, 1}, {implication, 0}.