TactivergeLite

Lite / Independent Engineering Research / Week 27

Designing an architecture comparison

Ripple-carry or carry-lookahead: which adder is 'better'? The honest answer starts with 'better at what, and how will we know?'

About 50 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

This week you run the term's comparison project. Whether it compares adders, precisions, cache settings or algorithms, the method is the same: a question, a baseline, a prediction from theory, measurements across conditions, and an honest report.

Predict

A ripple-carry adder's delay grows linearly with the number of bits n. How does a carry-lookahead adder's delay grow, roughly?

  1. Also linearly
  2. Logarithmically (about log n levels)
  3. Quadratically
  4. It is constant
Guess first, then reveal

Lookahead computes carries with a tree of generate/propagate logic, so delay grows about with log n, at the cost of more gates (area). The same trade appeared with the parity tree in week 22: depth for area.

Discover

Open Level 5 'Investigate speed'. Before measuring, write your hypothesis about how the longest gate path grows with adder width. Then record at least four sizes, keeping everything else fixed, and compare the measured trend with your prediction.

What the interactive shows (text version)

The Level 5 investigation builds adders of several widths from gates and reports their longest gate path. Ripple-carry paths grow by about 2 gate delays per bit; lookahead designs grow roughly with log₂ of the width but use more gates.

You can also open the interactive on the full site when you have a faster connection.

Understand

A measurable question

Replace 'which is better?' with something like: 'How does worst-case delay and gate count grow with width n for ripple-carry and carry-lookahead adders, for n = 4 to 32?' The question names the systems, the metrics, the conditions and the range.

Theory first

Write what you expect, with reasons: ripple delay ≈ 2n gate delays (Θ(n)); lookahead ≈ c·log₂ n (Θ(log n)) with more gates. A prediction made before measuring turns the experiment into a test. If the data disagree, that is a finding to explain, not a failure.

Fair comparison

Same gate library and delay model, same widths, same test inputs (including worst-case carry chains), equal effort on each design. Measure a range of sizes so the growth rate is visible; a single size can hide a crossover where the 'worse' design wins for small n.

Explain it another way

Intuitive

Racing two cars on one short track tells you who wins that track. Racing them on tracks of many lengths tells you who wins in general and where the lead changes.

Technical

Report metrics as functions of size, fit the expected model (linear, logarithmic) and compare residuals. State the model of delay you used (unit gate delay, no wire delay) and its limits.

Mathematical

If T_ripple(n) = a·n and T_cla(n) = b·log₂ n + c, the crossover where lookahead becomes faster solves a·n = b·log₂ n + c; for a = 2, b = 4, c = 2: n = 8 gives 16 vs 14, so lookahead wins from about n = 8.

Applied

Real processors use parallel-prefix adders, a lookahead family, in their ALUs because a 64-bit ripple adder would set an unacceptably long critical path for the clock.

Worked example 1

Write a decision rule for the term project before measuring.

Example: 'Choose the smallest precision whose mean absolute error over the 200 held-out test signals is below 0.5% of full scale, with the upper end of its 95% interval also below 0.5%. If none qualifies, report float.'

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

Practice 1. Which is the best research question for an adder comparison?

gate delays

calls

Practice 4. Why measure several sizes rather than one?

×

Apply it

Finish and submit the project's pre-registration: question, systems, baseline, metrics, sizes or conditions, prediction from first principles, decision rule and analysis plan. Then run the Level 5 adder investigation as a practice run of the method.

Reflect

What is your prediction for the term project, and what result would make you change your mind?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Ablations: which part made it better?Explaining results from first principles →