ITclub

العودة إلى Digital Engineering
محاضرة 3

Truth Tables

كيفية بناء جداول الحقيقة من توصيف الدائرة، أو من معادلة، أو لدائرة مجهولة.

ملخص المحاضرة

📜 Lecture 3: Truth Tables

This lecture details the process of constructing truth tables, which describe a circuit's output for every possible input combination.

Key Concepts

  • Logic Circuit Design: The process starts with a word description of a problem.
  • Truth Table: The first step in design. It lists all possible input combinations and the corresponding desired output.
  • Inputs and Rows: For n inputs, there are 2^n possible combinations (rows).
    • Example: 3 inputs (A, B, C) -> 2^3 = 8 rows (from 0 to 7).

Scenarios for Creating Truth Tables

  1. From a Word Description

    • Example: "Design a 3-bit prime number detector for numbers 0-7."
    • Step 1: Identify inputs (A, B, C) and rows (8).
    • Step 2: Fill the input side systematically:
      • C (right-most): 0, 1, 0, 1, 0, 1, 0, 1
      • B: 0, 0, 1, 1, 0, 0, 1, 1
      • A (left-most): 0, 0, 0, 0, 1, 1, 1, 1
    • Step 3: Fill the output side (f) based on the problem.
      • Prime numbers in the range {0-7} are 2, 3, 5, 7.
      • The output f is 1 for the binary inputs 010 (2), 011 (3), 101 (5), and 111 (7).
      • All other rows (0, 1, 4, 6) get an output of 0.
  2. From a Boolean Equation

    • Example: F = A·B' + C
    • Step 1-2: Same as above (3 inputs, 8 rows, fill A, B, C).
    • Step 3: Substitute the A, B, C values from each row into the equation to find the output F.
      • Row 0 (A=0, B=0, C=0): F = (0 · 0') + 0 = (0 · 1) + 0 = 0 + 0 = 0
      • Row 1 (A=0, B=0, C=1): F = (0 · 0') + 1 = (0 · 1) + 1 = 0 + 1 = 1
      • Row 4 (A=1, B=0, C=0): F = (1 · 0') + 0 = (1 · 1) + 0 = 1 + 0 = 1
      • Row 7 (A=1, B=1, C=1): F = (1 · 1') + 1 = (1 · 0) + 1 = 0 + 1 = 1
  3. From a Dual Function

    • The Dual of F = A·B' + C is F^D = (A + B') · C.
    • The truth table for F^D is found by substitution, just like in Scenario 2.
    • Note: The truth table of F^D is not simply the inverse of F. It's a different function. (e.g., for 000, F=0 and F^D=0).
  4. From an Unknown Circuit (Reverse Engineering)

    • Given a "black box" circuit with known inputs and an output.
    • Step 1-2: Fill the input side of the truth table (e.g., 000 to 111).
    • Step 3: Test the circuit empirically (in practice).
      • Apply each input combination (e.g., connect A, B, C to 0V) and measure the output voltage.
      • If the output is High (e.g., 5V), write 1 in the table. If Low (e.g., 0V), write 0.
      • Repeat for all 8 rows to build the complete truth table.