11-17-2025, 02:37 PM
Thread 5 — Logic Gates & Boolean Logic
The Foundations of Digital Circuits & Computing
Logic gates are the building blocks of all digital electronics.
Every CPU, GPU, RAM module, microcontroller, and digital circuit you’ve ever used is built from billions of logic gates working together.
This thread introduces logic symbols, truth tables, and how these gates combine to form real computations.
1. What Is Boolean Logic?
Boolean logic is a mathematical system of:
• TRUE / FALSE
• 1 / 0
• HIGH / LOW
• ON / OFF
Everything in digital electronics reduces to combinations of TRUE and FALSE.
Boolean operations include:
• AND
• OR
• NOT
• NAND
• NOR
• XOR
• XNOR
All computing is built on these fundamental operations.
2. What Is a Logic Gate?
A logic gate is an electronic circuit that performs one Boolean operation.
Inputs: digital signals (0 or 1)
Output: a digital result (0 or 1)
Gates are made using:
• MOSFETs
• BJTs (historically)
• CMOS technology in modern chips
Each gate processes information just like a tiny decision-maker.
3. The Core Logic Gates
Below are the essential gates, symbols (ASCII-safe), and truth tables.
AND Gate
A ---|&>--- OUT
B ---|
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 0
0 | 1 | 0
1 | 0 | 0
1 | 1 | 1
Outputs 1 only when *both* inputs are 1.
OR Gate
A ---|≥1>--- OUT
B ---|
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 1
Outputs 1 when *either* input is 1.
NOT Gate (Inverter)
A ---|>o---- OUT
Truth table:
A | OUT
---+-----
0 | 1
1 | 0
Flips the input.
NAND Gate
The opposite of AND.
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 1
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
Important: NAND is the most important gate in digital electronics —
you can build an entire computer using NAND gates alone.
NOR Gate
Opposite of OR.
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 1
0 | 1 | 0
1 | 0 | 0
1 | 1 | 0
NOR can also build any circuit (just like NAND).
XOR Gate
Exclusive OR — true when inputs differ.
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
Used heavily in:
• adders
• cryptography
• parity checks
4. Gate Combinations — Real Digital Circuits
NOT + AND = NAND
NOT + OR = NOR
XOR = (A OR B) AND NOT(A AND B)
All digital logic circuits are built from combinations of simple gates.
Examples:
• flip-flops
• registers
• adders
• multiplexers
• ALUs
• memory cells
• CPU instruction decoders
5. Example: Half-Adder (The Birth of Addition)
A half-adder adds two bits.
Inputs: A, B
Outputs:
• SUM
• CARRY
Circuit:
• SUM = XOR(A, B)
• CARRY = AND(A, B)
Truth table:
A | B | SUM | CARRY
---+---+-----+-------
0 | 0 | 0 | 0
0 | 1 | 1 | 0
1 | 0 | 1 | 0
1 | 1 | 0 | 1
Full adders → ripple-carry adders → ALU arithmetic.
This is how computers do math.
6. Logic Levels & Voltages
Digital circuits typically use:
• 5V logic (Arduino, TTL)
• 3.3V logic (modern microcontrollers)
• 1.8V → 0.9V → 0.7V (CPUs and RAM)
Logic level definitions vary by standard.
7. CMOS — The Technology Inside Every Chip
CMOS uses:
• a pair of MOSFETs (PMOS + NMOS)
• extremely low power use
• high noise immunity
All modern chips — from Raspberry Pi to iPhone CPUs — use CMOS logic.
8. Why Logic Gates Matter
Everything a computer does begins at the logic gate level:
• storing a bit
• adding numbers
• comparing values
• making decisions
• executing instructions
• controlling memory
• running programs
Billions of tiny gates switching billions of times per second.
Logic gates are the language of machines.
9. What Comes Next?
Suggested follow-up threads for this subforum:
• Thread 6 — Flip-Flops, Registers & Memory
• Thread 7 — Microcontrollers & Embedded Systems
• Thread 8 — Power Electronics Basics
End of Thread — Logic Gates & Boolean Logic
The Foundations of Digital Circuits & Computing
Logic gates are the building blocks of all digital electronics.
Every CPU, GPU, RAM module, microcontroller, and digital circuit you’ve ever used is built from billions of logic gates working together.
This thread introduces logic symbols, truth tables, and how these gates combine to form real computations.
1. What Is Boolean Logic?
Boolean logic is a mathematical system of:
• TRUE / FALSE
• 1 / 0
• HIGH / LOW
• ON / OFF
Everything in digital electronics reduces to combinations of TRUE and FALSE.
Boolean operations include:
• AND
• OR
• NOT
• NAND
• NOR
• XOR
• XNOR
All computing is built on these fundamental operations.
2. What Is a Logic Gate?
A logic gate is an electronic circuit that performs one Boolean operation.
Inputs: digital signals (0 or 1)
Output: a digital result (0 or 1)
Gates are made using:
• MOSFETs
• BJTs (historically)
• CMOS technology in modern chips
Each gate processes information just like a tiny decision-maker.
3. The Core Logic Gates
Below are the essential gates, symbols (ASCII-safe), and truth tables.
AND Gate
A ---|&>--- OUT
B ---|
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 0
0 | 1 | 0
1 | 0 | 0
1 | 1 | 1
Outputs 1 only when *both* inputs are 1.
OR Gate
A ---|≥1>--- OUT
B ---|
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 1
Outputs 1 when *either* input is 1.
NOT Gate (Inverter)
A ---|>o---- OUT
Truth table:
A | OUT
---+-----
0 | 1
1 | 0
Flips the input.
NAND Gate
The opposite of AND.
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 1
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
Important: NAND is the most important gate in digital electronics —
you can build an entire computer using NAND gates alone.
NOR Gate
Opposite of OR.
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 1
0 | 1 | 0
1 | 0 | 0
1 | 1 | 0
NOR can also build any circuit (just like NAND).
XOR Gate
Exclusive OR — true when inputs differ.
Truth table:
A | B | OUT
---+---+-----
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
Used heavily in:
• adders
• cryptography
• parity checks
4. Gate Combinations — Real Digital Circuits
NOT + AND = NAND
NOT + OR = NOR
XOR = (A OR B) AND NOT(A AND B)
All digital logic circuits are built from combinations of simple gates.
Examples:
• flip-flops
• registers
• adders
• multiplexers
• ALUs
• memory cells
• CPU instruction decoders
5. Example: Half-Adder (The Birth of Addition)
A half-adder adds two bits.
Inputs: A, B
Outputs:
• SUM
• CARRY
Circuit:
• SUM = XOR(A, B)
• CARRY = AND(A, B)
Truth table:
A | B | SUM | CARRY
---+---+-----+-------
0 | 0 | 0 | 0
0 | 1 | 1 | 0
1 | 0 | 1 | 0
1 | 1 | 0 | 1
Full adders → ripple-carry adders → ALU arithmetic.
This is how computers do math.
6. Logic Levels & Voltages
Digital circuits typically use:
• 5V logic (Arduino, TTL)
• 3.3V logic (modern microcontrollers)
• 1.8V → 0.9V → 0.7V (CPUs and RAM)
Logic level definitions vary by standard.
7. CMOS — The Technology Inside Every Chip
CMOS uses:
• a pair of MOSFETs (PMOS + NMOS)
• extremely low power use
• high noise immunity
All modern chips — from Raspberry Pi to iPhone CPUs — use CMOS logic.
8. Why Logic Gates Matter
Everything a computer does begins at the logic gate level:
• storing a bit
• adding numbers
• comparing values
• making decisions
• executing instructions
• controlling memory
• running programs
Billions of tiny gates switching billions of times per second.
Logic gates are the language of machines.
9. What Comes Next?
Suggested follow-up threads for this subforum:
• Thread 6 — Flip-Flops, Registers & Memory
• Thread 7 — Microcontrollers & Embedded Systems
• Thread 8 — Power Electronics Basics
End of Thread — Logic Gates & Boolean Logic
