Boolean Expression Solver
truth table with step-by-step sub-expression columns
split logic for simpler circuits 🖖
A useful hardware trick: pick the input variable that best separates TRUE/FALSE behavior, implement each branch separately, then multiplex through that input. That's exactly what the information-gain split below computes: it finds the variable whose value reduces uncertainty about the output the most - the same idea decision trees use to choose their first split.
one row for every possibility 🖖
A truth table is simply an exhaustive list: it writes out every possible combination of TRUE/FALSE inputs and shows what the expression does for each. With n variables there are 2ⁿ rows, so each new input doubles the table — 3 variables give 8 rows, 5 give 32. The intermediate columns matter too: they build up each sub-expression in turn, so you can follow the logic one operator at a time instead of trusting the final answer.
32 rows, four billion functions 🖖
Here is the twist: the table for 5 variables has just 32 rows, yet the number of different expressions you can define over them is 2³² = 4,294,967,296. Every distinct way of filling the output column with 0s and 1s is its own Boolean function, and there are 2^(2ⁿ) of them in total. So this modest tool quietly explores a space of more than four billion possible logic circuits — one for each pattern the final column can take.
Example problems
- simple AND - AND: output is 1 only when both A and B are 1
- (A OR B) AND NOT C - 3 variables, 8 rows - shows how NOT inverts a whole branch
- 3-input majority - Majority vote: 1 when at least 2 of A, B, C are 1
- 2:1 multiplexer - Multiplexer: S=0 outputs A, S=1 outputs B
- tautology A | !A - Tautology: always true regardless of A
- contradiction A & !A - Contradiction: always false regardless of A
- De Morgan !(A & B) - De Morgan form: NOT(AND) equals OR of negations
- De Morgan !A | !B - Equivalent to !(A & B) by De Morgan law
- A & (B | C) - Distributive law left side
- (A & B) | (A & C) - Equivalent distributive expansion
- XOR expanded form - XOR expanded into minterms
- A AND A AND A AND A - Idempotent law: repeated AND of same variable simplifies to A
- absorption law - Absorption law: A OR (A AND B) simplifies to A
- consensus theorem - Consensus theorem example with redundant term elimination
- implication A -> B - Implication form: A -> B is equivalent to !A OR B
- 3-input parity - 3-input parity: true when odd number of inputs are 1