Dynamic, Short-Circuit and Leakage Power
Split the power of one gate into three parts, and measure each part with a simulation you can change.
You Will Be Able To
- Measure the energy of one switching cycle from the supply current.
- Separate the load, the gate's own capacitance and the short-circuit current.
- Read leakage from a gate at rest, and compare it with switching power.
- Lesson
- W1.1
- Time
- 25 min
- Runs on
- ngspice
- Check
- 5 questions
A sensor tag runs from a coin cell, and the team budgeted its logic power as C·VDD²·f and nothing else. On the bench the chip drew more than the budget when its clock edges were slow. It also drew current with the clock stopped.
- v(in)
- v(out)
- supply current
- Time 11.05 nsv(in) = 1.8 V · v(out) = 1.596 V · supply current = -32.31 µA
The input rises. The NMOS turns on and empties the load into ground. That charge came from the supply half a cycle earlier. The supply current only twitches now.
More context
The short negative dip is charge that the fast input edge pushes back into the supply. It couples mostly through the PMOS gate capacitance to its source and body, which sit on the supply.
- Time 14 nsv(in) = 1.8 V · v(out) = 344.5 nV · supply current = -2.83 nA
Nothing switches. The supply current is leakage only, far too small to see on this axis.
- Time 16.05 nsv(in) = 15 mV · v(out) = 144.1 mV · supply current = 360.3 µA
The input falls. The PMOS turns on and the supply recharges the load. This pulse peaks near 372 µA and carries nearly all the charge of the cycle.
- Time 20 nsv(in) = 0 V · v(out) = 1.8 V · supply current = 120.9 pA
The cycle ends. The charge that left the supply is
q_cycle, and the energy isq_cycle× 1.8 V = 71.4 fJ.
Read the plot as a table
| Time | v(in) | v(out) | supply current |
|---|---|---|---|
| 11.05 ns | 1.8 V | 1.596 V | -32.31 µA |
| 12 ns | 1.8 V | 365.3 nV | 31.66 nA |
| 14 ns | 1.8 V | 344.5 nV | -2.83 nA |
| 16 ns | 1.8 V | 344.5 nV | 2.419 nA |
| 16.05 ns | 15 mV | 144.1 mV | 360.3 µA |
| 18 ns | 0 V | 1.8 V | -116.2 pA |
| 20 ns | 0 V | 1.8 V | 120.9 pA |
Measured on ngspice 42 with the SKY130 tt models. The supply pays once per cycle, when the output rises.
The budget counted one part of the power, and a gate has three.
Three Paths for the Supply Current
- Power
- Result
- Power
- Switching
Every cycle the supply refills the load and the gate's own capacitance. The lab measures 71.4 fJ per cycle in total.
- Short circuit
During an input edge both transistors conduct for a moment. With 2 ns edges the cycle costs 12.0 fJ more.
- Leakage
A gate that does nothing still passes 246 fA or 423 pA, set by which transistor is off.
Read the diagram as text
- Supply: VDD = 1.8 V
- Switching: Charges capacitance
- Short circuit: Both transistors on
- Leakage: Through an off transistor
- Heat: In the transistors
- Supply → Switching: each cycle
- Supply → Short circuit: each input edge
- Supply → Leakage: all the time
- Switching → Heat
- Short circuit → Heat
- Leakage → Heat
Switching and short-circuit current need activity. Leakage does not.
The first two paths are called dynamic power, because they exist only while signals change. Leakage is static power. The next three sections measure one path each on the same inverter.
Switching Energy: The Supply Pays C·VDD² per Cycle
- Output rises: the supply charges the load
The input is low and MP is on. A charge Q = CL·VDD flows from the supply into the load. The supply gives energy Q·VDD = CL·VDD². Half ends up stored on CL. MP burns the other half as heat.
Q = CL·VDD
- Output falls: the load empties into ground
The input is high and MN is on. The stored half flows to ground and MN burns it as heat. The supply gives nothing in this half of the cycle.
to ground
- During an input edge: both are on
While the input passes the middle, MP and MN conduct together. Current flows straight from VDD to ground and charges nothing. This is the short-circuit current.
short circuit
- At rest: one transistor is off, and it leaks
With the input still, one transistor is off. A tiny current still passes through it. This is leakage.
Read the circuit as text
- MP PMOS transistor (W/L = 2/0.15): gate →
in, source →VDD, drain →out - MN NMOS transistor (W/L = 1/0.15): gate →
in, drain →out, source →0 - VIN voltage source (100 MHz): + →
in, − →0 - C_L capacitor (20 fF): pin 1 →
out, pin 2 →0
The four moments of a cycle. The lab measures each one.
The lab integrates the supply current over one cycle. It reports e_cycle = 71.4 fJ. The formula CL·VDD² gives 20 fF × (1.8 V)² = 64.8 fJ.
The run spends 6.56 fJ more than the formula. The table shows where it goes.
| Run | Energy per cycle | CL·VDD² | What it shows |
|---|---|---|---|
| 20 fF load (the lab) | 71.4 fJ | 64.8 fJ | 6.56 fJ above the formula |
| 40 fF load | 137 fJ | 130 fJ | Doubling the load adds 65.2 fJ |
| Almost no load (1 aF) | 3.76 fJ | 0 | The gate's own capacitance and its edges |
The lab netlist with cl changed. 50 ps input edges, 1.8 V, tt, 27 °C.
Doubling the load adds 65.2 fJ, close to one more CL·VDD². So the load term follows the formula. The rest is the gate itself: its drain and gate capacitance must also charge and discharge.
Power is energy per cycle times frequency. At 100 MHz the lab prints p_avg = 7.14 µW. At 50 MHz the energy per cycle stays the same and the power halves.
Short-Circuit Current: A Slow Edge Costs More
Hold the input still at each voltage from 0 V to 1.8 V and read the supply current. The lab does this with a DC sweep after the transient.
- Input voltage 0 Vsupply current = 246.2 fA
Input low: MN is off and leaks. The supply current is
i_low= 246 fA. - Input voltage 930 mVsupply current = 28.49 µA
Near 0.93 V both transistors are on. The current peaks at
i_peak= 28.5 µA. Nothing is charged: it flows from VDD to ground. - Input voltage 1.8 Vsupply current = 422.8 pA
Input high: MP is off and leaks. The supply current is
i_high= 423 pA.
Read the plot as a table
| Input voltage | supply current |
|---|---|
| 0 V | 246.2 fA |
| 200 mV | 38.18 pA |
| 400 mV | 5.998 nA |
| 600 mV | 696.1 nA |
| 800 mV | 17.48 µA |
| 930 mV | 28.49 µA |
| 1 V | 20.79 µA |
| 1.2 V | 3.118 µA |
| 1.4 V | 170.5 nA |
| 1.6 V | 10.19 nA |
| 1.8 V | 422.8 pA |
Measured on ngspice 42. The peak is 67,400 times the larger leakage current.
A real input does not jump. It ramps through the middle, and while it is there the gate conducts from VDD to ground. A slower edge keeps the gate in that region for longer.
tr changed, from 50 ps to 2 ns. The load is still 20 fF.- v(in)
- v(out)
- supply current
- Time 12 nsv(in) = 900 mV · v(out) = 1.651 V · supply current = 7.762 µA
The input is halfway up. The output has started to fall, and yet the supply delivers about 7.7 µA. That current is the short circuit through both transistors.
- Time 17.2 nsv(in) = 720 mV · v(out) = 518.8 mV · supply current = 68.23 µA
The input is on its way down. The supply charges the load, and part of its current again goes straight to ground.
Read the plot as a table
| Time | v(in) | v(out) | supply current |
|---|---|---|---|
| 12 ns | 900 mV | 1.651 V | 7.762 µA |
| 14 ns | 1.8 V | 344.7 nV | 1.578 nA |
| 16 ns | 1.8 V | 344.5 nV | 280.1 pA |
| 17.2 ns | 720 mV | 518.8 mV | 68.23 µA |
| 18 ns | 375 µV | 1.797 V | 1.677 µA |
| 20 ns | 0 V | 1.8 V | -193.6 pA |
Measured: e_cycle = 83.4 fJ with 2 ns edges, against 71.4 fJ with 50 ps edges.
| Input edge time | Energy per cycle | Above the 50 ps run |
|---|---|---|
| 50 ps | 71.4 fJ | — |
| 1 ns | 74.1 fJ | 3.9 % |
| 2 ns | 83.4 fJ | 17 % |
The lab netlist with tr changed. The load did not change, so the extra energy is short-circuit current.
Leakage: The Current of a Gate That Does Nothing
Look at the two ends of the DC sweep again. With the input low, MN is off and 246 fA flows. With the input high, MP is off and 423 pA flows. The second number is 1,720 times the first, because this PMOS leaks far more than this NMOS (W1.3).
Leakage power is the current times VDD. The worse state burns 761 pW. Switching at 100 MHz burns 7.14 µW, which is 9,380 times more.
Now slow the clock. Switching power falls with frequency and leakage does not. The two are equal near 11 kHz: below that, a gate that toggles this slowly burns more by leaking.
Asked in interviews
What are the components of power in a CMOS gate?
Switching power charges and discharges capacitance: C·VDD² per cycle. Short-circuit power flows from VDD to ground while both transistors conduct during an input edge. Leakage flows through a transistor that is off. The first two need activity. Leakage does not.
Why is the switching energy C·VDD² and not ½·C·VDD²?
The supply delivers the charge C·VDD at the voltage VDD, so it gives C·VDD². Half is stored on the load and the PMOS burns half. On the falling edge the NMOS burns the stored half.
How does input slew affect power?
A slow edge keeps both transistors on for longer, so the short-circuit energy grows. Measured here: a 2 ns edge costs 17 % more per cycle than a 50 ps edge, with the same load.
Try It
Run the netlist. .meas ... integ i(Vdd) adds up the charge that leaves the supply in one cycle. SPICE counts current into the + terminal as positive, so q_cycle is negative. e_cycle is that charge times 1.8 V.
Change cl to 40f and run again. Predict e_cycle first. Then set cl=20f and tr=2n, and watch the supply current in Plots while the output falls.
The dc sweep holds the input still. i_low and i_high are the leakage currents of the two rest states, and i_peak is the largest short-circuit current.
Run the netlist to draw its plots here.
q_cycle = -3.96451e-14 from= 1.10000e-08 to= 2.10000e-08 e_cycle = 7.13612e-14 e_load = 6.48000e-14 p_avg = 7.13612e-06 i_low = 2.462457e-13 i_high = 4.228245e-10 i_peak = 2.848954e-05 at= 9.300000e-01Check Yourself
Common Mistakes
Wrong Integrate the supply current over part of a cycle and call it the energy of a cycle.
From 11 ns to 16 ns the lab's supply delivers -3.37 fJ: it gets a little charge back. From 16 ns to 21 ns it delivers 74.7 fJ. Neither half is the 71.4 fJ of the whole cycle.
Fix Integrate over a whole number of cycles, from one edge to the same edge of a later cycle.
Wrong Charge C·VDD² to every edge.
The supply delivers C·VDD² once per cycle, on the rising output edge only.
Fix Count one C·VDD² for each full cycle: one rise and one fall.
Wrong Read the power of a gate from the peak of its supply current.
The pulse peaks near 372 µA, but the average supply current is q_cycle ÷ 10 ns = 3.96 µA. The peak matters for supply droop, not for battery life.
Fix Integrate the current over whole cycles for energy and average power. Use the peak for supply droop.
Wrong Read a leakage current without lowering gmin.
The simulator's default gmin adds about 1.8 pA at 1.8 V, and the reading becomes 2.05 pA.
Fix Set .options gmin=1e-18 in every leakage netlist.
.lib sky130 tt
Vdd vdd 0 1.8.lib sky130 tt
.options gmin=1e-18
Vdd vdd 0 1.8Remember
- The supply delivers C·VDD² per cycle, all of it when the output rises. Power is that energy times frequency.
- The gate's own capacitance adds to the load: 3.76 fJ per cycle here with no load at all.
- A slow input edge adds short-circuit energy: 17 % more with 2 ns edges than with 50 ps edges.
- Leakage flows with no activity: 246 fA or 423 pA here, set by which transistor is off.
- Lower
gminbefore you trust a leakage reading. SKY130 leaks little, so learn the ratios.