Binary and addition

Ripple Carry: Tracing 7+1 Column by Column

When adding several bits, you start at the lowest column, and each column's carry out, Cout, becomes the carry in, Cin, of the next column up. In 7+1 that carry runs through three columns and stops in the fourth, giving 1000₂.

0111₂+0001₂, column by column

Place values are written 8, 4, 2, 1 from left to right, but the work starts on the right at the 1s place.

0111₂ + 0001₂ = 1000₂

Carry: 1 → 2 → 4 → 8

Place valueABCinSCout
111001
210101
410101
800110
Each column is listed in place-value order 1, 2, 4, 8. The 1s column has 1+1, writes 0 and carries 1. The 2s column has 1+0+1, writes 0 and carries 1. The 4s column has 1+0+1, writes 0 and carries 1. The 8s column has 0+0+1, writes 1 and stops carrying. Carry arrows point from each column to the column with double its place value. The result 1000₂ is 8.
Worked in place-value order 1, 2, 4, 8
Place valueABCinSCout
111001
210101
410101
800110

Why the carry stops in column four

Each of the first three columns has two units, so it writes 0 and carries. In the fourth column A and B are both 0, so only the carry's single unit arrives, leaving S=1 and Cout=0, and the chain ends.

2, 4 and 8 bits use the same rule

A wider adding machine just has more columns, and each column follows the same rule. 2-, 4- and 8-bit inputs cover 0 to 3, 0 to 15 and 0 to 255, so two inputs can add up to at most 6, 30 and 510.

The top column's carry is kept, so results can need 3, 5 or 9 bits. For example, 3+3=110₂, 15+1=10000₂ and 255+1=100000000₂.

Where this model stops

This shows the idea of step-by-step dependence: a higher column waits for the carry from the column below. The speed of an animation on a web page says nothing about how fast real circuits propagate, and modern processors don't all add this way.

Check yourself

  1. What is 0111₂+0001₂, and which columns carry?

    Answer

    1000₂, which is 8. The columns with place values 1, 2 and 4 all carry; the column with place value 8 receives the carry, writes 1 and stops.

  2. What is 1111₂+0001₂?

    Answer

    10000₂, which is 16. All four columns write 0 and carry, and the last carry becomes a fifth bit that must be kept.

  3. What is the largest sum of two 8-bit inputs, and how many bits does it need?

    Answer

    255+255=510, written 111111110₂. It needs nine bits, and the top carry must not be dropped.