Boolean Function & Logic Gate Calculator
Evaluates logic expressions and produces the truth table, K-map, SOP minterms and POS maxterms in one place.
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 K-map and a simplified sum of products are three views of the same function. Once the expression is read correctly, producing all three is mechanical.
Operator precedence
Minterms and canonical forms
A minterm is a truth-table row where the output is 1, written as an AND of every variable once, with a bar over any variable that is 0 in that row. OR-ing all the minterms gives the canonical sum of products.
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 method merges minterms that differ in exactly one bit, and keeps going until nothing more can be merged. The terms left are the prime implicants. The essential ones are picked first, and Petrick’s method settles the rest of the cover.
K-maps depend on spotting groups by eye and become unworkable past four or five variables. Quine–McCluskey is step-by-step and handles any number of variables.
Karnaugh map ordering
K-map rows and columns are ordered in Gray code (00, 01, 11, 10), not normal binary order. That way neighbouring cells differ in only one variable, which is what makes grouping them valid.
Frequently asked questions
More in Engineering & Construction
MS & SS Pipe Weight Calculator
Gives steel pipe and hollow section weight in kilograms using outer size, wall thickness, length and material density for round, square or rectangular shapes.
L Angle & C Channel Steel Weight Calculator
Finds kg per metre and total weight for equal and unequal angle bars, ISMC channels and other structural steel sections.
RCC Material & Ready Mix Concrete (RMC) Calculator
Works out cement bags, sand and aggregate in cft or tonnes, water and an approximate cost for an RCC slab or other concrete work.
Epoxy Resin & Hardener Volume Calculator
Turns mould dimensions and a 1:1, 2:1 or 3:1 mix ratio into the grams or millilitres of resin and hardener you should prepare.
Inverter Battery Backup Time Calculator
Shows backup in hours and minutes from your connected wattage, the battery’s Ah rating, system voltage and inverter efficiency.
SMD Resistor Code Calculator
Converts surface-mount resistor markings such as 103, 4R7 or 01C into ohms, supporting three-digit, four-digit, EIA-96 and decimal-point R codes.