Guide

THE TOOLBOX / SCHOOL & DIGITAL LOGIC

K-Map Solver —
Interactive Karnaugh Map, SOP/POS & Truth Table.

Click cells on a 2-, 3-, or 4-variable Gray-code Karnaugh Map (0, 1, or Don’t Care X) to compute exact minimal Sum-of-Products (SOP) and Product-of-Sums (POS) Boolean expressions instantaneously.

Presets:
Minimal Sum of Products (SOP)
F = B'C' + CD' + A'B
Σm(0, 1, 2, 5, 6, 7, 8, 9, 10, 14) + d(4, 15)
Minimal Product of Sums (POS)
F = (B + C' + D') · (A' + B' + C)
ΠM(3, 11, 12, 13) · d(4, 15)

Interactive Karnaugh Map (Click cell: 0 → 1 → X)

AB \ CD00011110
00
01
11
10
SOP Prime Implicant Groups (3)
B'C' (m0, m1, m8, m9)CD' (m2, m6, m10, m14)A'B (m5, m6, m7, m4)

Synced Truth Table (16 rows)

mABCDF (Click)
000001
100011
200101
300110
40100X
501011
601101
701111
810001
910011
1010101
1110110
1211000
1311010
1411101
151111X

KARNAUGH MAP GUIDE

Rules for grouping K-Map cells and minimizing digital logic circuits.

1. Power-of-Two Group Sizes Only

Every valid K-Map rectangle must contain 1, 2, 4, 8, or 16 adjacent cells. Larger groups eliminate more variables: a group of 2 cancels 1 variable, a group of 4 cancels 2 variables, and a group of 8 cancels 3 variables.

2. Edge Wrap-Around & Corners

A Karnaugh map behaves like a torus: the top and bottom rows are adjacent, the left and right columns are adjacent, and all four corner cells (m0, m2, m8, m10) form a single 4-cell group (B'D').

3. Leveraging Don't Care (X) States

In BCD decoders or state machines where certain binary inputs never occur, setting those cells to X lets the minimizer absorb them into larger groups without forcing extra terms to cover them.

K-Map Group Size vs. Variables Eliminated (4-Variable Map)

Group Size (Cells)Variables EliminatedLiterals Remaining in TermExample Term
1 cell04 literalsA'BC'D
2 cells13 literalsA'BD
4 cells22 literalsBD
8 cells31 literalA
16 cells4Constant 11

Frequently Asked Questions

How does this K-Map solver minimize Boolean expressions?

It runs the exact Quine-McCluskey prime implicant algorithm on your 2-, 3-, or 4-variable Karnaugh map, finds all essential prime implicants, and outputs both the minimal Sum of Products (SOP) and minimal Product of Sums (POS) forms.

How do I enter Don’t Care (X) conditions on the Karnaugh map?

Click any cell on the K-Map or any row in the synced Truth Table to cycle through 0 → 1 → X. Don’t Care cells are automatically grouped with 1s (for SOP) or 0s (for POS) whenever doing so creates a larger power-of-2 implicant and simplifies the logic gate count.

Why are K-Map headers ordered 00, 01, 11, 10 instead of binary order?

Karnaugh maps use Gray code (00, 01, 11, 10) so that every horizontally or vertically adjacent cell—including wrap-around edges—differs by exactly one bit, allowing adjacent 1s to cancel a variable.

When should I use SOP (Sum of Products) vs. POS (Product of Sums)?

SOP groups the 1-minterms and maps directly to AND-OR (or NAND-NAND) gate networks. POS groups the 0-maxterms and maps directly to OR-AND (or NOR-NOR) networks—pick whichever produces fewer literals and gates.

Can I solve classic digital-logic homework problems like a 7-Segment BCD decoder?

Yes. Click the "4-Var 7-Segment a (BCD)" preset to see how marking invalid BCD inputs (10–15) as Don’t Care (X) dramatically reduces the minimized Boolean circuit.

Does this K-Map solver run offline?

Yes. All Quine-McCluskey minimization and truth-table updates execute instantaneously in your browser.