Half Adder

Inputs

PinTypeDescription
AbitFirst addend
BbitSecond addend

Outputs

PinTypeDescription
SumbitA XOR B
CarrybitA AND B

How It Works

A half adder adds two bits exactly the way you add in columns in the lowest digit. 0+0 — write 0. 1+1 — write 0 and carry the one. Here the "column" is two inputs A and B, "write" is the Sum output, and "carry" is the Carry output.

Each output has its own gate: Sum = A XOR B (a one when exactly one input is active), Carry = A AND B (a one when both are). Check it on 1+1: XOR gives 0, AND gives 1 — together they form 10₂, which is 2. Two gates add bits as reliably as a school notebook.

The limitation is hidden in the name: this is only "half" of an adder. It has no carry input, so it cannot accept a one arriving from the lower digit. Adding columns with a carry — say, 11+11 — is beyond the half adder: for that you need a full adder with a CarryIn input.

Truth Table and Examples

ABSumCarry
0000
0110
1010
1101

The first three rows are ordinary addition without a carry: 0+0=0, 1+0=1, 0+1=1. The last row is the most interesting: 1+1=2, written in binary as two bits, Carry=1 and Sum=0, that is 10₂. Set A=1 and B=1 — the Sum lamp goes dark while Carry lights up.

Usage

The half adder is the hero of Level 6, where it is assembled from two gates: XOR and AND. Alone it adds only the lowest bits, but that is where the 8-bit adder begins (Level 8): the half adder serves bit 0, and its Carry feeds the CarryIn of the first full adder in the chain.

The circuit is useful beyond addition. The Carry output is a ready-made "both inputs are one" detector, and the Sum+Carry pair encodes all four outcomes of comparing two bits. Most of all, the half adder is a stepping stone: once you understand it, you will build a full adder from two such blocks and one OR.

Interactive Demo

Click inputs to toggle value (0 / 1)

Build it yourself →

Related components

Related articles

Frequently Asked Questions

Why is it called a half adder?

It adds two bits without an incoming carry. A full adder additionally accepts the carry from the lower bit.

Which gates make up a half adder?

Only two: XOR computes the sum bit, AND computes the carry bit. It is the most compact arithmetic circuit in the course.

Can half adders alone add multi-bit numbers?

No: a half adder cannot accept a carry from a neighboring digit. In a chain it sits only in the lowest bit; full adders take over from there.