1.1 Analog vs Digital: Continuous Signals vs Discrete Logic Levels

Distinguish analog and digital signals precisely, explain why digital representation is preferred for computation and storage, and describe how the ADC/DAC boundary connects the two worlds.

Every physical quantity in the real world — temperature, sound pressure, light intensity, voltage from a sensor — varies smoothly and continuously over time. An analog signal captures that quantity directly as a continuously varying value, written x(t), which can take on infinitely many values at infinitely many instants. A digital signal, by contrast, represents information using a finite set of discrete symbols — almost always just two, 0 and 1 — sampled at discrete instants and written x[n]. Digital electronics exists because discrete, two-level representations are dramatically easier to generate, store, transmit, and reason about reliably than continuous ones, and nearly every modern computing and communication system is built on this discretization of the physical world.

Continuous vs discrete: what actually changes

An analog signal x(t) is defined for every real-numbered instant of time and can take any real value within its range — a microphone's output voltage might be 0.3742...V at one instant and 0.3743...V a fraction of a second later, with no minimum step size between them. A digital signal x[n] is defined only at discrete sample instants (indexed by integer n), and at each instant it takes one of a finite number of allowed values — in binary digital electronics, exactly one of two: logic 0 or logic 1. Both the time axis (sampling) and the value axis (quantization to discrete levels) become discrete when a signal is digitized.

This is a fundamental representational choice, not just an implementation detail. Continuous amplitude means an analog signal theoretically carries infinite precision, but that precision is also infinitely fragile — any noise, however small, permanently and undetectably alters the exact value. Discrete amplitude means a digital signal only needs to preserve enough information to distinguish among a small number of levels, which is a far easier engineering problem.

Why digital wins for computation and storage

Digital systems tolerate noise far better than analog ones. A digital receiver does not need to recover an exact voltage — it only needs to decide which of two ranges (a 'low' band or a 'high' band) an incoming voltage falls into. As long as noise does not push the signal across the decision threshold between those bands, the receiver reconstructs the original 0 or 1 perfectly. An analog system has no such safety margin: any noise added to the signal becomes a permanent, unrecoverable part of the value itself, because every possible voltage is a legitimate value.

This tolerance is what makes digital information copyable without degradation. A digital value can be regenerated — read, thresholded back to a clean 0 or 1, and re-transmitted — an unlimited number of times without accumulating error, which is exactly how long fiber-optic links, RAM refresh cycles, and multi-stage logic circuits work. An analog signal degrades a little at every stage it passes through (every copy of a cassette tape is audibly worse than the last), because there is no way to 'clean up' a continuous value back to its exact original.

Digital representation also unifies every kind of information — numbers, text, audio, video, sensor readings — into the same underlying alphabet of bits, so the same logic gates, memory, and processors can store and manipulate all of it. This uniformity is the foundation the entire rest of this course builds on: once a quantity is expressed as bits, Boolean algebra and digital logic circuits become the tools for processing it.

The ADC/DAC boundary

Because the physical world is inherently analog (light, sound, temperature, pressure) but computation is digital, real systems must cross between the two domains. An Analog-to-Digital Converter (ADC) samples a continuous analog signal at regular time intervals and quantizes each sample to the nearest of a fixed set of discrete digital codes, producing the x[n] sequence a digital system can process. A Digital-to-Analog Converter (DAC) does the reverse: it takes a sequence of digital codes and reconstructs an approximate continuous voltage from them, which is why, for example, digital audio stored as bits is eventually turned back into a continuously varying voltage to drive a speaker.

A temperature sensor illustrates this concretely. The sensor itself outputs a raw analog voltage proportional to temperature — for example, 0 V representing 0°C and 1 V representing 100°C, with every intermediate voltage representing an intermediate temperature. An ADC downstream of the sensor samples that voltage and encodes it as a fixed-width digital word, such as an 8-bit pattern like 0101 1010, which a digital thermostat's processor can then store, compare, and display using ordinary logic circuits.

Notation for analog and digital signals

Parentheses, x(t), conventionally denote a continuous-time analog quantity; square brackets, x[n], conventionally denote a discrete-time (sampled) quantity — this notational distinction is used throughout signals and systems as well as digital electronics. Nearly all digital electronics is binary digital: only two symbols, 0 and 1, are used at the physical layer, even though higher-level digital data (bytes, numbers, characters) is built by combining many binary digits together.

Analog signal (continuous time, continuous amplitude):
  x(t)      -- defined for every real t, any real value

Digital signal (discrete time, discrete amplitude):
  x[n]      -- defined only at sample index n, finite set of values

Binary digital signal (the special case used throughout this course):
  x[n] in {0, 1}   -- exactly two allowed levels: logic LOW and logic HIGH

Code Examples

The sensor's analog output can be any real voltage between 0 V and 1 V, representing any real temperature between 0°C and 100°C. The ADC picks one instant in time (sampling) and rounds the voltage at that instant to the nearest of 256 discrete digital codes (quantization), producing the fixed bit pattern 0101 1010 that downstream digital logic can store and process exactly.

0101 1010 -- a discrete digital code standing in for a continuous analog voltage

Physical quantity:        Temperature (continuous, real-world)
Sensor output (analog):   0 V  -> 0 degC
                           1 V  -> 100 degC
                           (every voltage in between is a valid analog value)

After ADC sampling +
quantization (digital):    Temperature code = 0101 1010
                           (one fixed 8-bit pattern out of 256 possible codes)

Analog waveform sampled into a digital signal

The analog curve can pass through any value at any instant; the digital version only exists at discrete sample instants (n) and only takes discrete levels (here, 0 or 1 after quantization).

Analog x(t):        Digital x[n] after sampling + quantization:

 amplitude              amplitude
   |    __                | 1                  ___
   |   /  \    _           |             ___    |
   |  /    \  / \          |       ___    |     |
   | /      \/   \         | 0 ___  |     |     |
   |/______________ t      |________|_____|_____|____ n
   smooth, continuous       fixed discrete levels,
   curve, any value          sampled at fixed instants

Important Rules

Analog: continuous time and continuous amplitude, x(t), any real value at any instant.

Digital: discrete time (sampled) and discrete amplitude (quantized), x[n], drawn from a finite set of symbols — usually just {0, 1}.

Digital systems tolerate noise better because a receiver only needs to classify a voltage into a band (LOW or HIGH), not recover its exact value.

ADC converts analog to digital (sampling + quantization); DAC converts digital back to an approximate analog signal.

Digital copies do not degrade because a value can be re-thresholded back to a clean 0 or 1 at every stage; analog copies degrade because every added noise value is permanently baked into the signal.

Where this shows up

Every smartphone microphone, digital thermometer, digital camera sensor, and touchscreen begins life reading an analog physical quantity and immediately converts it to digital form with an ADC so the rest of the system — memory, processors, wireless radios — can work with it using noise-tolerant digital logic. On the output side, speakers, displays, and motor controllers use a DAC to turn digital data back into the continuous analog signals the physical world (and human senses) actually require.

Assuming digital signals are 'more accurate' than analog signals simply because they are made of clean 0s and 1s.

Understand that digitization always discards some information (quantization error) — an analog signal has, in principle, infinite precision; a digital signal only approximates it to the resolution of the ADC. Digital's advantage is not infinite precision, it is noise immunity and reliable, repeatable processing.

A digital representation is an approximation of the original analog quantity, rounded to the nearest of a finite number of levels. What makes digital systems superior in practice is that this known, bounded approximation error can be made as small as needed by design (using more bits), whereas analog signals accumulate unbounded, unpredictable noise error at every processing stage.

[conceptual] Why can digital systems tolerate some noise better than analog systems? A. Digital circuits use lower voltages, so noise is physically smaller B. A digital receiver only needs to classify an incoming voltage as 0 or 1 based on a threshold, so small disturbances that don't cross that threshold are ignored C. Digital signals are not affected by electrical noise at all D. Analog signals always operate at higher frequencies, which amplifies noise

B. A digital receiver only needs to classify an incoming voltage as 0 or 1 based on a threshold, so small disturbances that don't cross that threshold are ignored — A digital receiver interprets a whole range of voltages as logic 0 or logic 1, rather than needing the exact value. Small disturbances that do not cross the decision threshold between those ranges are simply ignored, while an analog system has no such margin because every voltage is a meaningful value.

[interview] An interviewer asks: 'Is a digital signal ever truly discrete in amplitude at the physical (voltage) level, or is it still analog underneath?' What is the best answer? A. Digital signals use special non-electrical hardware, so there is no underlying analog voltage at all B. A digital signal is physically still a continuously varying voltage; 'digital' refers to the interpretation of that voltage into a finite number of logic levels, not a different kind of physics C. Digital signals are always perfectly square waves with no analog properties whatsoever D. Digital and analog are two completely separate types of electricity

B. A digital signal is physically still a continuously varying voltage; 'digital' refers to the interpretation of that voltage into a finite number of logic levels, not a different kind of physics — Underneath, every digital signal is still carried by a real, continuously varying voltage. 'Digital' is an interpretive convention — the circuit is designed and specified so that voltages are classified into a small number of logic levels (e.g., LOW/HIGH), with thresholds and noise margins ensuring that interpretation is reliable, even though the physical signal itself is analog.

[multiple-choice] In the notation x(t) vs x[n], which correctly describes digital electronics? A. x(t) is used for digital signals because time is quantized B. x[n] is used for digital signals because they are defined only at discrete sample instants, indexed by an integer n C. Both notations mean the same thing and are used interchangeably D. x[n] is only used for audio signals, never for digital logic

B. x[n] is used for digital signals because they are defined only at discrete sample instants, indexed by an integer n — x(t) denotes a continuous-time analog signal defined for every real t; x[n] denotes a discrete-time digital/sampled signal defined only at integer sample indices n, which is the correct notation once a signal has been sampled and quantized into digital form.

A pressure sensor outputs 0 V at 0 kPa and 5 V at 100 kPa, varying linearly in between. Explain, in your own words, what steps are needed to turn this into a digital signal a microcontroller can store, and why a 12-bit ADC gives a finer digital approximation than an 8-bit ADC.

The sensor's continuous voltage must be sampled at a fixed instant and then quantized: an ADC compares the sampled voltage against a set of discrete reference levels and outputs the code of the closest one. A 12-bit ADC has 2^12 = 4096 possible codes to choose from, versus 2^8 = 256 for an 8-bit ADC, so it can represent the 0-100 kPa range with steps roughly 16 times smaller, giving a finer (lower quantization error) digital approximation of the original analog pressure.

Think about sampling (choosing when to measure) and quantization (choosing which of a fixed set of digital codes best matches the measured voltage) separately.