Carrying forward

Three inputs, two outputs. Now you can chain adders to handle any number of bits. Build a full adder — the building block of every binary calculator.

What you'll learn

The idea

The half adder handles the two least-significant bits of an addition, but from the second column onward you also have to account for the carry from the previous column. That's three bits of input per column, not two.

The full adder's truth table has eight rows — every combination of A, B, and Carry In. The outputs:

Two half adders plus one OR gate is the classical build:

 A ──┐
    ┌XOR┐──── Sum0 ──┐
 B ──┘           ┌XOR┐──── Sum
            Cin──┘
 A ──┐       ┌AND┐
    ┌AND┐────┤
 B ──┘       │        ┌ OR ┐── Cout
 Sum0 ───AND─┘

But you can also wire it directly with the truth table above — two XORs for Sum, some ANDs and an OR for Carry Out.

The challenge

Place three Levers labeled Input A, Input B, and Carry In. Place two Lamps labeled Sum and Carry Out. Wire the logic so every row in the target table matches.

Hint: if you built the half adder in lesson 5, you've already got the hard part. Use two of them back-to-back and OR their carries.

Where this leads

Chain 8 full adders, each one's Carry Out feeding the next adder's Carry In, and you have an 8-bit ripple-carry adder — the core of every CPU's ALU. Chain 64 and you've got the arithmetic unit of a modern processor (minus a lot of speed optimizations).