Study Web

Digital Logic Foundations

Half and Full Adders

Adder circuits are the foundation of arithmetic in digital computers. The half adder adds two bits; the full adder extends this with a carry-in, enabling multi-bit addition.

Why Adders?

Consider adding two 7-bit binary numbers:

0 1 0 1 1 1 0
+ 0 0 1 1 1 0 0
─────────────────
c 0 1 1 1 1 0 0 (carry row)
= 1 0 0 1 0 1 0

To perform this addition digitally, we need 1-bit adder building blocks — starting with the half adder.

Half Adder

A half adder adds two single bits (X and Y) and produces two outputs: Sum (S) and Carry-out (Co).

S = X ⊕ Y     Co = X · Y

The XOR gate calculates the sum. The AND gate calculates the carry.

XYSum SCarry Co
0000
0110
1010
1101
When X=1 and Y=1, 1+1 = 10 in binary → Sum=0, Carry=1. Two output bits are necessary because the result can be 2 (binary 10).

Full Adder

A full adder adds three bits: two data inputs (X, Y) plus a Carry-in (Ci) from the previous stage. It produces Sum (S) and Carry-out (Co).

S = X ⊕ Y ⊕ Ci     Co = X·Y + Ci·(X⊕Y)
CiXYSum SCarry Co
00000
00110
01010
01101
10010
10101
11001
11111

A full adder can be built from two half adders plus an OR gate:

  1. First half adder: adds X and Y → partial Sum₁ and Carry₁
  2. Second half adder: adds Sum₁ and Ci → final Sum S and Carry₂
  3. OR gate: Co = Carry₁ OR Carry₂

Chaining Full Adders — Multi-bit Addition

To add two n-bit numbers, chain n full adders (or n-1 full adders + 1 half adder for the LSB):

S₀ ← Half Adder(X₀,Y₀)  |  S₁ ← Full Adder(X₁,Y₁,Co₀)  |  ...  |  Sₙ ← Full Adder(Xₙ,Yₙ,Coₙ₋₁)

Each full adder's Co feeds into the next adder's Ci. An 8-bit adder uses 7 full adders + 1 half adder.

Carry propagation: In a ripple-carry adder, the carry must ripple from bit 0 to bit n before the final sum is ready. This creates a delay proportional to the number of bits.

Counting Analogy

A full adder essentially counts how many of its three input bits are high:

  • 0 or 1 inputs high → Sum=0 or 1, Carry=0
  • 2 inputs high → binary 10 → Sum=0, Carry=1
  • 3 inputs high → binary 11 → Sum=1, Carry=1