Build a half adder
Add two one-bit inputs with XOR and AND gates.
Add two bits
A half adder takes two inputs, A and B, and produces two outputs: Sum and Carry.
XOR calculates the sum bit. AND calculates the carry bit.
Try the circuit
Try 0 + 1, then 1 + 1. When both inputs are 1, Sum is 0 and Carry is 1.
Click an input to change its value.
Read the result as Carry, Sum. For 1 + 1, those bits are 10, the binary representation of two.
| A | B | Carry | Sum |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
Build it in the editor
- Place two Toggle Switch components, an XOR gate, an AND gate, and two Output components.
- Connect both switches to the XOR gate.
- Connect the same switches to the AND gate.
- Connect each gate to its own output.
The XOR output is Sum; the AND output is Carry. Both gates receive the same two input values.
Add a carry input
A half adder has no input for a carry from a previous bit. A full adder adds that third input, which lets several adders work together.