Digital Logic & Logic Gates

Comprehensive Engineering Reference & Complete Universal Synthesis Manual

1. Foundations of Digital Logic & Signals

A Logic Gate is an idealized or physical electronic device implementing a Boolean function—a logical operation performed on one or more binary inputs that produces a single binary output.

1.1 Analog vs. Digital Signals

While analog signals vary continuously over a smooth range of voltages, digital logic operates within discrete voltage bands representing binary values:

1.2 Positive Logic vs. Negative Logic Systems

The assignment of binary state values to physical voltage levels defines the logic polarity:

Logic System Higher Voltage Level ($V_H$) Lower Voltage Level ($V_L$)
Positive Logic (Standard) Logic 1 Logic 0
Negative Logic Logic 0 Logic 1
Duality Principle in Logic Polarity

An active-HIGH gate in positive logic becomes an active-LOW gate in negative logic. For instance, a positive-logic AND gate behaves strictly as a negative-logic OR gate.

2. Basic Fundamental Gates

The foundation of all digital systems rests upon three elementary logical operations: NOT (Inversion), AND (Conjunction), and OR (Disjunction).

NOT Gate (Inverter) Y = A' = A̅

Produces an output that is the exact logical inverse of its single input.

A Y
AY
01
10

Switch Equivalent: A single normally-closed switch in parallel with the load.

AND Gate Y = A · B

Output is HIGH (1) if and only if ALL inputs are HIGH (1).

A B Y
ABY
000
010
100
111

Switch Equivalent: Two normally-open switches connected in series.

OR Gate Y = A + B

Output is HIGH (1) if AT LEAST ONE input is HIGH (1).

A B Y
ABY
000
011
101
111

Switch Equivalent: Two normally-open switches connected in parallel.

3. Universal Logic Gates

NAND and NOR gates are known as Universal Gates because any Boolean expression or logic function can be synthesized using only NAND or only NOR gates without requiring any other gate type.

NAND Gate Y = (A · B)'

Composed of an AND gate followed directly by an Inverter. Output is LOW (0) only when all inputs are HIGH (1).

ABY
001
011
101
110

De Morgan Equivalent: Bubbled-OR Gate ($A' + B'$).

NOR Gate Y = (A + B)'

Composed of an OR gate followed directly by an Inverter. Output is HIGH (1) only when all inputs are LOW (0).

ABY
001
010
100
110

De Morgan Equivalent: Bubbled-AND Gate ($A' \cdot B'$).

4. Universal Gate Synthesis & Step-by-Step Proofs

This section proves universality by constructing all standard logic operations using solely 2-input NAND gates and solely 2-input NOR gates.

4.1 NAND Gate Realization Matrix

1. NOT from NAND (Requires 1 Gate): Connect both inputs together.

Y = (A · A)' = A' // By Idempotent Law: A · A = A

2. AND from NAND (Requires 2 Gates): Invert the output of a NAND gate using a second NAND-based inverter.

Stage 1: Logic Output = (A · B)'
Stage 2: Y = ((A · B)')' = A · B // By Double Inversion Law

3. OR from NAND (Requires 3 Gates): Apply De Morgan's Law $A + B = (A' · B')'$. Invert inputs $A$ and $B$ individually via NAND inverters, then pass both into a 3rd NAND gate.

Inverted Inputs: A' = (A · A)', B' = (B · B)'
Y = (A' · B')' = (A')' + (B')' = A + B // By De Morgan's First Theorem

4. XOR from NAND (Requires 4 Gates): Realizing $Y = A\bar{B} + \bar{A}B$.

Gate 1: G1 = (A · B)'
Gate 2: G2 = (A · G1)' = (A · (A · B)')' = (A · (A' + B'))' = (A A' + A B')' = (0 + A B')' = (A B')'
Gate 3: G3 = (B · G1)' = (B · (A · B)')' = (B · (A' + B'))' = (B A' + B B')' = (A' B + 0)' = (A' B)'
Gate 4: Y = (G2 · G3)' = ((A B')' · (A' B)')' = (A B')'' + (A' B)'' = A B' + A' B = A ⊕ B

5. XNOR from NAND (Requires 5 Gates): Invert the output of the 4-gate NAND XOR circuit using a 5th NAND inverter.

4.2 NOR Gate Realization Matrix

1. NOT from NOR (Requires 1 Gate): Connect both inputs together.

Y = (A + A)' = A' // By Idempotent Law: A + A = A

2. OR from NOR (Requires 2 Gates): Invert the output of a NOR gate using a second NOR inverter.

Stage 1: Logic Output = (A + B)'
Stage 2: Y = ((A + B)')' = A + B // Double Inversion

3. AND from NOR (Requires 3 Gates): Apply De Morgan's Law $A · B = (A' + B')'$. Invert inputs $A$ and $B$ individually via NOR inverters, then pass into a 3rd NOR gate.

Inverted Inputs: A' = (A + A)', B' = (B + B)'
Y = (A' + B')' = (A')' · (B')' = A · B // By De Morgan's Second Theorem

4. XNOR from NOR (Requires 4 Gates): Realizing $Y = AB + \bar{A}\bar{B}$.

Gate 1: G1 = (A + B)'
Gate 2: G2 = (A + G1)' = (A + (A + B)')' = (A + A'B')' = ( (A+A')(A+B') )' = (1 · (A+B'))' = (A + B')'
Gate 3: G3 = (B + G1)' = (B + (A + B)')' = (B + A'B')' = ( (B+A')(B+B') )' = ( (A'+B) · 1 )' = (A' + B)'
Gate 4: Y = (G2 + G3)' = ( (A + B')' + (A' + B)' )' = (A + B')'' · (A' + B)'' = (A + B')(A' + B) = AB + A'B' = A ⊙ B

5. XOR from NOR (Requires 5 Gates): Invert the output of the 4-gate NOR XNOR circuit using a 5th NOR inverter.

4.3 Universal Implementation Minimum Gate Count Summary

Target Gate NAND Gates Required NOR Gates Required
NOT11
AND23
OR32
XOR45
XNOR54

5. Exclusive & Special Purpose Gates

XOR Gate (Exclusive-OR) Y = A ⊕ B

Output is HIGH (1) if inputs are DIFFERENT. Functions as an odd-parity detector and binary adder component.

Expanded Form: $Y = A\bar{B} + \bar{A}B$

ABY
000
011
101
110

XNOR Gate (Equivalence) Y = A ⊙ B

Output is HIGH (1) if inputs are IDENTICAL. Acts as a bit-equality magnitude comparator.

Expanded Form: $Y = AB + \bar{A}\bar{B}$

ABY
001
010
100
111

5.1 Practical Applications of XOR Gates

6. Tri-State Logic & High-Impedance (High-Z)

Standard logic gates have two output states (0 and 1). Tri-State Logic adds a 3rd state called High-Impedance (High-Z), where the output is electrically disconnected from the circuit board trace.

Data Input (A) Enable Control (E) Active-HIGH Tri-State Buffer Output (Y)
00High-Z (Disconnected)
10High-Z (Disconnected)
010
111
Engineering Application: Shared Bus Architectures

Tri-state buffers allow multiple transmitter outputs (e.g., RAM, CPU, Peripheral registers) to connect directly to a single shared physical data bus without driving conflicts or short circuits, provided only one device Enable signal is active at any given instant.

7. Standard 7400 Series TTL IC Pinout Reference

Commercial Transistor-Transistor Logic (TTL) ICs come packaged in standard 14-pin Dual In-line Packages (DIP). Pin 7 is always connected to GND ($0\text{V}$) and Pin 14 is connected to $V_{CC}$ ($+5\text{V}$).

7400: Quad 2-Input NAND IC

Contains 4 independent 2-input NAND gates.

  • Gate 1: Inputs (Pin 1, 2) → Output (Pin 3)
  • Gate 2: Inputs (Pin 4, 5) → Output (Pin 6)
  • Ground: Pin 7
  • Gate 3: Output (Pin 8) ← Inputs (Pin 9, 10)
  • Gate 4: Output (Pin 11) ← Inputs (Pin 12, 13)
  • Supply ($V_{CC}$): Pin 14

7402: Quad 2-Input NOR IC

Note: Pin layout reversed compared to 7400!

  • Gate 1: Output (Pin 1) ← Inputs (Pin 2, 3)
  • Gate 2: Output (Pin 4) ← Inputs (Pin 5, 6)
  • Ground: Pin 7
  • Gate 3: Inputs (Pin 8, 9) → Output (Pin 10)
  • Gate 4: Inputs (Pin 11, 12) → Output (Pin 13)
  • Supply ($V_{CC}$): Pin 14

Common 74 Series Logic IC Index

  • 7404: Hex Inverter (6 NOT Gates)
  • 7408: Quad 2-Input AND Gate
  • 7432: Quad 2-Input OR Gate
  • 7486: Quad 2-Input XOR Gate
  • 74133: Single 13-Input NAND Gate

8. Key Electrical Parameters & Characteristics

8.1 Propagation Delay ($t_p$)

The transition time required for an output signal to change state after an input signal transition occurs:

8.2 Fan-In and Fan-Out

8.3 Noise Margins

Noise margin quantifies the electrical noise immunity of a logic family:

High-Level Noise Margin: NM_H = V_OH(min) - V_IH(min)
Low-Level Noise Margin: NM_L = V_IL(max) - V_OL(max)

For standard 5V TTL logic: $V_{IH(min)} = 2.0\text{V}$, $V_{OH(min)} = 2.4\text{V}$, $V_{IL(max)} = 0.8\text{V}$, $V_{OL(max)} = 0.4\text{V}$. Yielding a safety noise margin $NM_H = NM_L = 0.4\text{V}$.

9. Master Logic Gate Cheatsheet

Gate Name Boolean Operator Algebraic Expression Output is HIGH (1) when... NAND Equivalent Count NOR Equivalent Count
NOT A' or A̅ $Y = \bar{A}$ Input is 0 1 1
AND A · B $Y = A \cdot B$ ALL inputs are 1 2 3
OR A + B $Y = A + B$ ANY input is 1 3 2
NAND (A · B)' $Y = \overline{A \cdot B}$ ANY input is 0 1 4
NOR (A + B)' $Y = \overline{A + B}$ ALL inputs are 0 4 1
XOR A ⊕ B $Y = A\bar{B} + \bar{A}B$ Inputs are DIFFERENT 4 5
XNOR A ⊙ B $Y = AB + \bar{A}\bar{B}$ Inputs are IDENTICAL 5 4