Power, Area and Cost: What Speed Is Paid With

Speed is never free. It is paid for in power, in silicon area and in money. Three rough models tell an architect the price before anything is built.

You Will Be Able To

  • Work out how switching power changes with frequency and with supply voltage.
  • Work out the cost of one good die from the wafer, the die area and the yield.
  • Compare a fast build and a small build of one block by cells and by cycles.
Lesson
S1.8
Time
24 min
Runs on
Your browser
Check
5 questions

Two multipliers give the same answers. One is finished in one clock cycle and the other in nine. The slow one is the right choice more often than you would think.

Before You Start

You need CPU time and the clock period from S1.5. You need synthesis and the two reports of S1.4.

Five questions this page answers
Question
1What does switching power depend on?
2Why does lowering the voltage save more than lowering the frequency?
3How does the area of a design become the cost of a chip?
4Why does cost rise faster than area?
5What does a faster build of the same block cost in cells?

The Idea: Four Budgets, One Design

S1.5 measured a design by one thing: the time of a job. A product has three more budgets. It has a battery or a power supply. It has a price. And the price depends on how much silicon each chip uses.

These budgets pull against each other. More speed usually takes more power and more area. More area costs more money. An architect cannot have the best of all four.

So the architect works with rough models. Each is one line of arithmetic. None is exact. Each is good enough to rule a design in or out before months are spent on it.

New Words

New words on this page
WordMeaning
VoltThe unit of voltage. A small battery gives 1.5 of them.
Clock frequencyThe number of clock cycles in each second, counted in MHz.
Supply voltageThe voltage that feeds the gates of a chip. A common value is near 1 volt.
CapacitanceHow much electric charge a wire or a gate input holds. Every switch from 0 to 1 must fill it.
Switching powerThe power a circuit uses because its wires change between 0 and 1.
Milliwatt (mW)A unit of power: one thousandth of a watt.
WaferThe round slice of silicon on which a factory makes many copies of a chip at once.
DieOne copy of the chip, cut from the wafer.
YieldThe share of the dies on a wafer that work.

Two plain words come back from S1.4. Synthesis counts its result in cells, and one cell is one gate or one flip-flop. Levels of logic is the longest chain of gates between two flip-flops.

One Picture: What Pulls on a Design

Four Things That Pull on One DesignStep along each line. A gain at one end is paid for at the other.
  • Processor
  • Power
  • Memory
  • Pads
Four Things That Pull on One DesignStep along each line. A gain at one end is paid for at the other. component Speed the time of a job,from S1.5 component Power the energy used ineach second component Area the silicon the designcovers component Cost the price of oneworking chip higher frequency andvoltagemore logic working atoncefewer chips from eachwafera larger battery,more cooling
  1. component Speedthe time of a job, from S1.5
    • higher frequency and voltage → Power
    • more logic working at once → Area
  2. component Powerthe energy used in each second
    • a larger battery, more cooling → Cost
  3. component Areathe silicon the design covers
    • fewer chips from each wafer → Cost
  4. component Costthe price of one working chip
  1. Speed against power

    A faster clock switches every wire more often. Reaching it may also need a higher voltage. Both raise the power.

  2. Speed against area

    Doing more in one clock cycle needs more logic side by side. The lab below measures this.

  3. Area against cost

    A larger design leaves room for fewer chips on each wafer, and more of them fail.

  4. Power against cost

    Power must be supplied and its heat removed. Both cost money outside the chip.

Read the diagram as text
  • Speed: the time of a job, from S1.5
  • Power: the energy used in each second
  • Area: the silicon the design covers
  • Cost: the price of one working chip
  • Speed → Power: higher frequency and voltage
  • Speed → Area: more logic working at once
  • Area → Cost: fewer chips from each wafer
  • Power → Cost: a larger battery, more cooling

No design wins on all four. The architect decides which one the product cares about most.

The Smallest Example, Worked by Hand: Two Budgets

First power. Switching power is proportional to three things: the capacitance that switches, the supply voltage squared, and the clock frequency. Take a block that uses 80 mW at 1.0 volt and 100 MHz.

One block, three changes
ChangeSumSwitching power
None80 mW
Frequency from 100 to 50 MHz80 x 0.540 mW
Voltage from 1.0 to 0.8 volt80 x 0.8 x 0.851.2 mW
Both80 x 0.8 x 0.8 x 0.525.6 mW

Exercise numbers. The voltage counts twice, because it is squared.

A fifth less voltage saved more than a third of the power. That is why designers lower the voltage first, when the circuit can still keep up.

Now cost. A factory sells whole wafers. Suppose a wafer costs 4800 dollars and has 60,000 square millimetres of usable area.

From area to cost
Die areaDies on the waferYieldGood diesCost of one good die
100 square mm60,000 / 100 = 60080 percent4804800 / 480 = 10 dollars
200 square mm60,000 / 200 = 30060 percent1804800 / 180 = about 26.67 dollars

Exercise numbers. The division ignores the dies lost at the round edge of the wafer.

The second die has twice the area and costs 2.67 times as much. A larger die is more likely to contain a flaw, so its yield is lower.

The Rules

  1. Rule 1: Switching power is proportional to capacitance, to voltage squared and to frequency.

    Halving the frequency halves it. Halving the voltage cuts it to a quarter.

  2. Rule 2: A lower voltage makes gates slower.

    So the voltage and the highest usable frequency fall together. The saving is real, and it is paid for in speed.

  3. Rule 3: Dies on a wafer is about the wafer area divided by the die area.

    The cost of one good die is the wafer cost, divided by the dies and by the yield.

  4. Rule 4: Yield falls as the die grows.

    So cost rises faster than area. Twice the area costs more than twice the money.

  5. Rule 5: One function can be built fast and large, or slow and small.

    Work done side by side in one cycle needs more cells than the same work done in turns.

Sources for These Rules

Switching power and its three factors: Patterson and Hennessy, Computer Organization and Design, ARM edition, section 1.7.

Dies on a wafer, yield and the cost of a die: the same book, section 1.5.

Rule 2 is common practice. It is not taken from a library source. Module S10 returns to it.

Every number of the worked example is an exercise number. No real factory price is used.

Now Run It: A Fast Build and a Small Build

The lab at the end of this page holds two multipliers of 8-bit numbers. The fast build works out the whole product between two clock edges. The small build has one adder and uses it eight times.

Recorded from the lab on Icarus. Both builds get the same numbers.
3 x 5: fast=15 in 1 cycle, small=15 in 9 cycles
200 x 17: fast=3400 in 1 cycle, small=3400 in 9 cycles
255 x 255: fast=65025 in 1 cycle, small=65025 in 9 cycles

The answers agree in every row. The small build takes nine cycles: eight for the bits, and one for its done signal. We then ran each build alone through synthesis.

Two builds of one multiplier, measured
BuildCellsFlip-flopsLevels of logicClock cycles for one product
Fast34717301
Small9529169

Cells, flip-flops and levels from Yosys, to generic gates. The cells include the flip-flops. The cycle counts are from the lab on Icarus.

Rule 5 at work: the fast build needs 347 cells and the small build 95. For this block, one cycle in place of nine costs more than three times the cells.

Look at the levels of logic too. The fast build has a chain of 30 gates between flip-flops, and the small build 16. A longer chain needs a longer clock period, as S2.6 will show. So the fast build may slow the clock of the whole chip.

Which build is right? It depends on the job. A chip that multiplies once in a thousand cycles should take the small one. S1.5 gives the test: what share of the time is this block?

The lab leaves things out. Generic gates have no real area, and nothing here measures power. Real numbers need the cells of one process.

Why It Is Built This Way

Design choiceThe alternativeWhat the choice buys, and costs
Lower the voltageLower only the frequencyPower falls with the square. The gates slow down, so the top speed falls too.
Share one adder over many cyclesOne adder for each stepA fraction of the cells. Each result takes many cycles.
Keep the die smallAdd every feature asked forMore dies from each wafer, and a better yield. Some features wait for the next chip.

The Trap: Half the Clock, the Same Energy

A team must make a battery last longer. It halves the clock frequency, and the switching power halves. The battery lasts no longer.

The job now takes twice as long. Energy is power multiplied by time. Half the power for twice the time is the same energy.

One job, two clock rates
ClockSwitching powerTime of the jobEnergy
100 MHz80 mW1 second80 mW x 1 s
50 MHz40 mW2 seconds40 mW x 2 s, the same

Exercise numbers, for switching power only.

A lower voltage is different. It cuts the energy of each switch, so the job itself costs less. That is the reason rule 1 squares the voltage, and the reason it is the first lever.

At Scale

This page1 block, 2 builds
A phone chiphundreds of blocks, one battery

This section looks ahead. The three models of this page are the first estimate. A real chip refines each of them.

  1. Power that never switches

    A second kind of power flows even when no wire changes. It is called leakage. It grows with the number of transistors.

  2. Voltage that follows the work

    A large chip changes its voltage and frequency while it runs. S10.9 follows one such change.

  3. Parts that are switched off

    The cheapest block is one with its supply removed. S5.7 shows what that needs.

  4. Heat

    Every milliwatt leaves the chip as heat. In a phone, the case sets the limit long before the battery does.

Try It

Run the lab. Check each product by hand, or with a calculator.

Add a fourth pair of numbers. Predict both cycle counts before you run it.

Read mul_small. Find the one adder, and say why eight uses of it are enough.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: 3 x 5: fast=15 in 1 cycle, small=15 in 9 cycles 200 x 17: fast=3400 in 1 cycle, small=3400 in 9 cycles 255 x 255: fast=65025 in 1 cycle, small=65025 in 9 cycles

Check Yourself

Predict the outputThe lab multiplies 12 by 12, then 100 by 3. What is the last line it prints?
// Build 1, fast: the whole product in one clock cycle.
module mul_fast (
  input  logic        clk,
  input  logic        start,
  input  logic [7:0]  a, b,
  output logic [15:0] product,
  output logic        done
);
  always @(posedge clk) begin
    done <= start;
    if (start) product <= a * b;        // one large block of logic between two registers
  end
endmodule

// Build 2, small: one adder, used eight times. Each clock cycle handles one bit of b.
module mul_small (
  input  logic        clk,
  input  logic        start,
  input  logic [7:0]  a, b,
  output logic [15:0] product,
  output logic        done
);
  logic [7:0] a_keep;
  logic [3:0] left = 0;                 // how many bits of b are still to do
  wire  [8:0] upper = product[15:8] + (product[0] ? a_keep : 8'd0);   // the one adder
  always @(posedge clk) begin
    done <= (left == 4'd1);
    if (start) begin
      a_keep  <= a;
      product <= {8'd0, b};             // b waits in the low half and leaves one bit at a time
      left    <= 4'd8;
    end else if (left != 4'd0) begin
      product <= {upper, product[7:1]}; // add if the low bit is 1, then shift right
      left    <= left - 4'd1;
    end
  end
endmodule

// ---- Test code: the same numbers go to both builds. It counts the clock cycles of each. ----
module tb;
  logic clk = 0;
  always #5 clk = ~clk;
  logic start = 0;
  logic [7:0] a, b;
  wire [15:0] p_fast, p_small;
  wire done_fast, done_small;
  mul_fast  u_fast  (.clk(clk), .start(start), .a(a), .b(b), .product(p_fast),  .done(done_fast));
  mul_small u_small (.clk(clk), .start(start), .a(a), .b(b), .product(p_small), .done(done_small));

  int since, c_fast, c_small;           // clock cycles since start
  always @(posedge clk) begin
    since++;
    if (done_fast)  c_fast  = since;
    if (done_small) c_small = since;
  end

  task multiply(input logic [7:0] x, input logic [7:0] y);
    @(negedge clk); a = x; b = y; start = 1;
    @(negedge clk); start = 0; since = 0;
    repeat (12) @(negedge clk);
    $display("%0d x %0d: fast=%0d in %0d cycle, small=%0d in %0d cycles", x, y, p_fast, c_fast, p_small, c_small);
  endtask

  initial begin
    multiply(12, 12);
    multiply(100, 3);
    $finish;                      // $finish ends the simulation
  end
endmodule
ConceptThe frequency of a block doubles and its voltage stays the same. What happens to its switching power?
ConceptA wafer holds 400 dies and the yield is 75 percent. The wafer costs 6000 dollars. What does one good die cost?
ConceptWhy does cost rise faster than die area?
ConceptIn the recorded synthesis, which build has more levels of logic?

Common Mistakes

Wrong Halve the clock rate to save the energy of a job.

The job takes twice as long at half the power.

Fix Lower the voltage, or switch the block off when it is idle.

Wrong Expect twice the die area to cost twice the money.

Fewer dies fit on the wafer, and fewer of them work.

Fix Work out the good dies first, then divide the wafer cost.

Wrong Always pick the build with the fewest cycles.

It costs cells, and its long chain of gates may slow the clock.

Fix Find the share of time the block takes, then choose.

Remember

  • Switching power is proportional to capacitance, voltage squared and frequency.
  • A lower voltage saves the most, and it slows the gates.
  • Cost of a good die is the wafer cost over the dies times the yield.
  • Yield falls as the die grows, so cost rises faster than area.
  • A faster build of one function costs more cells.

Practice

Report a problem with this page