When a rain cloud dims your classroom, what number does the computer see?
You press a button and it clicks. Then a rain cloud dims the daylight in your classroom. A computer can read whether the button is pressed or released, but the light can change by tiny amounts. How does the computer turn that change into a number?
When you release this push button, the switch is open. A resistor keeps the input connected to ground, so it reads low. Press the button and the switch closes. It connects the input to the positive supply, so the input reads high.
As the cloud moves away, follow the light sensor voltage from zero point six volts to three volts. It passes through every voltage in between. A signal that can vary continuously like this is an analogue input. The button input, read as low or high, is digital.
The daylight changes gradually as the cloud moves. The button stays released. Which signal can take a continuous range of values during that time? Pick the answer that describes what the input does.
Follow the rising voltage. At one second, the system measures one point two volts. At two seconds, it measures one point eight volts. At three seconds, it measures two point four volts. Each dot is a sample. Between the dots, the voltage keeps changing without being measured.
An analogue-to-digital converter takes a voltage sample and rounds it to the nearest level: zero, one, two or three volts in this example. That rounding is called quantisation. The converter outputs the matching two-bit code: zero zero, zero one, one zero or one one, in that order.
At three seconds, the sample is two point four volts. It’s zero point four volts above two volts and zero point six volts below three volts. The first gap is smaller, so choose the two-volt level. Its two-bit code is one zero.
A later sample measures two point six volts. Use the same four levels: zero, one, two and three volts. Which two-bit code does the converter output? Pick the code that matches the nearest voltage level.
One point eight volts rounds to two volts and gives the code one zero. Two point four volts rounds to the same level and gives the same code. So seeing one zero doesn’t mean the sample was exactly two volts. You know the chosen level, but you can’t recover the exact sample.
If asked to distinguish between analogue and digital input, state that analogue inputs can vary continuously, while digital inputs have discrete values. Light intensity varies continuously, and the sensor voltage represents it. The converter’s two-bit reading is digital. Another pair of examples is a microphone voltage and a push button read as low or high.