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
000
010
100
111

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
000
011
101
110

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
00000
00101
01002
01113
10004
10115
11016
11117

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
0000 (even)1
0011 (odd)0
0101 (odd)0
0112 (even)1
1001 (odd)0
1012 (even)1
1102 (even)1
1113 (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
0000010
0001111
0010212
0011313
0100414
0101515
0110616
0111717
1000818
1001919
101010010
101111011
110012012
110113013
111014014
111115015

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. 1. Determine number of variables (n)
  2. 2. Create 2ⁿ rows for all combinations
  3. 3. List inputs in binary order
  4. 4. Evaluate function for each row
  5. 5. Identify minterms (F=1) or maxterms (F=0)
  6. 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:

  1. Exercise 1: NAND gate (A NAND B)
  2. Exercise 2: 3-input AND gate (A·B·C)
  3. Exercise 3: Odd parity checker for 3 variables
  4. Exercise 4: 2-bit comparator (A₁A₀ = B₁B₀)
  5. 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.