Fiveable

🫠Intro to Engineering Unit 6 Review

QR code for Intro to Engineering practice questions

6.4 Introduction to digital electronics and logic gates

6.4 Introduction to digital electronics and logic gates

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🫠Intro to Engineering
Unit & Topic Study Guides

Digital electronics form the foundation of nearly every modern device, from smartphones to cars to medical equipment. Understanding how digital circuits process information using just two states (0 and 1) is a core skill in electrical engineering. This guide covers the difference between analog and digital signals, how logic gates work, and how engineers combine them to build useful circuits.

Analog vs Digital Signals

Continuous vs Discrete Signals

The key distinction here is straightforward: analog signals are continuous, meaning they can take on any value within a range, while digital signals are discrete, meaning they jump between a limited set of values. In practice, digital signals use just two values: 0 and 1 (binary).

  • Human voice and natural sounds are analog: the sound wave varies smoothly and continuously over time
  • Computer data and digital audio files are digital: they're stored and transmitted as sequences of 0s and 1s
  • An analog-to-digital converter (ADC) samples an analog signal and translates it into digital form. Your phone's microphone uses one every time you make a call.
  • A digital-to-analog converter (DAC) does the reverse, turning digital data back into a continuous signal. This is how your headphones produce sound from a digital music file.

Advantages of Digital Signals

So why did the engineering world shift toward digital? A few major reasons:

  • Noise resistance. Digital signals are far less affected by electrical noise and interference. Since the circuit only needs to distinguish between "high" and "low," small disturbances don't corrupt the data.
  • Reliable transmission and storage. Digital signals maintain quality over long distances. Old analog telephone lines picked up static over distance, but digital phone signals don't degrade the same way.
  • Perfect copying. You can duplicate a digital file with zero loss. Think of copying a music file on your computer versus dubbing a cassette tape, where each copy sounds slightly worse.
  • Easier processing. Digital data is much simpler to compress, encrypt, and error-correct using algorithms.

Logic Gates and Their Functions

Continuous vs Discrete Signals, Digitalsignal – Wikipedia

Basic Logic Gates

Logic gates are the building blocks of all digital circuits. Each gate takes one or more binary inputs and produces a single binary output based on a specific rule.

  • AND gate: Outputs 1 only when all inputs are 1. If any input is 0, the output is 0. Think of it like two switches in series: both must be ON for current to flow.
  • OR gate: Outputs 1 if at least one input is 1. The output is 0 only when every input is 0. This is like two switches in parallel: either one being ON lets current through.
  • NOT gate (inverter): Takes a single input and flips it. Input 1 becomes output 0, and vice versa.
  • NAND gate: The inverse of AND. It outputs 0 only when all inputs are 1; otherwise it outputs 1.
  • NOR gate: The inverse of OR. It outputs 1 only when all inputs are 0; otherwise it outputs 0.
  • XOR gate (Exclusive OR): Outputs 1 when the inputs are different. For a two-input XOR, the output is 1 when exactly one input is 1. More generally, it outputs 1 when the number of 1-inputs is odd.

Truth Tables and Gate Symbols

A truth table lists every possible combination of inputs alongside the corresponding output. For a gate with 2 inputs, there are 4 rows; for 3 inputs, 8 rows; and so on (2n2^n rows for nn inputs).

Here's a truth table for a 2-input AND gate as an example:

ABOutput
000
010
100
111

In circuit diagrams, each gate has a standard symbol. The AND gate looks like a D-shape, the OR gate has a curved back, and the NOT gate is a triangle with a small circle (bubble) at the output. Inputs are drawn on the left, and the output exits on the right.

Combinational Logic Circuit Design

Continuous vs Discrete Signals, Analog To Digital Conversion - Sampling and Quantization - Electronics-Lab.com

Boolean Algebra Fundamentals

Boolean algebra is the math behind digital circuit design, developed from the work of George Boole. It uses the same three core operations as the basic logic gates:

  • AND is written as ABA \cdot B (or just ABAB)
  • OR is written as A+BA + B
  • NOT is written as AA' or A\overline{A}

You can simplify Boolean expressions using familiar-looking rules:

  • Commutative: A+B=B+AA + B = B + A and AB=BAA \cdot B = B \cdot A
  • Associative: (A+B)+C=A+(B+C)(A + B) + C = A + (B + C)
  • Distributive: A(B+C)=AB+ACA \cdot (B + C) = A \cdot B + A \cdot C

De Morgan's Theorems are especially important for converting between gate types:

  • AB=A+B\overline{A \cdot B} = \overline{A} + \overline{B} (the complement of AND equals OR of the complements)
  • A+B=AB\overline{A + B} = \overline{A} \cdot \overline{B} (the complement of OR equals AND of the complements)

These theorems show up constantly when you're simplifying circuits or converting to universal gates.

Design Techniques and Tools

The typical process for designing a combinational logic circuit:

  1. Start with a problem statement or specification describing what the circuit should do.
  2. Build a truth table that captures every input combination and the desired output.
  3. Derive a Boolean expression from the truth table.
  4. Simplify the expression using Boolean algebra or a Karnaugh map (K-map).
  5. Draw the circuit using the appropriate logic gates.

K-maps are a graphical tool that makes simplification visual. You plot the truth table values on a grid and group adjacent 1s together. Each group corresponds to a simplified term in the Boolean expression, reducing the total number of gates you need.

Don't-care conditions are input combinations that will never occur in practice (or whose output doesn't matter). Marking these on a K-map gives you more flexibility to form larger groups, leading to even simpler circuits.

For complex designs, engineers use CAD software like Quartus Prime to automate optimization and verify that the circuit behaves correctly before building it.

Logic Function Implementation with Universal Gates

NAND and NOR as Universal Gates

NAND and NOR gates are called universal gates because either one, by itself, can implement any Boolean function. This is a big deal for manufacturing: a chip factory can produce just one type of gate and build any circuit from it.

Here's how you build the three basic gates using only NAND gates:

  1. NOT: Connect both inputs of a NAND gate to the same signal. Since AA=A\overline{A \cdot A} = \overline{A}, you get an inverter.
  2. AND: Use a NAND gate followed by a NOT (which is itself a NAND gate, as above). The NAND inverts the AND result, and the second NAND inverts it back.
  3. OR: Apply NOT gates (NAND-based) to each input, then feed the results into a NAND gate. By De Morgan's theorem, AB=A+B\overline{\overline{A} \cdot \overline{B}} = A + B.

NOR gates work the same way, just with a different set of configurations to produce NOT, OR, and AND.

Implementation Techniques

Once you know a function can be built from universal gates, there are practical techniques to optimize the design:

  • Bubble pushing is a visual shortcut where you move the inversion bubbles (the small circles on gate symbols) through a circuit diagram. This helps you convert between NAND/NOR implementations without re-deriving the Boolean expression from scratch.
  • In CMOS technology (the most common chip-making process), NAND gates are generally preferred because they require fewer transistors than NOR gates, making them smaller and more power-efficient.
  • NOR gates are sometimes chosen in specific applications. For example, SRAM memory cells often use cross-coupled NOR gates because of their speed characteristics.

The choice between NAND and NOR implementation comes down to the specific technology, power budget, and speed requirements of the design.