Read the map in Gray code order
Rows and columns differ by one bit at a time. That is why neighboring cells represent terms that differ in only one variable.
Digital Logic Revision Tool
This site is built for electronics engineering students who want to see why grouping works, how wrap-around adjacency behaves, and how a minimized SOP expression is formed from a 4-variable map.
Things to keep in mind
Core Rules
Rows and columns differ by one bit at a time. That is why neighboring cells represent terms that differ in only one variable.
Valid groups are single cells, pairs, quads, octets, or the full map. Rectangles can wrap across borders, but the area must stay a power of two.
A larger group removes more variables from the final term. Bigger groups give simpler expressions.
If a variable changes inside a group, it disappears from that term. If it stays constant, keep it in complemented or uncomplemented form.
Don't-cares are optional helpers. Include them only if they let you grow a pair into a quad, a quad into an octet, or remove an unnecessary literal.
Interactive Studio
4-Variable Karnaugh Map
Rows: AB in Gray order. Columns: CD in Gray order.
Worked Examples
Starter
The starter preset adapts to the selected input count so you can practice the first valid grouping on 2 to 6 variables.
Boundary
The boundary preset shows how the first and last Gray-code rows or columns still count as adjacent on larger maps.
Don't care
Adding a don't-care to a group can reduce the number of literals in the final answer. If it does not help, ignore it.
Exam-Day Checklist
Translate the minterms into the map using Gray code order. Keep don't-cares visible because they might expand a group later.
Look for 32-cell and 16-cell groups before octets, octets before quads, and quads before pairs. This avoids premature small groups.
A cell can belong to more than one group. Overlap is valid when it helps create larger prime implicants.
Keep only the variables that remain fixed inside that rectangle. Drop every variable that changes.
The final simplified SOP expression is the sum of every group term needed to cover all 1-cells.