---
title: Power in digital circuits
heading: Switching, clock and leakage power, gating, and voltage scaling
eyebrow: S3 · Lesson 20 · Power in digital circuits
xp: 50
---

::: hook
Power now limits what a chip can do more than transistor count does: a phone's processor has to fit in a few watts, a server chip's in a few hundred, and both have more transistors than they can switch at once. Digital power has three parts. Dynamic power charges and discharges capacitance, $\alpha CV^2f$; the clock network alone often takes a third of it. Short-circuit power flows during transitions. Leakage flows all the time. Every power technique attacks one factor: clock gating cuts α, power gating cuts leakage, and voltage scaling attacks the $V^2$, the biggest lever of all.
:::

::: play
- Energy per operation against supply voltage for a logic block, normalized to its switching energy at 1 V. Switching energy falls as $V^2$ (dashed); leakage energy per operation rises steeply at low voltage, because each operation takes exponentially longer while every idle gate keeps leaking.
- The total has a minimum, the minimum-energy point, typically near or below the threshold voltage.
- Raise the number of leaking gates per switching gate (a lower activity factor, a larger idle area): leakage weighs more and the minimum moves up in voltage.
:::
:::

```sim plot
view: graph
x: V = 0.1..1.2 V
y: E = 0..1.6
slider: k = 10..10000 = 1000 log
plot: V^2*(1 + k*ln(1 + exp(-0.35/(2*1.4*0.0259)))^2/ln(1 + exp((V - 0.35)/(2*1.4*0.0259)))^2) | samples: 600 | label: energy per operation (÷ switching energy at 1 V)
plot: V^2 | dashed | color: ch2 | label: switching energy alone
```

::: predict
## A processor's clock is halved and its supply lowered from 1.0 V to 0.75 V to match. Roughly how much does its dynamic power fall?

- [ ] Half
- [ ] Three quarters
- [x] To about 28%
- [ ] To about 6%

::: reveal
$P \propto V^2f$: $0.75^2 \times 0.5$ = 0.28, a 72% saving for a 50% slowdown. Energy per operation, $CV^2$, falls to 56%. That's why dynamic voltage and frequency scaling (DVFS) is in every modern processor: running slower lets the voltage drop, and the voltage enters squared.
:::
:::

::: nameit
## Dynamic power

Each time a node charges to $V_{DD}$ and discharges, the supply delivers $CV_{DD}^2$. With an activity factor α (the fraction of cycles in which a node switches up), a block with total switched capacitance C at clock f burns

$$P_\text{dyn} = \alpha CV_{DD}^2f$$

The clock has α = 1 by definition and drives a huge capacitance, so clock networks take 20 to 40% of dynamic power. Glitches, spurious transitions before logic settles, add to α.

## Short-circuit and leakage

- **Short-circuit:** while an input transitions, both pull-up and pull-down conduct briefly; usually under 10% with sharp edges.
- **Leakage:** subthreshold current (S1.35), gate tunneling, junction leakage: $P_\text{leak} = I_\text{leak}V_{DD}$, flowing whether or not the circuit is doing anything.

## Techniques

| Technique | Attacks | How |
|---|---|---|
| clock gating | α | stop the clock to idle registers (with glitch-free gating cells) |
| power gating | leakage | sleep transistors cut idle blocks off the supply |
| multi-threshold cells | leakage | high-$V_T$ cells off the critical path |
| DVFS | V and f | lower voltage when less speed is needed |
| operand isolation, low-swing buses | α, V | don't toggle what doesn't matter |

## The minimum-energy point

Energy per operation is $CV^2$ plus leakage power times the operation's duration. Lowering V reduces the first and stretches the second, exponentially once V nears the threshold. The total is smallest near or below $V_T$, often 0.3 to 0.5 V, the regime of ultra-low-power sensor chips that run slowly on harvested energy.

## Energy-delay

Since energy can always be traded for delay, designs are compared by energy-delay product or by energy at a fixed throughput.
:::

::: example
## A block has $10^6$ gates averaging 2 fF of switched capacitance each, with activity 0.15, at 1 GHz and 0.8 V, plus a 200 pF clock tree. Find the logic and clock power.

::: solution
1. **Logic power.** The $10^6$ gates switch 2 nF in all, and $V^2 = 0.64$:
   $$\begin{aligned} P &= 0.15 \times 2\ \text{nF} \times 0.64 \times 10^9 \\ &= 0.19\ \text{W} \end{aligned}$$
2. **Clock power.** The clock switches every cycle, activity 1:
   $$\begin{aligned} P &= 1 \times 200\ \text{pF} \times 0.64 \times 10^9 \\ &= 0.13\ \text{W} \end{aligned}$$
   40% of the total dynamic power.
3. **Clock gating.** Gating the clock to half the registers when they're idle would save a large share of that 0.13 W, which is why clock gating is the first power technique every synthesis flow applies.

**Answer:** 0.19 W of logic power and 0.13 W of clock power.
:::
:::

::: example
## In the sim's model with 1000 leaking gates per switching gate, where's the minimum-energy point, and how much does running there save against 1 V?

::: solution
1. **The minimum.** The total energy bottoms out near 0.30 V, at 0.125 of the switching energy at 1 V: about 8 times less energy per operation.
2. **Other leakage ratios.** With 100 leaking gates per switching gate the minimum moves down to about 0.18 V; with 10,000, up to about 0.41 V.
3. **The cost.** Speed: at 0.3 V, below the 0.35 V threshold, each operation takes about 146 times as long as at 1 V.

**Answer:** the minimum is near 0.30 V, and running there takes about 8 times less energy per operation than at 1 V.
:::
:::

::: example
## A processor burns 10 W of dynamic power at 1.0 V and 2 GHz. Its supply can drop to 0.75 V when it runs at 1 GHz. What does it burn then, and how much energy does each operation take?

::: solution
1. **Power.** Dynamic power goes as $V^2f$:
   $$\begin{aligned} P &= 10 \times 0.75^2 \times 0.5 \\ &= 2.8\ \text{W} \end{aligned}$$
2. **Energy per operation.** It goes as $V^2$ alone:
   $$0.75^2 = 0.56$$
   so it falls to 56%.
3. **Where the saving comes from.** Halving the clock by itself only stretches the work out; the lower voltage it allows is what saves energy.

**Answer:** 2.8 W, and each operation takes 56% of the energy it did at 1.0 V.
:::
:::

::: check
given: a = 0.05 | 0.15 | 0.3; C = 1 | 5; V = 0.7 | 0.9; f = 0.5 | 2
answer: a*C*1e-9*V^2*f*1e9
unit: W
tolerance: 1%

## A block switches {C} nF with activity {a} at {f} GHz and {V} V. What's its dynamic power?

::: right
Right. $\alpha CV^2f$ = {answer} W.
:::

::: misses
- [a*C*1e-9*V*f*1e9] Energy per transition goes as $V^2$.
- [C*1e-9*V^2*f*1e9] Include the activity factor.
- [any] Not yet. $\alpha CV^2f$.
:::
:::

::: check
given: C = 100 | 300; V = 0.7 | 0.9; f = 1 | 3
answer: C*1e-12*V^2*f*1e9
unit: W
tolerance: 1%

## A clock network has {C} pF of capacitance, at {f} GHz and {V} V. What does it burn?

::: right
Right. α = 1 for a clock: $CV^2f$ = {answer} W.
:::

::: misses
- [C*1e-12*V^2*f*1e9/2] The clock switches up once every cycle: α = 1.
- [any] Not yet. The clock toggles every cycle.
:::
:::

::: check
given: V = 0.6 | 0.75 | 0.85; f = 0.4 | 0.5 | 0.7
answer: V^2*f
tolerance: 1%

## A design's supply drops from 1.0 V to {V} V and its clock to {f} of the original. What fraction of its dynamic power remains?

::: right
Right. $V^2f$ ratio: {answer}.
:::

::: misses
- [V*f] Voltage enters squared.
- [any] Not yet. $P \propto V^2f$.
:::
:::

::: check
given: C = 1 | 10 | 100; V = 0.5 | 0.8 | 1
answer: C*V^2
unit: fJ
tolerance: 1%

## How much energy does the supply deliver each time a {C} fF node charges to {V} V and discharges?

::: right
Right. $CV^2$ = {answer} fJ.
:::

::: misses
- [C*V^2/2] Half is stored and later dissipated, half is dissipated while charging: the supply delivers $CV^2$.
- [any] Not yet. Charge CV taken from a supply at V.
:::
:::

::: check
given: I = 1 | 10 | 100; V = 0.7 | 1
answer: I*V
unit: mW
tolerance: 1%

## A chip leaks {I} mA at {V} V. What's its leakage power?

::: right
Right. $I_\text{leak}V$ = {answer} mW, spent even when idle.
:::

::: misses
- [any] Not yet. Current times voltage.
:::
:::

::: check
given: P = 0.5 | 2; c = 0.3 | 0.4; g = 0.4 | 0.7
answer: P*c*g
unit: W
tolerance: 1%

## A chip's dynamic power is {P} W, of which the clock takes {c}. Clock gating stops the clock to {g} of the registers' clock load. How much does it save?

::: right
Right. $P \times$ clock share × gated share = {answer} W (more, counting the gated registers' own switching).
:::

::: misses
- [any] Not yet. Gating removes that part of the clock's power.
:::
:::

::: check
kind: parts
given: a = 0.1 | 0.2; C = 1 | 5; V = 0.7 | 0.9 | 1.1; f = 0.5 | 2; k = 100 | 300

## A block has {C} nF of switched logic capacitance with activity {a}, and a {k} pF clock tree, at {V} V and {f} GHz.

::: part
answer: a*C*V^2*f
unit: W
tolerance: 0.5%

### What is the logic's dynamic power?

::: misses
- [any] $\alpha CV^2f$.
:::
:::

::: part
answer: k/1000*V^2*f
unit: W
tolerance: 0.5%

### What does the clock tree burn?

::: misses
- [a*k/1000*V^2*f] The clock switches every cycle: α = 1.
- [any] $C_\text{clk}V^2f$.
:::
:::
:::

::: check
kind: derivation
vars: P = 0.1..100, r = 0.5..1, s = 0.1..1

## A block burns dynamic power P. Its voltage is scaled by r and its frequency by s.

::: step
answer: P*r^2*s

### What power does it burn?
:::

::: step
answer: r^2

### By what factor does the energy per operation change?
:::

::: step
answer: 1/s

### By what factor does a fixed task's run time change?
:::

::: right
Right. Voltage sets energy; frequency only spreads it over time.
:::
:::

::: explain
## Why is lowering the supply voltage the most effective way to cut a chip's power?

::: model
Dynamic power is the energy per transition times the rate of transitions. The energy per transition is $CV^2$, so it falls with the square of the voltage, and lowering the voltage also slows the transistors, so the clock must drop too, cutting the rate. Together, power falls roughly with the cube of the voltage when frequency tracks it. No other knob does that: clock gating removes only the gated activity, and shrinking capacitance takes a new design or process. The limit is the threshold voltage, below which speed collapses and leakage, integrated over the much longer operation, takes over.
:::
:::

::: practice

::: check
given: a = 0.1 | 0.25; C = 2 | 8; V = 0.75 | 0.95; f = 1 | 2.5
answer: a*C*1e-9*V^2*f*1e9
unit: W
tolerance: 1%

## Dynamic power: α {a}, {C} nF, {V} V, {f} GHz?

::: misses
- [any] $\alpha CV^2f$.
:::
:::

::: check
given: V = 0.65 | 0.8; f = 0.3 | 0.6
answer: V^2*f
tolerance: 1%

## Remaining power at {V} V and {f} of the clock?

::: misses
- [any] $V^2f$.
:::
:::

::: check
given: C = 5 | 50; V = 0.6 | 0.9
answer: C*V^2
unit: fJ
tolerance: 1%

## Energy per transition: {C} fF at {V} V?

::: misses
- [any] $CV^2$.
:::
:::
:::
