Logic Circuits- Complete Digital Guide
What Logic Circuits Actually Are
Logic circuits are the foundation of every digital device you own. Your phone, your laptop, your microwave—none of them work without logic circuits making yes/no decisions at lightning speed.
A logic circuit takes binary inputs (0s and 1s, or LOW and HIGH) and produces a binary output based on defined rules. That's it. No magic, no complexity—just controlled electrical switching.
The building blocks are called logic gates. Each gate performs a basic operation. Combine them, and you get everything from a calculator to a CPU.
The Seven Essential Logic Gates
You need to know these seven gates. Memorize them if you're serious about digital electronics.
NOT Gate (Inverter)
The simplest gate. It flips the input. 0 becomes 1, 1 becomes 0.
Symbol: Triangle with a circle at the output
Truth Table:
| Input | Output |
|---|---|
| 0 | 1 |
| 1 | 0 |
AND Gate
Output is 1 only when both inputs are 1. Anything else? Output is 0.
OR Gate
Output is 1 when at least one input is 1. Only fails when both inputs are 0.
NAND Gate
AND gate with its output inverted. This is the most important gate in practice—every other gate can be built from NAND alone. Engineers call it a universal gate.
NOR Gate
OR gate with its output inverted. Also universal. Less common in modern designs but still useful.
XOR Gate (Exclusive OR)
Output is 1 when inputs are different. When both are 0 or both are 1, output is 0.
XNOR Gate
XOR with inverted output. Output is 1 when inputs are the same.
Truth Tables: Your Reference Guide
| A | B | AND | OR | NAND | NOR | XOR | XNOR |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Two Types of Logic Circuits
Combinational Logic
Output depends only on current inputs. No memory. Feed the same inputs in, get the same outputs every time.
Examples:
- Adders (binary addition)
- Multiplexers (input selectors)
- Decoders (converting codes)
- Encoders (compression)
Sequential Logic
Output depends on inputs and current state. These circuits have memory. They remember previous inputs.
Examples:
- Flip-flops (1-bit memory)
- Registers (multi-bit storage)
- Counters (sequential counting)
- State machines (decision logic over time)
Sequential circuits require a clock signal—a pulsing signal that synchronizes operations.
Boolean Algebra: The Math Behind Logic
Logic gates follow Boolean algebra rules. You need to know these basic operations:
- AND = multiplication (A · B or AB)
- OR = addition (A + B)
- NOT = inversion (A' or Ā)
Key laws:
- A · 0 = 0 (anything AND 0 is 0)
- A · 1 = A (anything AND 1 is itself)
- A + 1 = 1 (anything OR 1 is 1)
- A + 0 = A (anything OR 0 is itself)
- A + A = A
- A · A = A
- A + A' = 1
- A · A' = 0
De Morgan's Theorems are also essential:
- (A · B)' = A' + B'
- (A + B)' = A' · B'
These let you convert AND to OR and vice versa when NOT is involved.
How Logic Circuits Are Built
TTL (Transistor-Transistor Logic)
Old technology. Uses bipolar transistors. Works on 5V. You'll find it in legacy equipment and some educational kits.
- 74xx series chips are common
- 7400 = Quad 2-input NAND
- 7402 = Quad 2-input NOR
- 7432 = Quad 2-input OR
- 7408 = Quad 2-input AND
- 7486 = Quad 2-input XOR
CMOS (Complementary Metal-Oxide Semiconductor)
Modern standard. Uses MOSFETs. Lower power consumption, works at various voltages (1.8V to 15V).
- 40xx series chips
- 4011 = Quad 2-input NAND
- 4001 = Quad 2-input NOR
- 4071 = Quad 2-input OR
- 4081 = Quad 2-input AND
FPGAs (Field Programmable Gate Arrays)
Programmable chips. You define the logic in software. One chip replaces thousands of discrete gates.
Vendors:
- Xilinx (now AMD)
- Intel FPGA (formerly Altera)
- Lattice Semiconductor
ASICs (Application-Specific Integrated Circuits)
Custom chips built for one purpose. Millions of gates on a single die. Your phone's processor is an ASIC. Expensive to design, but efficient at scale.
Practical Applications
Here's where logic circuits show up in the real world:
- Microprocessors — Billions of transistors implementing logic functions
- Memory — Flip-flops store each bit
- Communication — Encoding/decoding signals
- Control systems — Industrial automation, safety circuits
- Cryptography — XOR operations for encryption
- Displays — Multiplexing drivers for LED matrices
Getting Started: Build Your First Logic Circuit
You need three things:
- Basic logic ICs (7400 series or 4000 series)
- Breadboard
- Power supply (5V for TTL, 9V battery works for CMOS)
- LEDs and resistors (220-470Ω)
- Switches or jumper wires for inputs
Step 1: Get a 7400 chip (quad NAND). Pin 14 is VCC (+5V), pin 7 is GND.
Step 2: Connect power. Never skip this. Dead chips happen when you forget.
Step 3: Wire two inputs to pins 1 and 2. Connect an LED with resistor to pin 3 (output).
Step 4: Toggle inputs between HIGH (+5V) and LOW (GND) using jumper wires. Watch the LED.
Step 5: Verify the truth table matches NAND behavior.
That's it. You've built a working logic circuit.
Design Tools Worth Using
| Tool | Type | Cost | Best For |
|---|---|---|---|
| Logisim | Simulation | Free | Learning, simple circuits |
| Digital | Simulation | Free | Cross-platform, modern UI |
| Proteus | Full IDE | Paid | PCB design + simulation |
| Quartus | FPGA | Free (web version) | Intel FPGA programming |
| Vivado | FPGA | Free (webpack) | Xilinx FPGA programming |
Common Mistakes Beginners Make
- Floating inputs — Never leave gate inputs disconnected. They pick up noise and produce unpredictable results. Tie unused inputs to HIGH or LOW.
- No current-limiting resistors — LEDs fry instantly without them.
- Mixing TTL and CMOS — Voltage levels differ. 5V TTL reads 2V as HIGH. CMOS needs proper voltage thresholds.
- Forgetting decoupling capacitors — Place 100nF caps near each IC's power pins. Digital circuits switch fast and draw current spikes.
- Overcomplicating — If a NAND gate solves your problem, don't use four other gates.
From Logic Gates to Microprocessors
Modern CPUs contain billions of logic gates working together. Here's the hierarchy:
- Transistors → physical switches
- Logic gates → basic operations (AND, OR, NOT)
- Adders, multiplexers → functional units
- ALU (Arithmetic Logic Unit) → arithmetic and logic operations
- Registers, cache → fast memory
- Control unit → instruction execution
- CPU → the whole thing integrated
Understanding logic circuits gives you the foundation to grasp all of it.
What to Learn Next
- Karnaugh maps (K-maps) for simplifying boolean expressions
- State machine design for sequential circuits
- HDL (VHDL or Verilog) for programmable logic
- Timing analysis and propagation delays
Start with K-maps. They make circuit optimization intuitive instead of mathematical.