Truth Tables Class 11 Computer Science: Building and Reading Tables for Boolean Expressions
Updated 17 October 2026 · Fact-checked
A truth table lists every combination of input values of a Boolean expression and the resulting output. With n variables there are 2 to the power n rows. Evaluate in the order NOT, then AND, then OR, unless brackets change it; XOR is 1 only when its two inputs differ.
Work left to right: inputs, then B', then the AND columns, then OR them into F; the orange rows show F is 1 in four of eight rows.
Illustration drawn for QuestionBuddy.
Understand Truth Tables for Boolean Expressions with Two and Three Variables
Basics. A Boolean variable takes 0 or 1. The basic operations are:
- NOT (A'): reverses the value.
- AND (A.B): 1 only if both are 1.
- OR (A+B): 1 if at least one is 1.
- NAND: NOT of AND; NOR: NOT of OR.
- XOR (A xor B): 1 when the inputs differ, 0 when they are the same.
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
Number of rows. n variables give 2 to the power n rows: 2 variables 4 rows, 3 variables 8 rows. List the inputs in binary counting order (000, 001, 010, ...).
Order of evaluation. Brackets first, then NOT, then AND, then OR. So A + B.C means A + (B.C).
Building a table. (1) List all input rows. (2) Add a column for each NOT term. (3) Add columns for each AND term. (4) Combine with OR. Work column by column.
Example (three variables). F = A.B + B'.C. Rows ABC: 000, 001, 010, 011, 100, 101, 110, 111 give F = 0, 1, 0, 0, 0, 1, 1, 1. The output is 1 in four rows.
Equivalence. Two expressions are equal if their truth tables have the same output column for the same inputs. For instance A + A'.B and A + B have identical tables, which proves the identity.
Parity. The three-variable XOR (A xor B xor C) is 1 when an odd number of inputs are 1; it is 1 in four of the eight rows.
Truth Tables for Boolean Expressions with Two and Three Variables: key facts
- Rows
- n variables
- 2 to the power n rows
- 2 variables: 4 rows
- 3 variables: 8 rows
- List inputs in binary order.
- Order
- Brackets
- NOT
- AND
- OR
- A + B.C is A + (B.C).
- Gates
AND 1 only if both are 1 OR 1 if any is 1 NAND and NOR NOT of AND and OR XOR 1 if inputs differ - Compare the tables.
- Equivalence
- Build both truth tables
- Compare the output columns
- Identical columns mean equal expressions
- Proof by truth table.
How to answer Truth Tables for Boolean Expressions with Two and Three Variables questions
Build truth tables in small columns, never in one step.
- 1Count the variables and write all 2 to the power n input rows.
- 2Add a column for every complemented variable.
- 3Add a column for every AND term, then combine with OR.
- 4Read off the output column; count the rows with output 1 if asked.
- 5To compare two expressions, build both and compare the output columns.
Truth Tables for Boolean Expressions with Two and Three Variables in real life
The idea, met in an everyday situation. Answer the question in your own words, then compare with the model answer. The one-line hook is what to remember.
A lift with two switches
Suppose a corridor light is wired so that it turns on when exactly one of two switches is pressed.
Which gate matches, and what is the table?
Try it first, then show the solutionSolution
- "Exactly one" means the inputs differ.
- That is XOR: 00 gives 0, 01 gives 1, 10 gives 1, 11 gives 0.
Answer: XOR gate; output 1 for 01 and 10 only.
Memory hook: XOR: the two must disagree.
Tricks to remember Truth Tables for Boolean Expressions with Two and Three Variables
Short memory aids. Say each one aloud once, then use it on a question the same day.
AND is strict, OR is generous
AND needs all inputs 1; OR needs one input 1.
Use it when: Gate tables.
NOT binds first
Complement the variable before AND and OR.
Use it when: Precedence.
Truth Tables for Boolean Expressions with Two and Three Variables: solved examples
Ordered from board level to HOTS. Try each one before you open the solution.
Example 1: XOR output · 1 mark · MCQBoard level
The output of A XOR B when A = 1 and B = 1 is:
(a) 1
(b) 0
(c) 2
(d) undefined
Try it first, then show the solutionSolution
- XOR is 1 only when the inputs differ.
Answer: (b) 0
Example 2: A two-variable table · 3 marks · Short answerBoard level
Construct the truth table of F = A'.B + A.B' and name the gate it behaves like. (3 marks)
Try it first, then show the solutionSolution
- Rows AB: 00, 01, 10, 11.
- A'.B is 1 only for 01; A.B' is 1 only for 10.
- F = 0, 1, 1, 0.
- This is the XOR gate.
Answer: F = 0, 1, 1, 0 for AB = 00, 01, 10, 11; XOR.
Example 3: A three-variable table · 4 marks · Short answerHarder board level
Prepare the truth table of F = A.B + B'.C. How many rows give F = 1? (4 marks)
Try it first, then show the solutionSolution
- ABC = 000: AB = 0, B'C = 0: F = 0. 001: B'C = 1: F = 1. 010: 0. 011: 0.
- 100: 0 (B'C = 0 since C = 0). 101: B'C = 1: F = 1. 110: AB = 1: F = 1. 111: AB = 1: F = 1.
- Output column: 0, 1, 0, 0, 0, 1, 1, 1.
- Four rows give 1.
Answer: F = 0, 1, 0, 0, 0, 1, 1, 1; four rows have F = 1.
Example 4: Count the ones · 4 marks · Short answerHarder board level
For the expression F = (A xor B).C, find the number of input combinations that give F = 1 and list them. (4 marks)
Try it first, then show the solutionSolution
- A xor B is 1 for AB = 01 and 10.
- F also needs C = 1.
- The combinations are ABC = 011 and 101.
- Two combinations give F = 1.
Answer: Two: 011 and 101.
Example 5: Prove an identity · 4 marks · Short answerHOTS / competency
Using truth tables, prove that A + A'.B = A + B. (4 marks)
Try it first, then show the solutionSolution
- Build rows AB = 00, 01, 10, 11.
- LHS A + A'B: 00 gives 0 + 0 = 0; 01 gives 0 + 1 = 1; 10 gives 1 + 0 = 1; 11 gives 1 + 0 = 1.
- RHS A + B: 0, 1, 1, 1.
- The output columns are identical, so the identity is proved.
Answer: Both sides give 0, 1, 1, 1; identity proved.
Where students lose marks in Truth Tables for Boolean Expressions with Two and Three Variables
The slips examiners see most often, and what to write instead.
Mistake: Wrong number of rows
Writing 6 rows for 3 variables.
Wrong working
3 variables: 6 rows.
Right working
3 variables: 2 to the power 3 = 8 rows.
Do this: Rows = 2 to the power n.
Usually costs: 1 mark
Mistake: Applying OR before AND
Ignoring precedence.
Wrong working
A + B.C evaluated as (A + B).C.
Right working
B.C first, then OR with A.
Do this: AND has higher precedence than OR.
Usually costs: 1 mark
Mistake: Treating XOR as OR
Mixing up the 1,1 row.
Wrong working
XOR(1,1) = 1.
Right working
XOR(1,1) = 0.
Do this: XOR is 1 only when the inputs differ.
Usually costs: 1 mark
Exam tips
- Write the input rows in binary order to avoid missing a row.
- Show intermediate columns for each complement and AND term.
- State the number of rows as 2 to the power n.
- In proof questions, write "LHS = RHS" under the matching columns.
Practice questions on Truth Tables for Boolean Expressions with Two and Three Variables
Write each answer on paper first. Open the hint only if you are stuck, and the answer only when you have finished.
Q1 · 1 mark · MCQBoard level
The number of rows in the truth table of a three-variable expression is:
(a) 3
(b) 6
(c) 8
(d) 9Hint
2 to the power 3.
Answer
(c) 8
Q2 · 3 marks · Short answerHarder board level
Complete the truth table of F = (A + B).(A' + B') and name the gate. (3 marks)
Hint
Evaluate two brackets.
Answer
AB = 00: (0).(1) = 0. 01: (1).(1) = 1. 10: (1).(1) = 1. 11: (1).(0) = 0. F = 0, 1, 1, 0: the XOR gate.
Q3 · 4 marks · Short answerHarder board level
For F = A xor B xor C, list the rows with F = 1 and state the rule it follows. (4 marks)
Hint
Count the number of ones.
Answer
Rows ABC: 001, 010, 100, 111 give F = 1 (an odd number of inputs are 1). F = 1 in four rows.
Q4 · 1 mark · Assertion-reasonHarder board level
Assertion (A): The NOR gate gives 1 only when all its inputs are 0.
Reason (R): NOR is the complement of OR.
(a) Both A and R are true, and R is the correct explanation of A.
(b) Both A and R are true, but R is not the correct explanation of A.
(c) A is true, but R is false.
(d) A is false, but R is true.Hint
OR is 0 only for all zeros.
Answer
(a) Both A and R are true, and R is the correct explanation of A.
Q5 · 5 marks · Short answerHOTS / competency
An alarm F sounds when the door is open (D = 1) and either the key switch is off (K = 0) or the guard switch is off (G = 0). Write F in terms of D, K, G, prepare its truth table and state how many rows sound the alarm. (5 marks)
Hint
F = D.(K' + G').
Answer
F = D.(K' + G'). F = 1 needs D = 1 and at least one of K and G equal to 0. With D = 1 the rows are 100, 101, 110 (111 gives 0 + 0 = 0). Every row with D = 0 gives F = 0. The alarm sounds in 3 rows: 100, 101 and 110.
Test your recall
Answer in your head or on paper first, then open the card. Pulling an answer out of memory makes it stick far better than re-reading.
1.Rows for n variables?Show answer
2 to the power n.
2.XOR output for equal inputs?Show answer
0.
3.NAND output when all inputs are 1?Show answer
0.
4.First operation in evaluation?Show answer
Brackets, then NOT.
5.How to prove two expressions equal?Show answer
Their truth tables have identical output columns.
Truth Tables for Boolean Expressions with Two and Three Variables: frequently asked questions
What is a truth table?
A table that lists every input combination and the output of a Boolean expression.
Which gate gives 1 only if both inputs are 1?
AND.
Is NOR the opposite of OR?
Yes, it is the complement of OR.