Exercises — Approximate computing techniques
Before we start, a 30-second symbol refresher so nobody meets a new symbol cold:
Level 1 — Recognition
L1.1
For each technique, name which layer of the stack it lives in (circuit / arithmetic / software-loop / memory / voltage): (a) loop perforation, (b) truncated multiplier, (c) lowering DRAM refresh rate, (d) running below the safe voltage.
Recall Solution L1.1
- (a) Software-loop — we skip loop iterations; no hardware change needed.
- (b) Arithmetic circuit — we redesign the multiplier to drop low-order partial products.
- (c) Memory — fewer refreshes let some DRAM cells decay → bit flips in stored data. See DRAM Refresh and Memory Reliability.
- (d) Voltage — voltage overscaling (VOS); rare timing errors on the slowest paths.
L1.2
Which of these is safe to approximate, and which must stay exact? (a) the mantissa's least-significant bits of a pixel colour, (b) a loop-bound counter, (c) the exponent of an FP32 number, (d) a summed sensor reading.
Recall Solution L1.2
- (a) Safe — LSBs of a pixel are perceptually invisible.
- (b) Exact — a corrupted loop bound can loop forever or crash. Control flow is critical.
- (c) Exact — the exponent sets the magnitude. Flip one bit and a number can jump by a factor of . See Precision and Number Formats (FP32, FP16, INT8).
- (d) Safe — aggregation absorbs per-reading error.
Level 2 — Application
L2.1
An array multiplier is replaced by a one (precision halved from to ). Using at fixed , by what factor does multiplier energy drop?
First, why does multiplier energy grow as ? Look at the figure below. An array multiplier multiplies two -bit numbers by laying out a grid of AND gates and full-adder cells: each of the bits of one operand is combined with each of the bits of the other, forming an array of partial-product cells. That is literally an -by- square of hardware — rows columns cells. Since each cell burns roughly the same switching energy , the whole multiplier burns . This is the geometric reason behind the law (see Ripple-Carry vs Array Multipliers).

Recall Solution L2.1
Energy ratio So energy drops to one quarter — a saving. Why and not just ? The cell count is the area of an square, so halving quarters the area (like halving a square's side quarters its area). This is exactly why halving bit-width is such a lever.
L2.2
Dynamic power is . We overscale voltage from down to , keeping fixed. What fraction of the original power do we save?
Recall Solution L2.2
Power scales with , so Saving . The other is what we still pay.
L2.3
Multiply and . The exact product needs some fractional bits; we truncate to 3 fractional bits ( resolution). Find the truncated value, the absolute error, and the relative error.
Recall Solution L2.3
- Exact: .
- Truncate to multiples of (drop the tail, round down): (since , and so the 3rd fractional bit is not set).
- Absolute error .
- Relative error .
Level 3 — Analysis
L3.1
You sum numbers, each with mean (recall from the refresher: is the average value of each summand, is the typical size of the injected wobble). Two approximation schemes:
- Scheme U (unbiased): each addition adds independent zero-mean error with standard deviation .
- Scheme B (biased): each addition always loses a fixed (systematic).
Estimate the relative error of the final sum under each. Which wins and why?
Recall Solution L3.1
Signal (the true sum) .
Scheme U — errors add in quadrature (variances sum): Relative error .
Scheme B — biases add linearly (they all point the same way): Relative error .
Unbiased wins by . The figure below shows why: random (zero-mean) errors partly cancel and grow only like (teal curve), while a bias never cancels and grows like (orange curve).

Reading the figure: the horizontal axis is , the number of accumulated operations; the vertical axis is the total error magnitude. The orange line is the biased drift — a straight line climbing relentlessly. The teal curve is the unbiased spread — it bends over and flattens because each new random error is as likely to cancel as to add. At the dashed marker () the gap is vs : a penalty purely for being biased.
L3.2
Two multiplier designs meet a target image quality PSNR dB (recall: PSNR is our image-quality metric — higher dB = less visible error):
- Design X: truncates the lower 6 partial-product rows, measured PSNR dB.
- Design Y: truncates the lower 8 rows, measured PSNR dB.
An array multiplier's saved cells (rows dropped) . Which design do you ship, and why is "more truncation" not automatically better?
Recall Solution L3.2
Ship Design X. Design Y truncates more (drops cells vs cells — more energy saved) but PSNR fails the quality bound. A constraint violated is a product rejected; extra savings you can't use are worthless. The correct rule: pick the most aggressive design that still satisfies the bound — here that is X.
Level 4 — Synthesis
L4.1
You are designing an INT8 neural-network accelerator (see Neural Network Quantization). Combine two techniques to hit an energy budget: precision scaling (FP32 → INT8) and voltage overscaling (drop from V to V). Estimate the combined multiplier-energy factor relative to the FP32, V baseline. (Use ; treat FP32 mantissa multiply as , INT8 as .)
Recall Solution L4.1
Multiply the two independent factors.
Precision factor:
Voltage factor:
Combined: So multiplier energy falls to about 8% of the FP32 baseline — roughly a reduction. This stacking (precision × voltage) is a standard recipe in energy-efficient design; see Dark Silicon and Energy-Efficient Architectures.
L4.2
Your accelerator's weights sit in DRAM. You lower the refresh rate (approximate memory) to save refresh power, but this occasionally flips bits. Design a partition scheme: which data goes in the low-refresh (lossy) region and which stays in the reliable region? Justify with the criticality principle.
Recall Solution L4.2
- Reliable region (normal refresh): exponents / scale factors, loop counters, pointers, the top few mantissa bits of critical weights, and any ECC-protected control data. Flipping these causes magnitude blow-ups or crashes.
- Lossy region (low refresh): the low-order mantissa bits of large weight/activation tensors, and cached intermediate feature maps. A flipped LSB nudges a weight by a tiny fraction — absorbed by the network's statistical aggregation.
- Justification: approximation must follow criticality. Bits whose flip changes the answer's magnitude stay exact; bits whose flip changes only the last decimal go lossy. This mirrors the parent note's rule "never approximate exponents / control flow."
Level 5 — Mastery
L5.1
A video decoder must satisfy PSNR dB (higher dB = better picture; is "looks flawless"). A bit-width sweep gives:
| PSNR (dB) | relative multiplier energy | |
|---|---|---|
| 12 | 52 | |
| 10 | 46 | |
| 8 | 41 | |
| 6 | 33 |
Choose to minimise energy subject to the constraint, then state the energy saving vs the design and explain the "quality cliff."
Recall Solution L5.1
Feasible choices (PSNR ): (52), (46), (41). gives → infeasible. Among feasible, minimise energy : smallest is (energy ). Saving vs : energy saved.
Quality cliff: from () to () PSNR drops dB for just fewer bits — a sudden collapse. The figure below plots PSNR against : the curve is gentle at high but plunges below the dB line right after . That knee is the quality cliff; sits right at its edge — the smallest bit-width still above the bound, i.e. the 80/20 sweet spot the parent note describes.

L5.2
Your final design runs a feedback / iterative filter (each output feeds the next input). Per-operation relative error is a tiny . A colleague says " is negligible, ship it." Under what condition is she wrong, and what must you check?
First, what is the loop gain ? Picture a feedback loop as a block diagram (figure below): an input enters, gets processed, and the output is fed back and re-processed on the next step. The loop gain is the factor by which one trip around that loop multiplies a signal (and any error riding on it). If , each lap shrinks the error to ; if , each lap grows it to .

Recall Solution L5.2
She is wrong when the loop has a gain on the error path. In a recurrence, an error at step becomes at step ; after steps it is . If this grows exponentially, so a per-step error can dominate the output within a few dozen iterations. What to check: stability, not per-op error. Verify the loop gain (errors decay) or that the system is otherwise error-contracting. Per-operation smallness is necessary but not sufficient in feedback systems — exactly the fourth mistake in the parent note.
Recall One-line summary of the whole ladder
Recognition (name the technique & its layer) → Application (plug into ) → Analysis (bias vs unbiased, constraint-first) → Synthesis (stack techniques and their errors) → Mastery (find the quality cliff & check feedback stability).