How a half adder works

A half adder adds two one-bit binary inputs. It produces a sum bit and a carry bit. You can build one with two gates: XOR for the sum and AND for the carry.

Sum and carry

The sum is A XOR B. It is 1 when exactly one input is 1. The carry is A AND B. It is 1 only when both inputs are 1.

Half adder truth table
ABSumCarryBinary result (carry, sum)
000000
011001
101001
110110

For 1 + 1, the answer is binary 10: carry is 1 and sum is 0. The two output bits must be read in the right order; the carry is the more significant bit.

Build it in LogicForge

  1. Install LogicForge for Windows and open the bundled half-adder example, or download the .lfg project.
  2. Trace input A to one input of both the XOR and AND gates. Trace B to the other input of both gates.
  3. Toggle the input switches and watch the sum and carry indicators.
  4. Compare all four input combinations with the table above.

You can also try the interactive half adder on the home page, or test each gate separately in the logic gates simulator.

Half adder vs. full adder

A half adder has no carry input. A full adder takes A, B and a carry-in bit, then produces sum and carry-out. Two half adders and an OR gate can form a full adder: add A and B first, add carry-in to that sum, then OR the two carry outputs.

Chaining full adders allows multi-bit addition. Each stage passes its carry-out to the next stage. The CALC-8 example in LogicForge combines arithmetic and memory into a larger project.