LogicGates.org Open the simulatorSimulator

Half adder

A half adder is a combinational circuit that adds two single bits and produces a sum bit and a carry bit, using one XOR gate for the sum and one AND gate for the carry.

Adds two bits. Two gates.

Circuit diagram

Toggle the inputs and follow the signals: green wires are high, red are low. The highlighted row of the truth table below is the one you have set.

sum 0 carry 0

Truth table

AB sumcarry
00 00
01 10
10 10
11 01

Boolean expressions

sum
a ⊻ b one XOR gate
carry
a ∧ b one AND gate

How it works

Adding two single bits has four cases, and the two output columns turn out to be gates you already know. The sum is 1 when exactly one input is 1, which is XOR. The carry is 1 only when both are, which is AND. It is called a half adder because it has nowhere to accept a carry coming in from the column to its right.

Where it is used

  • The least significant column of an adder, where there is no carry in.
  • Incrementing a value by one, which is an adder with the second input tied to a constant.
  • A first custom node to build, because everything larger is made of these.

Build it

Two toggles, an XOR and an AND fed from the same two inputs, and two displays. Package it as a custom node and the full adder becomes three parts.

Open the simulator

Or draw it from the expressions above with the circuit diagram generator, in either symbol standard, and export it as SVG, PNG, Verilog or VHDL.

Reference card

The diagram above as an image, black on white, for notes or a slide.

Half adder logic circuit diagram with inputs a = A, b = B: sum from a ⊻ b, carry from a ∧ b Click to download: Half adder circuit diagram

Questions about the half adder

What is the truth table of a half adder?

Four rows. Inputs 00 give sum 0, carry 0; 01 and 10 give sum 1, carry 0; 11 gives sum 0, carry 1. The sum column is the XOR of the inputs and the carry column is their AND, which is the whole circuit.

Why is it called a half adder?

Because it does half the job of adding a column of bits: it adds the two bits in the column but has no input for a carry arriving from the column to its right. A full adder has that third input, and a half adder is what you use in the rightmost column where no carry can arrive.

How many gates does a half adder need?

Two, an XOR and an AND. Built from NAND gates only it takes five: four for the XOR, and although a separate AND would cost two more, the NAND of the two inputs already sits inside the XOR, so one extra NAND inverting it gives the carry.

The other circuits