[From the last episode: We looked at one of the main challenges of trying to operate things at really low voltages]
We’ve seen how voltageVoltage is what gets electrons to flow. It's analogous to water pressure, which gets water to flow. Voltage is measured in units of "volts." has a big impact on powerThe rate of energy consumption. For electricity, it’s measured in watts (W). and energy consumption. Now we’ll look at one of the other major factors: the frequencyThe rate of change of a signal, specified in hertz, or cycles per second..
But… what do we even mean by that? Frequency of what? Well, digital circuits are very carefully timed. You can think of it like an inner-city traffic grid, where the traffic lights are carefully timed to make sure that traffic flows well in all directions (or as well as possible).
Note that this might not be the fastest possible way to operate things. For instance, in the middle of town, even with timed lights, you might arrive too early and have to wait. That might seem inefficient, but it’s done in the interest of keeping everything flowing, not just you.
The same thing happens with circuits. There are techniques that don’t make things “wait for the light”; they’re called asynchronous – as in, they’re not synchronized. Things happen “when they’re ready” rather than “when someone says to move forward.” But these circuits, especially on a grand scale, are super hard to manage and debug. Imagine city traffic with no lights; everyone just goes when they can. It’s tough to keep things going smoothly.
Clocks to the Rescue
So instead, we synchronize everything using a clock. A clock is pretty much just a ticking signal that, in the purest form, starts and stops with the power. Otherwise, it’s just ticking away. With each tick, all the logic takes another step.
The model for this is to take all of the logic and break it up with registers. Registers (or flip-flops, as they’re also known) simply store a value. So signals go through some logic and then get captured in a register, where they then drive the next chunk of logic. Some signals may go through a lot of logic and get to the register just barely in time – right before the light changes. Others might have just a little bit of logic and get there early, waiting around. Nothing goes into the register until the clock ticks.
How much logic is between the registers is an important factor when deciding how fast the clock can go. Obviously, the faster the clock, the faster you get things done. But if you go too fast, then you clock the registers before that signal going through lots of logic gets to the register to be clocked in. So now the logic is messed up – the system is out of synch.
So, the clock speed is determined in part by the slowest part of the logic. As a side note, one trick commonly used is, if there’s too much logic between registers, then put another register in the middle to break that logic into two smaller chunks. Of course, then you need to adjust the rest of the system to account for this extra step. But it’s totally doable (sometimes referred to as pipelining).
Creating a Clock
Clock design is a critical part of the design of an IC. In older circuits, there was one single clock driven by one pin. But these days, with the kind of tight timing we’re using to get high performance, the clock signal has to get pretty much everywhere on the very large chipAn electronic device made on a piece of silicon. These days, it could also involve a mechanical chip, but, to the outside world, everything looks electronic. The chip is usually in some kind of package; that package might contain multiple chips. "Integrated circuit," and "IC" mean the same thing, but refer only to electronic chips, not mechanical chips. in a way that gets it to every register at exactly the same time. It can’t get there earlier for the nearby registers and later for the far-away ones.
That means that designers create what they call a clock tree, which takes the original clock signal and carefully delivers it everywhere. Clock tree design is such an important part of the process that many design tools have automated clock-tree insertion that tries to do the best job possible of placing the clocks – better (and certainly faster) than could have been done by hand.
These days, there are often more than one clock, and they may go at different speeds. Each region of the circuit that has the same clock is called a clock domain. There are several ways to create domains:
- They might come from completely independent clock pins, so they have nothing to do with each other.
- They might come from a single pin, but then run through a circuit that can generate a different (usually lower) frequency.
- They might come from a single pin, but then be shifted a little bit earlier or later (a so-called phase shift).
- They might come from a single pin, but have the ability to be shut down when that particular clock domain isn’t being used (sometimes called clock gating).
As we’ll see next time, how this works can have a big impact on energy consumption.
Leave a Reply