Generate truth tables instantly — with GCSE/A-Level explanations.
A truth table is a mathematical table used to determine if a compound statement is true or false based on the truth values of its component statements. In digital logic, truth tables show how logic gates respond to different input combinations.
Each row represents one possible combination of input values, and the final column shows the output. For n variables, there are 2^n possible combinations.
Example: AND Gate Truth Table
A | B | A ∧ B |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Boolean expressions use variables (A, B, C...) and operators. You can use either words or symbols:
Operator Precedence:
Use parentheses to override precedence: A ∧ (B ∨ C)
∧
A | B | Out |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
∨
A | B | Out |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
¬
A | Out |
---|---|
0 | 1 |
1 | 0 |
⊼
A | B | Out |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
⊽
A | B | Out |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
⊕
A | B | Out |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
⊙
A | B | Out |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Let's break down the expression A · (B + C̅) step by step:
Step 1: Identify variables
Variables: A, B, C (3 variables = 8 rows)
Step 2: Evaluate C̅ (NOT C)
C̅ means NOT C - when C=0, C̅=1; when C=1, C̅=0
Step 3: Evaluate (B + C̅)
OR operation between B and C̅
Step 4: Evaluate A · (B + C̅)
AND operation between A and the result from step 3
Result: The expression equals 1 when A=1 AND (B=1 OR C=0)
Boolean logic and truth tables are core topics in GCSE and A-Level Computer Science:
Exam Tip:
Always show your working when creating truth tables. Examiners want to see your thought process, not just the final answer.
What is the truth table for A AND B?
Simplify the expression: A + A·B
What are the minterms for the expression A ⊕ B?
Get help with boolean logic and other Computer Science topics from our AI tutor.
Try the Computer Science Genie