Two kinds of electronics
Every electronic circuit handles signals: voltages or currents that carry information. Section 19.2 sorts circuits into two families by the kind of signal they work with. (The book spells it analog; British English writes analogue. Both mean the same thing.)
Analogue signals
In an analogue circuit a voltage or current can take any value within its range and changes smoothly and continuously with time. A graph of an analogue signal is an unbroken curve, like a wave on the sea.
Everyday examples:
- the pointer of an analogue meter, which can stop anywhere along a continuous scale;
- a dimmer or variable resistor that lets a lamp glow at any brightness from dim to full;
- an amplifier, which makes a small, smoothly varying signal (for example from a microphone) larger.
Most quantities we sense directly are analogue: the loudness of a sound, the brightness of light and the temperature of a room all vary continuously.
Digital signals
In a digital circuit the voltage has only two allowed values: high, for example about 5 V, and low, close to 0 V. High stands for the binary digit 1 and low for 0. A graph of a digital signal is a row of square steps, jumping straight up to high and straight down to low, never sloping in between.
A simple ON/OFF switch for a lamp is a digital system: the lamp is either fully on or fully off, with nothing in between. Digital electronics began in computers but now runs mobile phones, radar, industrial machines, medical equipment and household appliances. Inside them, the circuits are built from switching units (logic circuits) that turn incoming voltages into strings of high and low pulses.
| Feature | Analogue | Digital |
|---|---|---|
| Values allowed | any value in a range | only two: high (1) and low (0) |
| Shape of the graph | smooth, continuous curve | square steps between two levels |
| Examples | dimmer, amplifier, pointer meter | ON/OFF switch, computer, digital clock |
| Effect of electrical noise (beyond the book) | noise changes the value and stays in it | small noise does not change a 1 into a 0 |
Why digital signals are more reliable (beyond the book)
Every signal picks up random electrical noise as it travels along a cable or through the air. In an analogue signal any added wobble becomes part of the value and cannot be separated out again. In a digital signal the receiver only has to decide "high or low?". A little noise does not change that decision, so the signal can be cleaned up and sent on as perfect 1s and 0s. That is why long-distance links, phones and computers use digital signals.
From analogue to digital: the ADC
Digital circuits cannot process a sound or a light level directly, because these are analogue. An analogue-to-digital converter (ADC) turns the continuous signal into binary numbers in three steps:
- Sampling. The signal's value is measured at regular, equal time intervals. Between samples, nothing is recorded.
- Quantisation. Each measured value is rounded to the nearest of a fixed set of allowed levels.
- Encoding. Each level is written as a binary number made of 0s and 1s.
The reverse job is done by a digital-to-analogue converter (DAC): it turns the stored binary numbers back into a smoothly varying voltage, for example to drive a loudspeaker when music is played from a phone.
Worked example 1: quantising and encoding (beyond the book)
A 3-bit ADC measures voltages from 0 V to 7 V. Three bits give levels, so each level is 1 V apart: 0 V is 000, 1 V is 001, up to 7 V, which is 111. Three samples are taken: 2.2 V, 4.6 V and 6.9 V. Find their codes.
- 2.2 V rounds to level 2, written 010.
- 4.6 V rounds to level 5, written 101.
- 6.9 V rounds to level 7, written 111.
The rounding is why some detail is lost. More bits give more levels: an 8-bit ADC has levels, so its steps are much finer.
Worked example 2: how much data? (beyond the book)
A simple voice recorder samples a sound 8000 times every second and stores each sample as 8 bits. How many bytes does a 3.0 s recording need?
Since 8 bits make 1 byte, each 8-bit sample is exactly one byte.
Analogue and digital in the simulation
The circuit builder can show both kinds of control on the same lamp.
- Choose Empty from Starting circuits. Build a single loop: battery, Lamp and Variable resistor, linked by pieces of Wire.
- Select the variable resistor and move its Resistance slider. The lamp's brightness, and the current shown for it, change smoothly through every value in between: an analogue control.
- Now replace the variable resistor with a Switch. Selecting it and ticking Switch closed puts the lamp fully on; unticking it turns it fully off. There are only two states, like the 1 and 0 of a digital signal.