Truth Table & K-Map Solver
Built for Computer Science and digital logic students. Type any Boolean expression to get its truth table, minterms, maxterms and the simplest SOP and POS form, or draw a Karnaugh map yourself and let Calvo find the best groups.
1. Truth table generator
2. Are two expressions equal?
Check identities such as De Morgan’s laws or verify that your simplified answer matches the original.
3. K-map solver (minterms, maxterms & don’t-cares)
Tap a cell to cycle 0 → 1 → X (X = don’t care), or type the lists below. Small numbers in each cell are the minterm numbers.
Operators you can type
| Operation | You can type | Meaning |
|---|---|---|
| NOT | A' !A ~A NOT A | complement (inverts the value) |
| AND | AB A.B A&B A*B A AND B | 1 only when both inputs are 1 |
| OR | A+B A|B A OR B | 1 when at least one input is 1 |
| XOR | A^B A⊕B A XOR B | 1 when the inputs are different |
| NAND / NOR / XNOR | A NAND B A NOR B A XNOR B | the NOT of AND / OR / XOR |
| Implication | A -> B A → B | 0 only when A = 1 and B = 0 |
| Equivalence | A <-> B A == B | 1 when A and B are equal |
Order of evaluation: NOT first, then AND, XOR, OR, implication and finally equivalence. Use brackets when in doubt. Calvo shows how it read your expression, so you can confirm the precedence. Write multi-letter operators with spaces (A OR B), otherwise letters stuck together are read as separate variables (AB means A AND B).
How a truth table works
A Boolean function with n inputs has 2n input combinations. The truth table lists them in binary counting order (000, 001, 010 …) with the first variable as the most significant bit. The row number read in decimal is the minterm number. A minterm is a row where the output is 1 (written Σm), and a maxterm is a row where the output is 0 (written ΠM).
How to simplify with a K-map
- Cells are ordered in Gray code (00, 01, 11, 10), so neighbouring cells differ in exactly one variable.
- Group adjacent 1s in rectangles of size 1, 2, 4, 8 or 16. Never group a number that is not a power of 2.
- Make every group as large as possible and use as few groups as possible. Groups may overlap.
- The map wraps around: the left and right edges touch, and so do the top and bottom edges.
- Don’t-cares (X) may be included in a group if that makes it bigger, but you never have to cover them.
- In each group, keep the variables that do not change. A variable that is 1 throughout appears as A, one that is 0 throughout appears as A′. Add the group terms with OR to get the SOP.
- For POS, group the 0s instead. Each group gives a sum term where the unchanging variables are complemented, and the terms are ANDed together.
Worked example 1
Simplify F = A′B + AB′ + AB. The truth table gives F = 1 for AB = 01, 10 and 11, so F = Σm(1, 2, 3). On the 2-variable map, the two 1s in the column B = 1 form one group (B), and the two 1s in the row A = 1 form another (A). So F = A + B.
Worked example 2 (with don’t-cares)
F(A, B, C, D) = Σm(4, 8, 10, 11, 12, 15) + d(9, 14). Press Load example in tool 3 to see the groups:
- m4 and m12 form a pair where B = 1, C = 0, D = 0, giving BC′D′.
- m8, m9, m10, m11 form a group of 4 (using the don’t-care m9) where A = 1, B = 0, giving AB′.
- m10, m11, m14, m15 form a group of 4 (using the don’t-care m14) where A = 1, C = 1, giving AC.
Result: F = BC′D′ + AB′ + AC.
Useful Boolean identities
| Law | Identity |
|---|---|
| De Morgan | (AB)′ = A′ + B′ (A + B)′ = A′B′ |
| Complement | A + A′ = 1 AA′ = 0 |
| Identity / Null | A + 0 = A A · 1 = A A + 1 = 1 A · 0 = 0 |
| Idempotent | A + A = A AA = A |
| Double negation | (A′)′ = A |
| Absorption | A + AB = A A(A + B) = A |
| Distributive | A(B + C) = AB + AC A + BC = (A + B)(A + C) |
| Consensus | AB + A′C + BC = AB + A′C |
| XOR | A ⊕ B = A′B + AB′ |
FAQ
What is a truth table?
A truth table lists every possible combination of input values (0 and 1) for a Boolean expression and shows the output for each combination. With n variables the table has 2^n rows.
How many variables does the truth table generator support?
Calvo supports 1 to 6 variables, which means up to 64 rows. K-maps are drawn for 2 to 6 variables: 2, 3 and 4 variables use a single map, while 5 and 6 variables use two or four 4-variable maps side by side.
What is the difference between SOP and POS?
Sum of Products (SOP) is an OR of AND terms and comes from grouping the 1s of the function. Product of Sums (POS) is an AND of OR terms and comes from grouping the 0s. Both forms describe the same function; Calvo shows the minimal version of each.
What are don't-care conditions in a K-map?
A don't-care (X) is an input combination that never occurs or whose output does not matter. In a K-map an X can be treated as 1 or as 0, whichever lets you make a bigger group, which gives a simpler expression.
Which symbols can I type in the expression box?
AND: AB, A.B, A&B, A*B or A AND B. OR: A+B, A|B or A OR B. NOT: A', !A, ~A or NOT A. XOR: A^B or A XOR B. Also NAND, NOR, XNOR, implication (->) and equivalence (<->). Brackets can be (), [] or {}.