Online Tools » Computers » Truth tables | en sv |
A Boolean expression is an expression consisting of variables and truth values (true and false) connected with various logical operators. The basic operators are and, or and not (negation), from which all other operators can be derived.
There are many different ways to write the same expression. The following table lists all the symbols that the tool recognizes and shows for what purpose they are used. If an expression contains a word that is not listed it will instead be treated as a variable.
True: | T, 1, true | |
False: | F, 0, false | |
Negation: | ¬, !, ~, -, not | ′, ' |
And: | ∧, ·, *, &&, &, and | |
Or: | ∨, +, ||, |, or | |
Exclusive or: | ⊕, !=, ^, xor | |
Equivalence: | ⇔, <=>, ==, = | |
Implication: | ⇒, => |
A truth table shows the evaluation of a Boolean expression for all the combinations of possible truth values that the variables of the expression can have. Truth tables often makes it easier to understand the Boolean expressions and can be of great help when simplifying expressions. It can also be used to compare two different expressions by showing them side-by-side in the same table.
The not operator is used to negate an expression. This means that true becomes false, and false becomes true.
a | ¬a | |
T | F | |
F | T |
The and operator is a binary operator that results in true if both operands are true. If one or both of the operands are false the result is false.
a | b | a ∧ b | |
T | T | T | |
T | F | F | |
F | T | F | |
F | F | F |
The result of the or operator is true if at least one of the operands are true. The result is only false if both operands are false.
a | b | a ∨ b | |
T | T | T | |
T | F | T | |
F | T | T | |
F | F | F |
Exclusive or is similar to the or operator with the only difference being that the result is false if both operands are true. Another way to think about it is that the result is true if the two operands have different values, otherwise the result is false.
a | b | a ⊕ b | (a ∧ ¬b) ∨ (¬a ∧ b) | |
T | T | F | F | |
T | F | T | T | |
F | T | T | T | |
F | F | F | F |
Two expressions are equivalent if they result in the same truth value.
a | b | a ⇔ b | (a ∧ b) ∨ (¬a ∧ ¬b) | |
T | T | T | T | |
T | F | F | F | |
F | T | F | F | |
F | F | T | T |
An implication is false if the first operand is true while the second operand is false. The implication is true in all other cases.
a | b | a ⇒ b | ¬a ∨ b | |
T | T | T | T | |
T | F | F | F | |
F | T | T | T | |
F | F | T | T |