2-Variable Karnaugh Maps
The smallest possible Karnaugh map, a 2x2 grid, worked end to end and tied back to the algebra that justifies it.
Two variables means four minterms, so the smallest Karnaugh map is a 2x2 grid, one bit assigned to the rows and one to the columns. There is no room yet for a multi-digit Gray code sequence, since each axis is simply 0 then 1. But the map already has the shape every larger map will share.
Worked Example: F = A + B
Below is the map for F(A, B) = A OR B. Three of the four cells hold a 1. Click a 1, click another adjacent 1, then press Check group once you think you have found a legal pair, which has to be a rectangular block sized 1, 2, or 4 cells here, since 2x2 is as big as this map gets.
No groups yet.
3 cells to cover. Bigger groups mean fewer literals, so always take the largest legal group you can.
Reading the Groups
Two groups of size 2 cover every 1 in the map. There is the pair where B stays 1 while A changes, giving the term B, and the pair where A stays 1 while B changes, giving the term A.
The cell where A = 1 and B = 1 belongs to both groups, and that overlap is completely legal here. The goal is to cover every 1 with the fewest, largest groups, not to partition the map into disjoint pieces.
Why This Is the Same Algebra as Before
Each group of 2 cells is doing exactly what the identity from the previous tutorial does: AB' + AB = A(B' + B) = A. Grouping visually and factoring algebraically are the same operation, and the grid just makes it obvious which minterms happen to differ in one variable.
A'B + AB = B(A' + A) = B
AB' + AB = A(B' + B) = AOR the surviving terms together and you get F = A + B back out, the exact function you started with, derived visually instead of algebraically. For a function this small that is not a huge win by itself, but the same procedure keeps working as the variable count climbs.
A 2x2 grid is too small to ever need to wrap around an edge. Every cell already touches every other cell along at least one side. That changes at three variables.
A second example: when nothing simplifies
Not every function gets smaller. This map has two 1s sitting diagonally, which means they are not adjacent, since diagonal cells differ in two variables, not one.
F = A'B + AB'
2 ones, covered by 2 groups. This grouping is the only minimal one.
The answer is A'B + AB', which is exactly the sum of minterms you started with. No pair can be formed, so no variable can be eliminated.
This is exclusive-or, and its resistance to simplification is the reason XOR gets its own gate symbol instead of being built from AND and OR every time it appears.