What is Boolean Logic: Gate Architecture, De Morgan's Laws & Universal Gates?
Mathematical Foundation
Laws & Principles
- De Morgan's laws (the two duality theorems of Boolean algebra): (1) NOT(A AND B) = (NOT A) OR (NOT B). Equivalently: A NAND B = (NOT A) OR (NOT B). (2) NOT(A OR B) = (NOT A) AND (NOT B). Equivalently: A NOR B = (NOT A) AND (NOT B). These laws are essential for circuit simplification: converting AND-OR logic to all-NAND or all-NOR implementations, which reduces transistor count and propagation delay in real circuits. Verification: A=1, B=0. NOT(1 AND 0) = NOT(0) = 1. (NOT 1) OR (NOT 0) = 0 OR 1 = 1. ✓
- NAND universality — building all gates from NAND alone: NOT(A) = A NAND A (both inputs tied together). AND(A,B) = NOT(A NAND B) = (A NAND B) NAND (A NAND B). OR(A,B) = (NOT A) NAND (NOT B) = (A NAND A) NAND (B NAND B). This universality is exploited in industrial chip design: standardized NAND cell libraries allow automated synthesis tools to implement any Boolean function using a single, well-characterized gate type, minimizing design complexity and manufacturing variability. 74xx TTL NAND gates (7400) and their CMOS equivalents (4011) are among the most manufactured electronic components in history.
- Operator precedence in Boolean algebra (highest to lowest): (1) Parentheses — always evaluated first. (2) NOT — applied to the immediately following variable or parenthesized expression. (3) AND (logical multiplication) — evaluated before OR. (4) OR (logical addition) — lowest precedence. Example: A OR B AND C ≡ A OR (B AND C), NOT A OR B ≡ (NOT A) OR B (NOT does NOT bind the whole expression). This mirrors algebraic precedence: multiplication before addition, which is why Boolean expressions use · for AND and + for OR.
- XOR and binary arithmetic: XOR is the mathematical foundation of binary addition. Sum bit = A XOR B. Carry bit = A AND B (half adder). Full adder (3 inputs: A, B, C_in): Sum = A XOR B XOR C_in; Carry_out = (A AND B) OR (C_in AND (A XOR B)). An 8-bit ripple-carry adder chains 8 full adders. XOR is also self-inverse: A XOR A = 0, A XOR 0 = A. This makes XOR the core operation in symmetric encryption ciphers (AES, ChaCha20), RAID-5/6 parity calculations, error-correcting codes (Hamming, CRC), and pseudo-random number generators (LFSRs).
Step-by-Step Example Walkthrough
" Evaluate the 3-variable expression Q = (A NAND B) XOR C, then apply De Morgan's law to show the NAND-free equivalent. Given A=1, B=1, C=0. "
- Resolve NAND: A NAND B = NOT(1 AND 1) = NOT(1) = 0
- Apply XOR: Q = 0 XOR C = 0 XOR 0 = 0
- De Morgan equivalent: A NAND B ≡ (NOT A) OR (NOT B) = (NOT 1) OR (NOT 1) = 0 OR 0 = 0 ✓
- Verify XOR with equivalent: 0 XOR 0 = 0 ✓
- Full truth row: A=1, B=1, C=0 → NAND(A,B)=0, XOR(0,C)=0 → Q=0