3.3.1Combinational Circuits

Half adder and full adder

2,006 words9 min readdifficulty · medium6 backlinks

WHY do we even need these?

WHAT we want: a circuit that, given input bits, outputs their arithmetic sum in binary.

The catch: 1+1=1021 + 1 = 10_2 — a two-bit answer. So any adder needs two outputs:

  • Sum (the current column's bit)
  • Carry (the bit that spills into the next column)

HOW we discover the logic: build the truth table, then read off the Boolean expression.


Half Adder

Deriving it from scratch

List every input combination and the arithmetic result:

AA BB A+BA+B (decimal) Carry CC Sum SS
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 2 = 10210_2 1 0

Why this step? The table is just "count the ones and write it in binary." No Boolean guessing yet — pure arithmetic truth.

Now read the columns:

  • SS is 1 exactly when AA and BB differ → that's XOR.
  • CC is 1 exactly when both are 1 → that's AND.

Full Adder

Deriving it from scratch

AA BB CinC_{in} sum(dec) CoutC_{out} SS
0 0 0 0 0 0
0 0 1 1 0 1
0 1 0 1 0 1
0 1 1 2 1 0
1 0 0 1 0 1
1 0 1 2 1 0
1 1 0 2 1 0
1 1 1 3 1 1

Why this step? Again, just count the 1s among the three inputs and write the count in 2-bit binary (CoutS)(C_{out}S).

Reading Sum SS: S=1S=1 when the number of 1s is odd (rows with count 1 or 3). "Odd number of 1s" is exactly the XOR of all three: S=ABCinS = A \oplus B \oplus C_{in} Why? XOR flips output each time an input is 1; an odd count leaves it at 1.

Reading Carry CoutC_{out}: Cout=1C_{out}=1 when at least two inputs are 1. Group the minterms: Cout=AB+BCin+ACinC_{out} = AB + BC_{in} + AC_{in} This is the majority function — output the value held by the majority of the three inputs.

Why the second form is equivalent (steel-man the algebra): (AB)Cin=(ABˉ+AˉB)Cin(A\oplus B)C_{in} = (A\bar B + \bar A B)C_{in}. Add ABAB. When A=B=1A=B=1, the ABAB term already fires. When exactly one of A,BA,B is 1, then AB=1A\oplus B=1 so the second term fires iff Cin=1C_{in}=1. This reproduces "≥2 ones" exactly — matching AB+ACin+BCinAB+AC_{in}+BC_{in}. ✓

Full adder from two half adders

Figure — Half adder and full adder

Worked examples


Common mistakes


Recall Feynman: explain to a 12-year-old

Imagine you're adding 1 + 1 with only the buttons 0 and 1. The answer is "two," but you can't write "2" — you only have 0 and 1! So you write a 0 here and carry a little 1 over to the next spot, like carrying in normal addition. The half adder is a tiny machine that does this for two buttons. But sometimes a carry arrives from the right, so you're really adding three things. The full adder is the bigger machine that can handle all three. Line up a row of full adders and they can add huge numbers, one column at a time — that's how computers add!

Flashcards

What are the two outputs of any binary adder cell?
Sum (this column's bit) and Carry (bit passed to the next column).
Half adder Sum equation?
S=ABS = A \oplus B (XOR).
Half adder Carry equation?
C=ABC = A \cdot B (AND).
Why is it called a "half" adder?
It adds only two bits and cannot accept a carry-in from a previous stage.
How many inputs does a full adder have?
Three: AA, BB, and CinC_{in}.
Full adder Sum equation?
S=ABCinS = A \oplus B \oplus C_{in} (odd/parity of inputs).
Full adder Carry-out equation?
Cout=AB+ACin+BCinC_{out} = AB + AC_{in} + BC_{in} (majority function).
Full adder from two half adders — final carry?
Cout=AB+(AB)CinC_{out} = AB + (A\oplus B)C_{in}, i.e. OR of the two half-adder carries.
Common mistake: is half-adder carry OR?
No — it's AND; carry only when BOTH bits are 1.
What multi-bit adder do you get by chaining full adders?
A ripple-carry adder (each CoutC_{out} feeds next CinC_{in}).
For A=1,B=1,Cin=1A=1,B=1,C_{in}=1, what is (Cout,S)(C_{out},S)?
(1,1)=3(1,1) = 3.

Connections

  • XOR gate — the parity behavior powering the Sum output
  • AND gate and OR gate — build the carry logic
  • Ripple-carry adder — full adders chained
  • Carry-lookahead adder — faster carry, avoids ripple delay
  • Truth tables and minterms — the derivation method used here
  • Two's complement subtraction — adders reused for subtraction
  • Combinational circuits — the parent family (no memory, output = f(inputs))

Concept Map

needs two outputs

because 1+1 equals 10 base 2

read off logic

read off logic

adds two bits A and B

cannot accept carry-in

extended to three inputs

adds A, B and Cin

majority of inputs

chained together

Binary column addition

Sum and Carry

Two-bit answer

Truth table

Half adder

Full adder

S = A XOR B, C = A AND B

Incomplete for chaining

S = A XOR B XOR Cin

Cout = AB + BCin + ACin

CPU adds any-length numbers

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, jab hum do numbers add karte hain to har column me ek digit likhte hain aur kabhi-kabhi ek carry aage bhej dete hain. Binary me bhi bilkul yahi hota hai, bas digits sirf 0 aur 1 hote hain. Problem yeh hai ki 1+1=1021+1 = 10_2, yani do-bit ka answer. Isliye kisi bhi adder ke do outputs chahiye — ek Sum (is column ka bit) aur ek Carry (agle column me jaane wala bit).

Half adder sirf do bits (AA aur BB) add karta hai. Truth table banao, dekho: Sum tab 1 hota hai jab dono bits alag hain — yeh to XOR hai. Aur Carry tab 1 jab dono 1 hain — yeh AND hai. Bas: S=ABS=A\oplus B, C=ABC=A\cdot B. Ise "half" kehte hain kyunki yeh pichle stage ka carry-in accept nahi kar sakta.

Full adder teen bits add karta hai — AA, BB, aur CinC_{in}. Sum tab 1 hota hai jab 1's ki ginti odd ho — matlab teeno ka XOR: S=ABCinS=A\oplus B\oplus C_{in}. Aur carry-out tab 1 jab kam se kam do inputs 1 hon — ise majority function kehte hain: Cout=AB+ACin+BCinC_{out}=AB+AC_{in}+BC_{in}.

Sabse important baat: Boolean me ++ ka matlab OR hota hai, arithmetic addition nahi. Isliye Sum kabhi bhi A+BA+B (OR) nahi hoga — woh hamesha XOR hai. Aur agar bahut saare full adders ko chain kar do (har ka CoutC_{out} agle ka CinC_{in}), to bade numbers add ho jaate hain — isi ko ripple-carry adder kehte hain, aur yahi CPU ke andar addition ka core hai.

Go deeper — visual, from zero

Test yourself — Combinational Circuits

Connections