MyRoboPathOpen Robotics Lab
electronics16 min readUpdated 2026-03-14Beginner

Logic Gates Explained: AND, OR, NOT, NAND, NOR & XOR Transistor Circuits

Explore the building blocks of microprocessors: understand AND, OR, NOT, NAND, NOR, and XOR logic gates, build transistor logic circuits on breadboards, and master universal NAND logic.

MyRoboPath Engineering Lab
Peer-Reviewed Open-Source Hardware & Firmware Guide

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).
Prerequisites
  • • Binary Numbers and BJT transistor switches
Required Hardware / Tools
  • • 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.

Logic gate schematic symbols chart
Figure 2.1: Standard schematic symbols for NOT, AND, NAND, OR, NOR, and XOR logic gates.Visual Guide

The 3 Primary Gates: NOT (Inverter), AND & OR

1. NOT Gate (Inverter - 74HC04):

Triangle with a negation bubble on the output:

ΣFormula
Y = NOT(A)
  • Input 0 to Output `1`
  • Input 1 to Output `0`

2. AND Gate (74HC08):

Flat back with a rounded D-shaped front:

ΣFormula
Y = A · B
  • Output is 1 ONLY IF Input A AND Input B are both 1.

3. OR Gate (74HC32):

Curved back with a pointed tip:

ΣFormula
Y = A + B
  • Output is 1 IF EITHER Input A OR Input B is 1.
NOT AND OR gate truth tables
Figure 2.2: Truth tables and Boolean algebraic equations for NOT, AND, and OR gates.Visual Guide

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!
Transistor discrete logic gate schematic
Figure 2.3: Transistor-Resistor Logic (RTL) schematic implementations for discrete AND and OR gates.Visual Guide

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!

Binary Adder FoundationCombining one XOR gate and one AND gate forms a 1-bit binary adder that can add 1 + 1 = 10 (2 in decimal).

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.

Tags:#Logic Gates#AND Gate#OR Gate#NOT Gate#NAND#XOR#Transistor Logic#Digital Electronics