Build truth tables for Boolean expressions and logic gates, with exam-style columns.
Type a Boolean expression or pick a logic circuit and get its truth table.
This tool needs JavaScript.
A truth table gives the output of a Boolean expression or logic circuit for every combination of inputs. 1 means True and 0 means False. With n inputs there are 2ⁿ rows: two inputs need 4 rows and three need 8.
NOT reverses a value. AND is 1 only when both inputs are 1. OR is 1 when at least one is 1. XOR is 1 when the two inputs differ. Work out brackets first, then NOT, then AND, then OR. This tool puts XOR between AND and OR; in your own work, bracket it so the meaning is clear.
AQA GCSE draws AND as a D shape, OR as a shield shape with a pointed output, XOR as the OR shape with a second curve at the back, and NOT as a triangle with a small circle at its tip. It writes AND as a dot, OR as +, XOR as ⊕ and NOT as a bar over the term. Here, type AND as · or &, and NOT as NOT, ! or ¬: a full stop and an overbar are not accepted.
OCR GCSE (J277) lists AND, OR and NOT, and asks you to recognise each gate symbol. The SQA National 5 and Higher Computing Science course specifications don’t list logic gates or truth tables.
A half adder has sum = A XOR B and carry = A AND B. A full adder adds a carry in, C: sum is A XOR B XOR C, and carry out is 1 when at least two inputs are 1. Both are in the Example menu.
NOT C comes first, then B AND (NOT C), and OR last.
So Q is 1 if A is 1, or if B is 1 and C is 0.
Open this example, then set Intermediate columns to On
Count up in binary from all zeros to all ones, with the first input as the left-hand bit. This order makes a missing row easy to spot. If a question gives the rows, keep them.
Yes, by the usual convention: brackets first, then NOT, then AND, then OR. Add brackets whenever the order could be misread.
They differ only when both inputs are 1. OR then gives 1, and XOR gives 0.