There was one component that I skipped in my article last week. It wasn’t actually present on my breadboard, but it is present on both the graphics PCI card and the 10/100 ethernet PCI card on my desk. This component can take many physical shapes, but it’s common to see them as a silvery metal oval with flat sides. This component is called a crystal oscillator and is undoubtedly the most critical component in all complex digital circuitry.
Digital circuitry is discrete by definition (1s and 0s). The opposite of digital circuitry is analog circuitry (which has been the bulk of what I’ve talked about in my articles). Digital circuitry expects the electricity being used to exist in one of two discrete states, either on or off. What constitutes “on” is arbitrary and will depend on the exact application, though in demos and educational material, it’s commonly 5VDC, but the exact value isn’t important, as long as it’s consistent. An “on” signal will always be 5VDC (within some narrow tolerance) and an “off” signal will be 0VDC (again, within some narrow tolerance).
Analog circuitry isn’t concerned with being in any particular state, and in fact is expected to range infinitely between two values. The sine wave of standard household AC power is an analog signal. At some point in time, the voltage will be every single value between -120V and +120V. This property is often used to our advantage, in step-up/step-down transformers for example. It isn’t very useful for digital circuits though.
Because digital circuits are discrete, a good way to think about them is as a series of switches. In circuits, these are often called “gates” and they’re usually composed of transistors in various arrangements. There can be millions if not billions of these little gates/switches inside even modestly complex digital circuits. If all those switches are going on and off on their own, digital circuits wouldn’t be able to do anything. It would be like a million-piece orchestra without a conductor.
A clock signal is used to synchronize and coordinate all of those switches, much like a conductor’s baton keeping pace for an orchestra. Every time the clock “ticks” a series of signals are passed through the digital circuitry, from one stage to the next, over and over and over. For something complex like a CPU (central processing unit) in any modern-day computer, the clock signal needs to be fast (as in billions of ticks per second fast) and accurate.
You might be thinking, “Hadley, you mentioned a 555 timer/signal chip a few weeks ago, why don’t we just use that?” Some digital circuits do. When I took a computer logic and organization class in college, we built a small computer from scratch on a breadboard and we used a 555 chip as the clock. This is great for learning purposes because the 555 can be made to tick pretty slowly. We were able to actually watch the computers we built tick through work at the sub-instruction level. Chips like the 555 are limited however based on the rise/fall time of the signals they create. Anything over 2MHz for a clock speed would be pushing it.
To finally bring it back around, this is why we use crystal oscillators like the ones on my PCI cards to generate that clock signal. They can be made to accurately tick billions of times a second if necessary and are cheap, small and simple. In fact, they’ve been in use outside computers for decades. The crystal inside the oscillator is made from quartz. Hence, quartz-crystal wrist watches. The details of how these oscillators actually work delves into piezoelectrics and some other physics I don’t have time for here, but may discuss in a later article.
The oscillation speed of the crystal oscillator and clock signal in a computer can be thought of as a speed limit. The circuit cannot process data faster than the clock ticks. So the clock cannot tick faster than the slowest component, lest it skip a tick and data gets all mixed up. Some types of memory circuits tend to be slow in operation and so the clock must be set to tick only that fast.
Hopefully this all makes sense and I was able to illuminate a critical part of every digital circuit we use today!