C7 · Lesson 46 · Low-power digital design
Clock gating, voltage scaling and power gating
A phone's battery and a server's electricity bill are both set by the same formula, , plus leakage. Each term is a lever. Stop clocking registers that have nothing to do, and their activity falls to zero. Lower the supply when the work allows a slower clock, and the energy per operation falls as the square of the voltage. Cut the power to blocks that are asleep, and their leakage disappears. Modern chips pull all three levers constantly.
Play
- The curves show, against supply voltage, how fast the logic can run, how much power it draws at that speed, and how much energy each operation costs, all relative to 1 V.
- Lower the voltage: the speed falls, the power falls faster, and the energy per operation falls as .
- Raise the threshold voltage: the speed collapses sooner as the supply approaches it.
Predict
A processor halves its clock frequency without changing its supply. What happens to the energy it uses for each operation?
It stays the same. The power halves, but each operation takes twice as long, so the energy per operation, , doesn't change. Only lowering the voltage, which the slower clock now allows, cuts the energy, and then it falls as . Slowing down without lowering the supply saves nothing for a fixed amount of work.
Name it
Where the power goes
The clock network and the registers it feeds switch every cycle ( = 1 for the clock itself), so they often take a third or more of the dynamic power.
Clock gating
A register that doesn't need to change can simply not be clocked. A clock gate (a latch and an AND gate, so the gated clock never glitches) stops the clock to a group of registers while their enable is off. Their switching, and the clock wiring behind the gate, drops to zero. Synthesis tools insert gates automatically wherever a register has a load enable.
Dynamic voltage and frequency scaling (DVFS)
Gate delay grows as the supply falls toward the threshold; roughly,
When the workload allows a lower frequency, the supply can drop too. Power then falls roughly as , faster than the frequency, and the energy per operation falls as .
Power gating
Leakage flows whenever a block is powered, even idle. A sleep transistor in its supply disconnects it entirely, at the cost of losing its state (unless retention registers save it) and of an energy and time cost to wake. It pays only when the block sleeps longer than the break-even time, the wake-up energy divided by the leakage power saved.
Worked example
In a 1 W block, the clock network and registers draw 30% of the power. Clock gating stops them 70% of the time. What does the block draw now?
Show the solution
- The gated share. It's 0.3 W, off 70% of the time: saved.
- The new total. 21% less, for the price of a few gates per register group.
- What's left. The logic between the registers still switches when its inputs change, so gating the clock alone doesn't remove all the dynamic power.
Answer 0.79 W.
Worked example
A processor runs at 1 GHz on 1.0 V, with = 0.3 V. Its workload allows 0.7 V. What frequency, power and energy per operation result?
Show the solution
- Frequency. With , at 0.7 V: of 1 GHz, so 466 MHz.
- Power. Power goes as : 23% of before.
- Energy per operation. It goes as : 49% of before.
- Compare. Running slower and lower does the same work on half the energy, which is why phones race to finish only when they must.
Answer 466 MHz, 23% of the power and 49% of the energy per operation.
Worked example
An idle block leaks 50 mW. A sleep transistor cuts that to 0.5 mW, but waking it costs 5 µJ. How long must it sleep to save energy?
Show the solution
- Power saved.
- Break-even time. The wake-up costs 5 µJ:
- Choosing. Shorter idle periods are better spent with only the clock gated; longer ones, powered off.
- Predicting. A power manager predicts which it's likely to be.
Answer longer than 101 µs.
Check
A block draws 2 W; 20% of it goes to the clock and registers, which clock gating stops 90% of the time.
(a)
How much does gating save?
Write units the way you normally would: 1.5 W, 1500 mW and 0.0015 kW are the same answer.
(b)
What does the block draw now?
Check
Logic designed for 1.0 V runs at 0.8 V, with = 0.25 V.
(a)
What fraction of its speed remains?
(b)
What fraction of the energy per operation does it use?
Check
Waking a block costs 5 µJ; asleep it leaks 2 mW instead of 10 mW. What's the break-even sleep time?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
Check
A battery-powered sensor does a fixed amount of work every second and then idles. To minimize energy, it should:
Check
Logic with switched capacitance aC runs at frequency F on supply W, with threshold T. The supply is scaled to V.
Step 1
What frequency does it reach at V?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What dynamic power does it draw there?
Step 3
What energy does each cycle cost?
Check
Write dvfs(V, V0, f0, Vt) returning (f, power_ratio, energy_ratio) when logic that runs at f0 on V0 is moved to V: the new frequency from , and the dynamic power and the energy per operation relative to their values at V0.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why does lowering the supply voltage save energy per operation, while lowering only the clock frequency doesn't?
Each operation switches some capacitance between ground and the supply, and charging a capacitance C to V draws C V squared of energy from the supply, half stored and half lost. That depends on the voltage, not on how fast it happens. Slowing the clock spreads the same operations over more time, which lowers the power, but each operation still costs C V squared, so the total energy for a job is unchanged. Lowering the voltage cuts that cost per operation directly, as its square. The catch is that transistors switch more slowly at lower voltage, so the clock must slow too, but for work that isn't urgent, that trade is a large saving.
Practice
Keep practicing
4 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.