Digital Electronics, Explained From the Ground Up
Everything on this page builds from two simple ideas -- HIGH and LOW -- up to the logic gates, memory, and counters that every digital device is built from. No prior knowledge assumed.
What Is Digital Electronics?
Digital electronics is the branch of electronics built around signals that only take on a small, fixed set of values — almost always just two: a "high" state and a "low" state. Rather than representing information as a smoothly varying voltage, digital circuits represent it as patterns of these two states, commonly written as 1 and 0. That simple restriction turns out to be extremely powerful: because a circuit only ever needs to distinguish "high" from "low," it can tolerate a surprising amount of electrical noise and imperfection while still working reliably, which is part of why digital systems can be built astonishingly large and complex without losing accuracy.
Almost every modern computing device, from a simple calculator to a full desktop computer, is built from digital electronics underneath. Understanding it doesn't require advanced mathematics — just a willingness to think in terms of two states, and the handful of basic building blocks this page walks through one at a time.
Analog vs Digital Signals
An analog signal can take on any value within a range — think of a dimmer switch that smoothly adjusts a light from fully off to fully bright, passing through every possible level in between. A digital signal, by contrast, only recognizes a small number of distinct states — most commonly two, referred to as HIGH and LOW, or 1 and 0.
The real world is fundamentally analog — sound, light, temperature, and motion all vary smoothly. Digital electronics works by converting these smooth analog quantities into digital representations (a process explored in an earlier part of this course), processing that digital information with extreme precision and reliability, and then, when needed, converting it back to an analog form a person can see, hear, or feel.
Number Systems: Binary, Decimal, and Hexadecimal
Because a digital circuit only recognizes two states, digital systems naturally count in binary — base 2 — using only the digits 0 and 1. Each binary digit is called a bit. A group of 8 bits is called a byte, and a single byte can represent 256 different values (2 to the power of 8), enough to encode, for example, a single character of text.
Binary numbers get long quickly, so engineers often use hexadecimal (base 16) as a shorthand — each hexadecimal digit represents exactly four binary bits, so a long string of 1s and 0s can be written far more compactly.
| Decimal | Binary | Hexadecimal |
|---|---|---|
| 0 | 0000 | 0 |
| 5 | 0101 | 5 |
| 10 | 1010 | A |
| 15 | 1111 | F |
| 100 | 01100100 | 64 |
| 255 | 11111111 | FF |
Converting between these systems is a matter of practice rather than difficulty — most digital electronics work only ever needs comfort with a handful of small values, not fluency with large conversions done by hand.
Logic Levels and Noise Margins
In a real circuit, "HIGH" and "LOW" aren't a single exact voltage each — they're a range. A typical digital system might treat anything above roughly 70% of its supply voltage as a valid HIGH, and anything below roughly 30% as a valid LOW, leaving a middle band that's considered invalid or undefined. This built-in cushion is called a noise margin, and it's exactly what makes digital circuits so tolerant of small amounts of electrical interference — a little noise riding on a signal doesn't change whether it's read as HIGH or LOW, as long as it doesn't push the signal across that boundary.
The Basic Logic Gates
A logic gate is a small circuit that takes one or more digital inputs and produces a single digital output, following a fixed rule. Every digital system, no matter how complex, is ultimately built from these few basic gates combined together.
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
AND outputs 1 only when every input is 1. OR outputs 1 when at least one input is 1. NOT simply flips its single input. NAND and NOR are AND and OR with their outputs inverted, and XOR ("exclusive OR") outputs 1 only when its inputs differ from each other. These seven behaviors, combined in different patterns, are enough to build any digital function that exists.
Boolean Algebra Basics
Boolean algebra is a formal system of mathematics built entirely around two values — true and false, or 1 and 0 — and the same AND, OR, and NOT operations covered above. It gives engineers a written, symbolic way to describe and simplify digital logic before ever building a circuit. A few of its rules mirror ordinary algebra (like A AND (B OR C) = (A AND B) OR (A AND C)), while others are unique to working with just two possible values (like A OR NOT A always being true, since one of the two must hold).
Simplifying a Boolean expression before building a circuit can directly reduce the number of physical gates needed — fewer gates means a smaller, cheaper, faster, and more power-efficient design, which is exactly why this "paper-first" simplification step matters in real digital design work.
Combinational vs Sequential Logic
Digital circuits split into two broad categories. Combinational logic — built purely from gates like the ones above — has an output that depends only on its current inputs, with no memory of anything that happened before. Sequential logic adds memory elements, so its output can depend on both the current inputs and the circuit's past — the same current input might produce a different output depending on what state the circuit is already in.
A simple calculator's addition circuit is combinational — the same two numbers always produce the same sum. A counter that increases by one every time a button is pressed is sequential — it has to remember its current count to know what to do next.
Flip-Flops, Registers, and Memory
The basic memory element of sequential logic is called a flip-flop — a small circuit that can store a single bit (a 1 or a 0) and hold onto it until it's deliberately told to change, usually on a precise clock signal. Wire several flip-flops together, sharing the same clock, and you get a register — a small block of memory that can hold a whole group of bits at once, such as one byte.
Registers are the basic scratch memory inside any digital processor — every calculation a processor performs passes through registers at some point, holding the numbers being worked on before and after each step.
Counters: Counting in Hardware
A counter is a sequential circuit built from chained flip-flops, arranged so that each pulse on its input (often a clock signal) advances its stored value by one, wrapping back to zero once it reaches its maximum. Counters appear anywhere a digital system needs to track a repeating quantity in hardware — dividing a fast clock signal down to a slower one, keeping track of elapsed time, or sequencing a set of steps in order, one after another.
Multiplexers and Demultiplexers
A multiplexer (often shortened to "mux") is a circuit with several data inputs, one output, and a set of "select" inputs that choose which one data input gets routed through to that output at any given moment — effectively a digital rotary switch, controlled electronically instead of by hand. A demultiplexer does the reverse: one data input, several outputs, and select inputs that choose which single output receives that data.
These two circuits are what let many digital signals share the same limited set of physical wires or pins, taking turns rather than each needing its own dedicated path — an important trick for keeping complex digital systems from needing an impractical number of connections.
Encoders and Decoders
A decoder takes a small binary number as input and activates exactly one of many outputs, corresponding to that number — useful for, say, turning a 3-bit binary value into one of eight separate "select" signals. An encoder does the reverse: given one of many active input lines, it outputs the binary number corresponding to which one is active.
These two circuits appear constantly wherever a system needs to translate between "one active line among many" and "a compact binary number representing which one" — a very common need inside larger digital designs.
Digital IC Families
Rather than wiring individual gates from scratch every time, digital designers most often use pre-built integrated circuits (chips) that package a handful of standard gates, flip-flops, or counters into one part. These chips are grouped into families that share a common electrical design approach — a common supply voltage range, switching speed, and current-driving capability — so that chips from the same family can be mixed and matched in a single design with predictable behavior. Choosing an appropriate family for a project is mostly a matter of matching supply voltage, switching speed, and power-consumption needs to the rest of the design.
Where Digital Electronics Shows Up
Once you can recognize the building blocks on this page, you start noticing digital electronics everywhere: a digital clock's counters ticking off seconds and minutes, a traffic-light controller's sequential logic stepping through a fixed pattern, a calculator's combinational logic adding two numbers, a keypad's encoder converting a pressed key into a binary code, and a memory chip's registers holding data. Every one of these is an assembly of the same simple pieces covered here — gates, flip-flops, counters, multiplexers, encoders — combined in different arrangements to do different jobs.