Key Engineering Takeaways
- •Logic gates are electronic circuits that perform elementary Boolean operations on one or more binary inputs to produce a single output.
- •NOT (Inverter): Flips 1 to 0 and 0 to 1.
- •AND: Output is 1 ONLY IF ALL inputs are 1; OR: Output is 1 IF ANY input is 1.
- •NAND and NOR are UNIVERSAL gates: any possible digital computer circuit can be constructed purely from combinations of NAND gates.
- •XOR (Exclusive OR) outputs 1 if inputs are DIFFERENT (used as the foundation of binary half-adders in arithmetic logic units).
- • Binary Numbers and BJT transistor switches
- • 74HC08 (Quad AND)
- • 74HC32 (Quad OR)
- • 74HC04 (Hex Inverter)
- • 74HC00 (Quad NAND)
- • LEDs, Resistors & Breadboard
What are Logic Gates? Transistors as Logical Decisions
Every CPU, GPU, and microcontroller on earth is constructed of millions to billions of interconnected Logic Gates.
A logic gate takes one or more digital binary inputs (0 or 1) and applies a deterministic Boolean algebraic rule to generate a single binary output.
The 3 Primary Gates: NOT (Inverter), AND & OR
1. NOT Gate (Inverter - 74HC04):
Triangle with a negation bubble on the output:
- Input
0to Output `1` - Input
1to Output `0`
2. AND Gate (74HC08):
Flat back with a rounded D-shaped front:
- Output is
1ONLY IF Input A AND Input B are both1.
3. OR Gate (74HC32):
Curved back with a pointed tip:
- Output is
1IF EITHER Input A OR Input B is1.
Building Discrete RTL / DTL Gates on a Breadboard
Before IC chips, gates were constructed with discrete NPN transistors:
- Discrete AND Gate: Connect two NPN transistors in series. Current can only flow to the LED if Transistor 1's Base is HIGH AND Transistor 2's Base is HIGH!
- Discrete OR Gate: Connect two NPN transistors in parallel. If EITHER base receives voltage, current conducts to the LED.
- Discrete NOT Gate (Inverter): Single NPN transistor with collector pull-up resistor. Applying HIGH to base shorts collector to ground, pulling output LOW!
The Exclusive Gates: XOR & XNOR (Binary Adders & Parity)
The XOR (Exclusive OR - 74HC86) gate outputs 1 if inputs are strictly DIFFERENT:
- 0 oplus 0 = 0
- 0 oplus 1 = 1
- 1 oplus 0 = 1
- 1 oplus 1 = 0
XOR is the mathematical core of the 1-bit Half-Adder: A oplus B gives the Sum bit, while A · B (AND) gives the Carry bit!
Frequently Asked Questions
What does the little circle (bubble) on a logic gate symbol mean?
The bubble represents an inversion (NOT operation). For example, adding a bubble to an AND gate makes it a NAND (Not-AND) gate; adding a bubble to an OR gate makes it a NOR gate.