Boolean Function & Logic Gate Calculator
Evaluate boolean expressions, generate full truth tables, Karnaugh maps (K-Maps), minterms (SOP), and maxterms (POS).
Operators: & · * AND · | + OR · ^ XOR · ! ~ NOT · A' postfix NOT. Juxtaposition means AND, so AB = A & B.
Interactive testbench
| # | A | B | C | Output |
|---|---|---|---|---|
| m0 | 0 | 0 | 0 | 1 |
| m1 | 0 | 0 | 1 | 0 |
| m2 | 0 | 1 | 0 | 1 |
| m3 | 0 | 1 | 1 | 0 |
| m4 | 1 | 0 | 0 | 1 |
| m5 | 1 | 0 | 1 | 0 |
| m6 | 1 | 1 | 0 | 1 |
| m7 | 1 | 1 | 1 | 1 |
Boolean Function & Logic Gate Calculator: how it works
A truth table, a Karnaugh map and a minimal sum of products are three views of the same function. Getting from an expression to all three is mechanical once the parsing is right.
Operator precedence
Minterms and canonical forms
A minterm is a row of the truth table where the function outputs 1, written as a product in which each variable appears once, complemented where its value is 0. The canonical sum of products is the OR of all minterms.
Worked example · Majority function of three variables
Given
- F = AB + BC + AC
- Output is 1 when at least two inputs are 1
Working
- 1Truth table gives 1 at rows 3, 5, 6, 7
- 2Canonical SOP = A′BC + AB′C + ABC′ + ABC
- 3Minimised by Quine–McCluskey
Minimal SOP: AB + AC + BC — six literals rather than twelve
Quine–McCluskey minimisation
The algorithm combines minterms differing in exactly one bit, repeating until no further combination is possible. What remains are the prime implicants. Essential prime implicants are then selected, and Petrick’s method resolves any remaining cover.
Unlike Karnaugh maps, which rely on visual grouping and become impractical beyond four or five variables, Quine–McCluskey is systematic and works for any number of variables.
Karnaugh map ordering
K-map rows and columns follow Gray code — 00, 01, 11, 10 — rather than binary counting order. This ensures adjacent cells differ in exactly one variable, which is what makes visual grouping valid.
Frequently asked questions
More in Engineering & Construction
MS & SS Pipe Weight Calculator
Calculate steel pipe weight from dimensions, wall thickness, length and density. Compare round, square and rectangular sections in kilograms.
L Angle & C Channel Steel Weight Calculator
Compute weight of L-Angle bars, Equal/Unequal Angles, C-Channels (ISMC), and structural steel beams.
RCC Material & Ready Mix Concrete (RMC) Calculator
Estimate required bags of Cement, Sand (cft/tons), Aggregate (cft/tons), Water, and total cost for concrete slabs.
Epoxy Resin & Hardener Volume Calculator
Calculate required Epoxy Resin & Hardener in grams/ml based on mold dimensions and mix ratio (2:1, 3:1, 1:1).
Inverter Battery Backup Time Calculator
Calculate battery backup duration in hours and minutes based on load in Watts, Battery Ah, Voltage, and Efficiency.
SMD Resistor Code Calculator
Decode SMD resistor markings using 3-digit, 4-digit, EIA-96 and R notation. Enter codes such as 472, 103 or 01C to find resistance.