A little context. A clearer answer.
When this calculator is useful
The first expression is true whenever A is true, while the second additionally requires B to be true. Change “Boolean expression” from (A & B) | (A & !B) to A&B and keep the other inputs from the worked example. The value for “Required true rows” goes from 2 to 1. For a related calculation, try Bitwise calculator: AND, OR, XOR and shifts.
What to enter
| Input | What it means | Example value |
|---|---|---|
| Variables in order | Select the declared variables A, then B, C and D. A is the most significant bit of the row index. Unused declared variables still appear in the table. | 2 · A, B |
| Boolean expression | Enter constants 0 and 1, the declared variable letters, and explicit operators. Precedence, highest first: NOT (!, ~, NOT or postfix apostrophe), AND (&, *, AND), XOR (^, XOR), OR (|, +, OR). Parentheses override precedence. Letter case is ignored; implicit AB multiplication is not accepted. | (A & B) | (A & !B) |
| Don’t-care row indices | Optional row indices where either output is acceptable. Separate distinct indices with semicolons or whitespace; decimal integers only. These indices override the expression only for minimization. |
How the calculation works
- Parse the expression safely and evaluate it for every combination of the declared variables.
- Build canonical minterm and maxterm forms. Enumerate valid Boolean cubes and find a minimum cover of required 1 rows for SOP and required 0 rows for POS.
- Show each chosen group on the Gray-code Karnaugh map and verify both simplified forms against every row not marked X.
N = 2ⁿ; SOP = Σ(minterms); POS = Π(maxterms)A worked example
Our example: (A & B) | (A & !B) has required 1 rows 2 and 3. Both minimal SOP and POS equal A, with four truth-table rows and verified equivalence.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
1–4 variables named A–D in that order; at most 16 rows, 512 input characters and 32 nested parser levels. The exact cover minimizes term count first and literal count second, independently for SOP and POS. Equal-cost answers may exist. No timing, hazards, gate-cost or multi-output optimization. Don’t-care rows may differ between the two simplified forms.
Frequently asked questions
What does don’t-care mean?
It means the input combination is outside your required behavior. The simplifier may use it as 0 or 1; do not mark an ordinary valid case as don’t-care.
Is the result the fewest possible logic gates?
No. The optimization is exact for two-level term count, then literal count. Actual gate libraries, timing and shared subexpressions can favor a different circuit.
Why can SOP and POS differ on X rows?
Each form is minimized separately. Both must match all required rows but can choose different values on unspecified rows.