CE2704 · Digital Logic Design
Theme 1 · Numbers & codes

Why digital?

The world is analog, but the machine is digital. This topic is why almost every modern engineering system keeps its "brain" in 1s and 0s.

Built from first principles. Opening topic of the course.

Before you start

What you need first

  • Nothing — this is the first topic. Just curiosity about how the electronics around you actually work.

What you'll be able to do

  • Say what a signal is, and tell analog from digital.
  • Explain in your own words why digital won.
  • Describe quantization and the bits-vs-resolution trade-off.

What do we mean by "signal"?

A signal is any physical quantity that carries information over time — a voltage on a wire, air pressure on a microphone, light on a camera sensor, the angle of a steering wheel.

As engineers we don't care what carries the signal. We care what it represents and how reliably we can read and process it.

Every signal falls into one of two families — analog or digital. This whole course is about the digital kind, so let's see the difference first.

Analog: smooth and continuous

An analog signal varies continuously: between any two values there are infinitely many in-between values. A thermocouple voltage, a microphone's output, a volume knob, a brake-line pressure sensor — all analog.

The problem: a little noise is added at every wire, amplifier, and connector. You can never be sure which part is the real signal and which is the noise.
time value
An analog wave takes every intermediate value.

Digital: a small set of fixed levels

A digital signal takes only a small, fixed set of allowed values — in modern electronics almost always two:

  • 0 — a low voltage (e.g. 0 V).
  • 1 — a high voltage (e.g. 3.3 V or 5 V).

Why two? A switch is on or off; a transistor conducts or it doesn't. Two states are the easiest thing to build reliably out of physics.

0 1 0 1 time
A digital signal jumps between two well-defined levels.

Why digital won

  1. Noise immunity. A "1" is anything above a threshold, a "0" anything below. As long as noise doesn't cross the threshold, the original value is recovered exactly.
  2. Perfect copying. A digital file copies bit-for-bit, a million times, with no loss. (Try copying an audio cassette ten times.)
  3. Cheap storage & transmission. SSDs, hard drives, Ethernet — all natively digital.
  4. You can compute on it. Logic gates and software process digital signals far more flexibly than analog circuits can.
  5. Programmability. One general-purpose digital chip can be reprogrammed to do almost anything; an analog circuit is wired for one job.
The pattern in almost every modern system: analog sensors → ADC → digital processing → DAC → analog actuators. The brains are digital.

The price we pay: quantization

To store an analog quantity digitally we must quantize it — round it to the nearest allowed step. With \(n\) bits you get \(2^n\) levels:

  • 8 bits → \(2^8 = 256\) levels
  • 12 bits → \(2^{12} = 4096\) levels
  • 16 bits → \(2^{16} = 65{,}536\) levels
The trade-off: more bits = finer resolution = closer to the real value, but more memory and slower processing. A CD uses 16 bits; a voice phone call, 8; a toy thermostat, 8 is plenty.
time
The digital "staircase" (teal) approximates the analog curve (dashed).

✏️ Try it yourself

(a) Classify each as analog or digital: a microphone's voltage; a doorbell button; a mercury thermometer; the data on a USB cable.
(b) How many levels does a 10-bit ADC have?

(a) microphone = analog (smooth); doorbell = digital (two states); mercury thermometer = analog (continuous); USB = digital (stream of 0s and 1s). (b) \(2^{10} = 1024\) levels.

Recap — the whole topic on one screen

IdeaWhat you own now
SignalA physical quantity carrying information over time
AnalogContinuous — infinitely many values; vulnerable to noise
DigitalA few fixed levels (usually two: 0 and 1); noise-immune
Why digital wonNoise immunity, perfect copying, cheap storage, computable, programmable
QuantizationRounding to \(2^n\) levels; more bits = finer but costlier

Next topic

Number bases & place value

If the machine speaks only 0 and 1, how do we write real numbers with it? Next we meet binary, octal and hex — and the single idea (place value) behind all of them.

→ Number bases & place value