LearnGates

The half adder: adding two bits

Computers add numbers in binary, one bit at a time. The half adder is the circuit that adds two single bits, A and B. Because 1 + 1 = 2, which is 10 in binary, it needs two outputs: the sum bit S and the carry bit C.

Truth table

Truth table of Half adder
ABSC
0000
0110
1010
1101

Try it Click the inputs to change them.

S0C0

How it works

Write out the four cases: 0 + 0 = 00, 0 + 1 = 01, 1 + 0 = 01 and 1 + 1 = 10. Now look at each output column on its own. S is 1 when exactly one input is 1: that is an XOR gate. C is 1 only when both inputs are 1: that is an AND gate. So a half adder is just two gates side by side.

It is called “half” because it can’t accept a carry coming from the previous column. Adding that third bit is the job of the full adder.

Hints and solution

Try on your own first. Each hint gives away a little more.

  1. 1 + 1 = 10 in binary: S = 0, C = 1.
  2. S is 1 when exactly one input is 1. C is 1 when both are.