Exploring the Difference: Analog versus Digital
With a digital signal, everything is either on or off, no half measures. Indeed, many things work in this manner; for example, your radio is either on or off. It makes no sense for it to be anything else. However, this is not true of everything. For example, a light can be half on or dimmed. A volume control can be full on, full off, or somewhere in between. These are proportional controls.
Taking small steps
So how does a computer handle a proportional control? In a program, variables can take on any value you assign them. You can do the same with a voltage. However, the voltage is not continuously variable, but split up into small steps, or quantized. The number of small steps used is given by the resolution of the circuit. By combining several on/off signals, with each one contributing an unequal small voltage you can produce very close to whatever voltage you want. The circuit to do this is called a digital-to-analog (D/A) converter, and there are several different designs. Figure 17-1 shows one such method using four digital outputs, or as we say, four bits. Each switch is a digital output from the computer and can send current through a resistor or not, depending on whether the switch is open or closed. The important thing is the relative resistor values, not the absolute values.
Figure 17-1: Four switches and resistors make ...