Skip to content
Tactiverge

School/△ Builder/Week 17

Multi-bit addition and the ripple-carry adder

Adding 0111 + 0001 changes every single bit of the answer. How long does a circuit have to wait before it can trust the result?

About 35 min · 3 goals · Checked by automated tests

1.Why should I care?

Adders set the speed of a processor's arithmetic. Understanding why the carry has to ripple, and what that costs in time, is the first step towards the faster adder designs used in every modern chip.

  • ◇ Add multi-bit binary numbers by hand, showing every carry.
  • ◇ Trace a ripple-carry adder column by column and identify carry out.
  • ◇ Estimate how the worst-case delay of a ripple-carry adder grows with the number of bits.

2.Discover

Do Level 3 of the virtual computer: fill in the full adder table, find two 4-bit numbers whose carry ripples through all four columns (watch the settle clock), and work out how many gate delays the 4-bit adder needs before its carry out is certain.

Can't use the interactive? Read a description instead

The virtual computer's ripple-carry adder shows four full adders in a row with carries passing right to left and a settle clock counting gate delays. Adding 0111 and 1001 makes the carry ripple through all four columns, and the carry out is certain after 9 gate delays.

3.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

Add 0110 + 0111 (4-bit). Give the result as a decimal number.

4.Apply it

Finish BUILD 008 Level 3. Then, using the delay model above, make a table of worst-case delay for 4, 8, 16 and 32 bits and describe the pattern in one sentence.

Open BUILD 008: Create a Virtual Computer →

5.Understand

By hand: right to left

Line the numbers up, start at the rightmost column and add the two bits plus any carry. Write the sum bit and carry the rest. 1011 + 0110: 1 + 0 = 1; 1 + 1 = 10 → 0 carry 1; 0 + 1 + 1 = 10 → 0 carry 1; 1 + 0 + 1 = 10 → 0 carry 1. Result 1 0001 = 17 = 11 + 6.

The ripple-carry adder

One full adder per column, each carry out wired to the next carry in. It is simple and small, but a column cannot be sure of its answer until the carry from the right has arrived, so the carry ripples across the whole adder.

Worst-case delay

Each gate takes a little time to settle. In the virtual computer's model the first column's carry is ready after 3 gate delays (XOR, AND, OR), and each further column adds 2. A 4-bit adder needs 3 + 2 × 3 = 9 delays; 32 bits would need 65. Faster designs, such as carry-lookahead, compute carries in parallel at the cost of more gates.

Explain it another way

A row of dominoes: the last one cannot fall until every one before it has. The more bits, the longer the row.

Worked example 1

Add 0101 + 0011 by hand, showing carries.

1 + 1 = 10 → 0 carry 1. 0 + 1 + 1 = 10 → 0 carry 1. 1 + 0 + 1 = 10 → 0 carry 1. 0 + 0 + 1 = 1. Result 1000 = 8 = 5 + 3.

Common mix-ups

  • All the bits of a sum appear at the same instant.
    ✓ In a ripple-carry adder the higher bits wait for carries from the lower ones.

6.Watch

→ Notice how each chip's carry output is wired to the next chip's carry input, and that the last carry is where overflow shows up.

Shows step by step how a handful of gates add binary numbers, using real chips you can buy.

13 min 38 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

The video is optional: everything you need is also in the lesson text and the interactive.

7.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2 · a fresh version every time

An unsigned 4-bit register adds 1101 + 0100. What value does the register hold afterwards, in decimal? (Any carry out of the top bit is lost.)

Practice 3 · a fresh version every time

An unsigned 4-bit register adds 1000 + 1001. What value does the register hold afterwards, in decimal? (Any carry out of the top bit is lost.)

Practice 4

Using the model 'first carry after 3 gate delays, then 2 more per extra bit', how many gate delays does an 8-bit ripple-carry adder need for its final carry?

delays

Practice 5

Which 4-bit addition makes the carry ripple through every column?

8.Predict

Add 0110 + 0111 in 4-bit binary. What is the result?

Guess first. Being wrong here is how the surprise works.

9.Reflect

Concepts: Binary arithmetic and adders · Binary, hexadecimal and digital signals