Making a truth table
Type an expression and the table appears, one row for every way to set the variables. Variables are in alphabetical order, the first one is the most significant bit, and rows count up in binary from all zeros, the order most textbooks use. F is the expression's value on that row.
Above the table you get the simplified form, the row numbers where F is 1 (minterms) and where it's 0 (maxterms), and the output column as one string of bits, handy for comparing two expressions: if the strings match, the expressions are equivalent.
Writing an expression
Type it the way your course writes it. AND can be ·, *, &, &&, ∧ or the word AND, or nothing at all, so AB and A(B + C) are ANDs. OR is +, |, ||, ∨ or OR. NOT is a ' after a term, as in A' or (A + B)', or !, ~, ¬ or NOT before it. XOR is ^, ⊕ or XOR, and NAND, NOR and XNOR work as words. Implication is ->, →, => or IMPLIES, and if-and-only-if is <->, ↔, ≡, == or IFF. A leading F = just names the output. 0 and 1 are constants.
Single letters are variables, so abc means a AND b AND c, and ABCDE is five variables. A name with a digit, mixed case or more than eight letters stays whole, so x1, Rain and sprinkler each count as one variable. A run of nine capitals, like ABCDEFGHI, is refused, since that would be one variable more than fits. Case counts, so a and A are two different variables. Up to eight variables fit, a table of 256 rows.
Checking whether two expressions are equal
Two expressions are equal when their truth tables match row for row. Type each in turn and compare the Truth table column rows. Or type (first) XNOR (second). If the expressions are equal, every row of that table is 1 and the working says it's a tautology. This is how you check De Morgan's law, for instance. (AB)' XNOR (A' + B') is always true.
How many rows
Each variable doubles the table. Two variables give 4 rows, three give 8, four give 16, and eight give 256. Past that, a table stops being a useful way to look at a function, which is why logic designers switch to maps and algebra.
Which operator goes first
NOT binds tightest, then AND, then XOR, then OR. So A + BC' means A OR (B AND (NOT C)). Brackets override it as usual. Implication comes after OR, and if-and-only-if is loosest of all. A -> B -> C is read from the right, as A -> (B -> C). NAND sits with AND and NOR with OR, and a chain of them is read left to right, which matters because NAND and NOR aren't associative: (A NAND B) NAND C isn't the same as A NAND (B NAND C). Bracket chains of them to be sure.
Questions
How do you make a truth table?
List every combination of the variables, counting up in binary, then work out the expression for each row. This generator does both from the expression you type.
How many rows does a truth table have?
2 to the power of the number of variables: 8 rows for three variables, 16 for four.
Can it do XOR and NAND?
Yes. Use ^ or the word XOR, and the words NAND, NOR and XNOR.
What's a tautology?
An expression that's true on every row, such as A + A'. Its opposite, false on every row, is a contradiction.
Sources
- Wikipedia: Quine–McCluskey algorithm
- Wikipedia: Karnaugh map
- Wikipedia: A Symbolic Analysis of Relay and Switching Circuits
- Wikipedia: The Laws of Thought
- George Boole, An Investigation of the Laws of Thought (1854), Project Gutenberg
- W. V. Quine, "The Problem of Simplifying Truth Functions", American Mathematical Monthly 59(8), 1952
- E. J. McCluskey, "Minimization of Boolean Functions", Bell System Technical Journal 35(6), November 1956
Added . Last updated and reviewed . What's new






