👁 Preview — Study, Practice and Revise are open; mock tests and the rest of the syllabus unlock on subscription. Unlock all · ₹4,999
← Back to Number Systems & Logic
Study mode

Truth tables

Introduction to Truth Tables

In the study of computer aptitude and logic design, understanding how logical statements behave is crucial. A truth table is a simple yet powerful tool that lists all possible combinations of truth values for logical variables and shows the resulting output of a logical expression for each combination.

Truth tables help us visualize and analyze logical expressions systematically. They are widely used in competitive exams, digital circuit design, and Boolean algebra to verify the correctness of logical statements, simplify expressions, and design circuits.

Think of a truth table as a complete map that shows every possible scenario for the inputs and the corresponding output. This ensures no case is overlooked, which is essential for accuracy in logic problems.

Logical Variables and Truth Values

Before constructing truth tables, we need to understand the building blocks: logical variables and their truth values.

A logical variable is a symbol (like A, B, C) that can take one of two possible values:

  • True (represented by 1)
  • False (represented by 0)

This binary nature (only two possible values) makes logical variables ideal for representing conditions in computer science and digital electronics.

Truth Values for Variable A
ATruth Value
False0
True1

By combining these variables with logical operators, we can form expressions whose truth values depend on the inputs. Truth tables systematically list all combinations of these input values to evaluate the expression.

Truth Tables for Basic Logical Operators

Logical operators combine or modify logical variables to form expressions. The three fundamental operators are AND, OR, and NOT. Let's understand each and see how their truth tables are constructed.

AND Operator (·)

The AND operator outputs true only if both inputs are true. Otherwise, it outputs false.

OR Operator (+)

The OR operator outputs true if at least one input is true. It outputs false only if both inputs are false.

NOT Operator (¬ or overline)

The NOT operator is a unary operator that inverts the truth value of a single variable: true becomes false, and false becomes true.

Truth Tables for AND, OR, NOT Operators
AND (A · B) OR (A + B) NOT (¬A)
ABOutput ABOutput AOutput
000 000 01
010 011 10
100 101
111 111

Note: For the NOT operator, only one input variable is needed, so the table shows A and its complement.

Truth Tables for Derived Logical Operators

Beyond the basic operators, there are several derived operators important in logic design and computer science. These include NAND, NOR, XOR, and XNOR. Each has unique behavior and applications.

  • NAND (Not AND): The complement of AND. It outputs false only when both inputs are true.
  • NOR (Not OR): The complement of OR. It outputs true only when both inputs are false.
  • XOR (Exclusive OR): Outputs true only when inputs are different.
  • XNOR (Exclusive NOR): Outputs true only when inputs are the same.
Truth Tables for NAND, NOR, XOR, XNOR Operators
ABNANDNORXORXNOR
001101
011010
101010
110001

These operators are essential in designing complex logic circuits and are frequently tested in competitive exams.

Constructing a Truth Table for (A AND B) OR (NOT C)

Let's apply what we've learned to build a truth table for a compound logical expression:

Expression: \( (A \cdot B) + \overline{C} \)

Step 1: Identify the variables involved: A, B, and C. Since there are 3 variables, the truth table will have \(2^3 = 8\) rows to cover all input combinations.

Truth Table for \( (A \cdot B) + \overline{C} \)
ABCA · B¬C(A · B) + ¬C
000011
001000
010011
011000
100011
101000
110111
111101

Explanation:

  • Calculate \(A \cdot B\) for each row (AND of A and B).
  • Calculate \(\overline{C}\) (NOT of C).
  • Calculate the OR of the two results to get the final output.

This stepwise approach ensures clarity and accuracy.

Verifying Logical Equivalence Using Truth Tables

Logical equivalence means two expressions always have the same truth value for all input combinations. Let's verify if the following expressions are equivalent:

Expression 1: \( (A + B) \cdot (A + C) \)

Expression 2: \( A + (B \cdot C) \)

Step 1: List all possible combinations of A, B, and C (8 rows).

Truth Table to Verify Equivalence
ABCA + BA + C(A + B) · (A + C)B · CA + (B · C)
00000000
00101000
01010000
01111111
10011101
10111101
11011101
11111111

Step 2: Compare the columns for \( (A + B) \cdot (A + C) \) and \( A + (B \cdot C) \). Since their outputs match for all rows, the expressions are logically equivalent.

Truth Table for XOR Operator

The XOR (Exclusive OR) operator is unique because it outputs true only when the inputs differ. This is useful in error detection and digital circuits.

Truth Table for XOR (A ⊕ B)
ABA ⊕ B
000
011
101
110

Example: If A = "Is it raining?" and B = "Is it cloudy?", XOR outputs true only when exactly one of these is true, representing an exclusive condition.

Simplifying Boolean Expression Using Truth Tables

Truth tables can help simplify complex Boolean expressions by identifying when outputs are true or false and finding simpler equivalent expressions.

Example: Given the expression \( F = A \cdot B + A \cdot \overline{B} \), construct its truth table and simplify.

Truth Table for \( F = A \cdot B + A \cdot \overline{B} \)
AB\(\overline{B}\)\(A \cdot B\)\(A \cdot \overline{B}\)F
001000
010000
101011
110101

Observation: The output F is 1 whenever A is 1, regardless of B's value. Hence, the expression simplifies to:

\( F = A \)

Designing a Logic Circuit from a Truth Table

Truth tables are the starting point for designing logic circuits. By analyzing the output column, we can determine which logical operations and gates are needed.

Example: Given the truth table below, design the corresponding logic circuit.

Truth Table
ABOutput (F)
000
011
101
110

Step 1: Identify when output is 1 (rows 2 and 3).

Step 2: Write the expression for these rows:

  • Row 2: \( \overline{A} \cdot B \)
  • Row 3: \( A \cdot \overline{B} \)

Step 3: Combine using OR:

\( F = \overline{A} \cdot B + A \cdot \overline{B} \)

This is the XOR function, so the circuit can be implemented using an XOR gate.

Key Concept

Truth Tables

Tabular representation of all possible input combinations and their output for logical expressions.

Formula Bank

AND Operator
\[ A \cdot B = 1 \text{ if } A=1 \text{ and } B=1; \text{ else } 0 \]
where: A, B are logical variables with values 0 or 1
OR Operator
\[ A + B = 1 \text{ if } A=1 \text{ or } B=1; \text{ else } 0 \]
where: A, B are logical variables with values 0 or 1
NOT Operator
\[ \overline{A} = 1 \text{ if } A=0; \text{ else } 0 \]
where: A is a logical variable with value 0 or 1
NAND Operator
\[ \overline{A \cdot B} = 1 \text{ if } A \cdot B = 0; \text{ else } 0 \]
where: A, B are logical variables
NOR Operator
\[ \overline{A + B} = 1 \text{ if } A + B = 0; \text{ else } 0 \]
where: A, B are logical variables
XOR Operator
\[ A \oplus B = 1 \text{ if } A eq B; \text{ else } 0 \]
where: A, B are logical variables
XNOR Operator
\[ \overline{A \oplus B} = 1 \text{ if } A = B; \text{ else } 0 \]
where: A, B are logical variables
Example 1: Constructing a Truth Table for (A AND B) OR (NOT C) Medium
Construct the truth table for the logical expression \( (A \cdot B) + \overline{C} \).

Step 1: Identify variables: A, B, C. Number of rows = \(2^3 = 8\).

Step 2: List all input combinations of A, B, and C.

Step 3: Calculate \(A \cdot B\) for each row.

Step 4: Calculate \(\overline{C}\) (NOT C) for each row.

Step 5: Calculate final output by OR-ing \(A \cdot B\) and \(\overline{C}\).

Answer: The completed truth table is:

ABCA · B¬C(A · B) + ¬C
000011
001000
010011
011000
100011
101000
110111
111101
Example 2: Verifying Logical Equivalence Using Truth Tables Hard
Verify whether \( (A + B) \cdot (A + C) \) is logically equivalent to \( A + (B \cdot C) \).

Step 1: List all possible values of A, B, and C (8 rows).

Step 2: Compute \(A + B\) and \(A + C\) for each row.

Step 3: Calculate \( (A + B) \cdot (A + C) \) by AND-ing the previous results.

Step 4: Calculate \(B \cdot C\), then \(A + (B \cdot C)\).

Step 5: Compare the outputs of both expressions for all rows.

Answer: Since outputs match for all input combinations, the expressions are logically equivalent.

Example 3: Truth Table for XOR Operator Easy
Construct the truth table for the XOR operator \( A \oplus B \).

Step 1: List all input combinations of A and B (4 rows).

Step 2: For each row, output 1 if inputs differ, else 0.

Answer:

ABA ⊕ B
000
011
101
110
Example 4: Simplifying Boolean Expression Using Truth Tables Medium
Simplify the Boolean expression \( F = A \cdot B + A \cdot \overline{B} \) using a truth table.

Step 1: List all combinations of A and B (4 rows).

Step 2: Calculate \(\overline{B}\) for each row.

Step 3: Calculate \(A \cdot B\) and \(A \cdot \overline{B}\).

Step 4: Calculate \(F = A \cdot B + A \cdot \overline{B}\).

Step 5: Observe that F is 1 whenever A is 1, so \(F = A\).

Answer: The simplified expression is \( F = A \).

Example 5: Designing a Logic Circuit from a Truth Table Hard
Given the truth table below, design the corresponding logic circuit:
ABF
000
011
101
110

Step 1: Identify rows where output F = 1 (rows 2 and 3).

Step 2: Write expressions for these rows:

  • Row 2: \( \overline{A} \cdot B \)
  • Row 3: \( A \cdot \overline{B} \)

Step 3: Combine using OR:

\( F = \overline{A} \cdot B + A \cdot \overline{B} \)

Step 4: Recognize this as the XOR function.

Answer: The logic circuit is an XOR gate with inputs A and B.

Tips & Tricks

Tip: Always list all possible input combinations systematically using binary counting.

When to use: When constructing truth tables for multiple variables to avoid missing cases.

Tip: Use parentheses to clarify order of operations in complex logical expressions.

When to use: While interpreting or constructing truth tables for compound expressions.

Tip: Memorize truth tables of basic operators (AND, OR, NOT) to speed up problem solving.

When to use: During quick evaluations or multiple-choice questions in exams.

Tip: Check for logical equivalences by comparing output columns in truth tables.

When to use: When verifying if two expressions are equivalent.

Tip: Use truth tables as a verification tool after simplifying expressions using Boolean algebra or K-maps.

When to use: To confirm correctness of simplifications.

Common Mistakes to Avoid

❌ Not listing all possible input combinations, leading to incomplete truth tables.
✓ Systematically generate all combinations using binary counting for n variables (2n rows).
Why: Students often lose track of input combinations as variables increase.
❌ Misinterpreting the NOT operator and applying it incorrectly to expressions.
✓ Apply NOT only to the variable or expression it directly precedes, respecting parentheses.
Why: Confusion arises from operator precedence and lack of clarity in expression.
❌ Mixing up output values for XOR and OR operators due to their similarity in some cases.
✓ Remember XOR outputs true only when inputs differ, unlike OR which outputs true if any input is true.
Why: Students rely on intuition rather than memorized truth tables.
❌ Failing to verify logical equivalences by comparing entire output columns.
✓ Always compare full output columns row by row to confirm equivalence.
Why: Partial comparison leads to incorrect conclusions.
❌ Ignoring operator precedence and evaluating expressions in wrong order.
✓ Use parentheses and follow standard precedence: NOT > AND > OR.
Why: Lack of clarity on precedence causes errors in output calculation.
Curated videos per subtopic
Top YouTube explainers, AI-ranked for your exam and language. Unlocks with subscription.
Unlock

Try Practice next.

Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.

Go to practice →
Ask a doubt
Truth tables · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.