محاضرة 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
ninputs, there are2^npossible combinations (rows).- Example: 3 inputs (A, B, C) ->
2^3 = 8rows (from 0 to 7).
- Example: 3 inputs (A, B, C) ->
Scenarios for Creating Truth Tables
-
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, 1B: 0, 0, 1, 1, 0, 0, 1, 1A(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
fis 1 for the binary inputs010(2),011(3),101(5), and111(7). - All other rows (0, 1, 4, 6) get an output of 0.
-
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
- Row 0 (A=0, B=0, C=0):
- Example:
-
From a Dual Function
- The Dual of
F = A·B' + CisF^D = (A + B') · C. - The truth table for
F^Dis found by substitution, just like in Scenario 2. - Note: The truth table of
F^Dis not simply the inverse ofF. It's a different function. (e.g., for 000, F=0 and F^D=0).
- The Dual of
-
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.