Half Adder

The simplest binary addition circuit — adds two single bits and produces a sum and carry output.

Why This Matters

The half adder is the introductory arithmetic circuit in digital design. With just two gates — an XOR and an AND — it performs binary addition for the least significant bit position where there is no incoming carry. It is the starting point for understanding how computers do math.

While the half adder is too limited to use alone in multi-bit arithmetic (it cannot accept a carry-in from a previous stage), it is a direct building block for the full adder, which can. Understanding the half adder’s equations and construction prepares you to understand the full adder and all the adder-based circuits that form the ALU.

A half adder is also a concrete illustration of how Boolean expressions translate directly into gate circuits: look at the truth table, read off the equations, wire the gates.

Binary Addition Rules

When adding two single bits, there are four possible cases:

ABSumCarry
0000
0110
1010
1101

The last row is the key insight: 1 + 1 = 2, and in binary, 2 is represented as “10” — a sum bit of 0 with a carry of 1 into the next position. This is exactly the same as decimal carrying: when the sum exceeds what one digit can hold, you carry to the next column.

Boolean Equations

From the truth table:

Sum = A XOR B

The XOR operation produces 1 only when inputs differ — exactly when the sum is 1 (cases where one input is 1 but not both).

Carry = A AND B

The AND operation produces 1 only when both inputs are 1 — exactly when the addition produces a carry.

These two equations are the complete definition of a half adder. Two gates, two outputs.

Gate Implementation

Draw the half adder circuit:

  1. Connect inputs A and B to both an XOR gate and an AND gate.
  2. XOR output = Sum.
  3. AND output = Carry.

The XOR gate and AND gate share the same two inputs and operate in parallel. There is no feedback, no clock — this is a pure combinational circuit.

Parts needed:

  • 1 XOR gate (e.g., one gate from a 74LS86 quad-XOR IC)
  • 1 AND gate (e.g., one gate from a 74LS08 quad-AND IC)
  • Or: build from NAND gates (4 NAND gates for XOR + 2 NAND for AND = 6 NAND gates total)

Building from NAND Gates Only

Since NAND is universal, the half adder can be built entirely from NAND gates:

Let N1 = NAND(A, B)

  • Sum = NAND(NAND(A, N1), NAND(N1, B))
  • Carry = NAND(N1, N1) = NOT(N1) = AND(A, B)

That is:

  • N1 = NAND(A, B) = NOT(A AND B)
  • N2 = NAND(A, N1)
  • N3 = NAND(N1, B)
  • Sum = NAND(N2, N3)
  • Carry = NAND(N1, N1) [i.e., N1 fed to both inputs of a NAND gate, acting as inverter]

Total: 5 NAND gates. One quad-NAND IC (e.g., 74LS00, which contains 4 NAND gates) plus one gate from a second IC is sufficient, though you could get both Sum and Carry using the five gates from a 74LS00 plus a second quad-NAND if you need no other gates.

Limitations: Why “Half”?

The half adder is “half” of what is needed for multi-bit addition. It can only be used at the least significant bit position because it has no carry-in input. For all other bit positions — every position except the rightmost — you must be able to add a carry from the previous stage. The full adder adds this third input.

To add two 4-bit numbers:

  • Bit position 0: use a half adder (no carry-in)
  • Bit positions 1, 2, 3: use full adders (carry-in from previous stage)

Alternatively, use four full adders and tie the carry-in of the first stage to ground (logic 0). This is simpler to build since you only need one type of component.

Practical Exercise

Build a half adder on a breadboard:

  1. Place a 74LS86 (quad XOR) and 74LS08 (quad AND) on the breadboard.
  2. Connect VCC (+5V) and GND to each IC’s power pins.
  3. Wire switches for A and B inputs (use 10 kΩ pull-down resistors so the inputs are 0 when the switch is open).
  4. Connect A and B to pin 1 and pin 2 of one XOR gate and one AND gate.
  5. Connect the XOR output to a green LED (Sum) and the AND output to a red LED (Carry), each with a 330 Ω current-limiting resistor.

Test all four input combinations:

  • A=0, B=0: both LEDs off (Sum=0, Carry=0)
  • A=0, B=1: Sum LED on, Carry LED off
  • A=1, B=0: Sum LED on, Carry LED off
  • A=1, B=1: Sum LED off, Carry LED on

If the Carry LED lights for A=1, B=1 and the Sum LED is off, the circuit works. The carry light with the sum light off at 1+1 is the “binary carry” moment — the fundamental action that makes multi-bit binary arithmetic possible.