Truth Table Examples
Master truth table construction and analysis with comprehensive examples from basic 2-variable tables to complex 4-variable functions.
Basic 2-Variable Truth Tables
Example 1: AND Gate (A · B)
Truth Table
| A | B | A · B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Analysis
- Minterms: m₃ (row where output = 1)
- SOP Form: F = A·B
- Maxterms: M₀, M₁, M₂
- POS Form: F = (A+B)·(A+B')·(A'+B)
- Logic: Output is 1 only when both inputs are 1
Example 2: XOR Gate (A ⊕ B)
Truth Table
| A | B | A ⊕ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Analysis
- Minterms: m₁, m₂
- SOP Form: F = A'·B + A·B'
- Maxterms: M₀, M₃
- POS Form: F = (A+B)·(A'+B')
- Logic: Output is 1 when inputs are different
3-Variable Truth Tables
Example 3: Majority Function F(A,B,C)
Output is 1 when majority of inputs are 1.
Truth Table
| A | B | C | F | Row |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 2 |
| 0 | 1 | 1 | 1 | 3 |
| 1 | 0 | 0 | 0 | 4 |
| 1 | 0 | 1 | 1 | 5 |
| 1 | 1 | 0 | 1 | 6 |
| 1 | 1 | 1 | 1 | 7 |
Step-by-Step Analysis
Step 1: Identify Minterms
Rows where F = 1: 3, 5, 6, 7
Step 2: Write Minterm Expressions
- m₃: A'·B·C
- m₅: A·B'·C
- m₆: A·B·C'
- m₇: A·B·C
Step 3: SOP Expression
F = A'·B·C + A·B'·C + A·B·C' + A·B·C
Step 4: Simplified Form
F = A·B + A·C + B·C
Example 4: Parity Checker (Even Parity)
Output is 1 when an even number of inputs are 1.
| A | B | C | Count of 1s | Even Parity |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 (even) | 1 |
| 0 | 0 | 1 | 1 (odd) | 0 |
| 0 | 1 | 0 | 1 (odd) | 0 |
| 0 | 1 | 1 | 2 (even) | 1 |
| 1 | 0 | 0 | 1 (odd) | 0 |
| 1 | 0 | 1 | 2 (even) | 1 |
| 1 | 1 | 0 | 2 (even) | 1 |
| 1 | 1 | 1 | 3 (odd) | 0 |
Expression Derivation
SOP Form: F = A'·B'·C' + A'·B·C + A·B'·C + A·B·C'
Simplified: F = A ⊕ B ⊕ C (3-input XOR)
4-Variable Truth Table Example
Example 5: BCD Valid Code Detector
Detects valid BCD codes (0000 to 1001). Output is 1 for valid BCD digits.
| A | B | C | D | Decimal | Valid BCD | Row |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 0 | 1 | 0 | 2 | 1 | 2 |
| 0 | 0 | 1 | 1 | 3 | 1 | 3 |
| 0 | 1 | 0 | 0 | 4 | 1 | 4 |
| 0 | 1 | 0 | 1 | 5 | 1 | 5 |
| 0 | 1 | 1 | 0 | 6 | 1 | 6 |
| 0 | 1 | 1 | 1 | 7 | 1 | 7 |
| 1 | 0 | 0 | 0 | 8 | 1 | 8 |
| 1 | 0 | 0 | 1 | 9 | 1 | 9 |
| 1 | 0 | 1 | 0 | 10 | 0 | 10 |
| 1 | 0 | 1 | 1 | 11 | 0 | 11 |
| 1 | 1 | 0 | 0 | 12 | 0 | 12 |
| 1 | 1 | 0 | 1 | 13 | 0 | 13 |
| 1 | 1 | 1 | 0 | 14 | 0 | 14 |
| 1 | 1 | 1 | 1 | 15 | 0 | 15 |
Analysis
Minterms: m₀, m₁, m₂, m₃, m₄, m₅, m₆, m₇, m₈, m₉
Simplified Expression: F = A'·B' + A'·C' + A·B'·C'·D'
Alternative: F = A'·(B' + C') + A·B'·C'·D'
Truth Table Construction Guidelines
Step-by-Step Process
- 1. Determine number of variables (n)
- 2. Create 2ⁿ rows for all combinations
- 3. List inputs in binary order
- 4. Evaluate function for each row
- 5. Identify minterms (F=1) or maxterms (F=0)
- 6. Write Boolean expression
Best Practices
- • Use consistent variable ordering
- • Number rows for reference
- • Highlight output 1s for clarity
- • Verify with known logic gates
- • Double-check binary counting
- • Include decimal equivalents
Common Applications
Digital Circuits
- • Logic gate design
- • Combinational circuits
- • Decoder/encoder design
- • Multiplexer logic
Computer Systems
- • CPU instruction decoding
- • Memory address decoding
- • Control unit design
- • ALU operations
Error Detection
- • Parity checkers
- • Code validators
- • Checksum generators
- • Error correction codes
Practice Exercises
Create Truth Tables For:
- Exercise 1: NAND gate (A NAND B)
- Exercise 2: 3-input AND gate (A·B·C)
- Exercise 3: Odd parity checker for 3 variables
- Exercise 4: 2-bit comparator (A₁A₀ = B₁B₀)
- Exercise 5: BCD to 7-segment decoder (partial)
Summary
Truth tables are fundamental tools in digital logic design. They provide a systematic way to analyze Boolean functions, derive expressions, and verify circuit behavior. Master these examples and practice regularly to build strong foundations in digital logic and computer engineering.