Ch 9 · Gates That Do Arithmetic · Theory

Topic 9 of 10 in Boolean Logic & Logic Gates — How Machines Decide — 3 lessons.

The Half Adder

Here's where logic gates and binary numbers meet. Adding two single bits, A and B, gives a sum and possibly a carry:

The Full Adder

A half adder can't accept a carry *coming in* from a previous column — but real addition needs that. A full adder takes three inputs (A, B, and carry-in) and produces a sum and carry-out. Chain one full adder per bit and you can add whole binary numbers — this is literally how a CPU's ALU adds.

Why This Matters

You've just seen the bridge between the last two tutorials: numbers are stored in binary, and gates perform arithmetic on them. Stack adders, and add a few control gates, and you have an ALU — the part of the CPU that does the maths. Everything a computer calculates traces back to gates like these.

All topics in Theory Boolean-logic

  1. Why Logic Gates
  2. NOT, AND, OR
  3. NAND, NOR, XOR
  4. Truth Tables
  5. From Problem to Circuit
  6. Logic Expressions
  7. Boolean Algebra (A Level)
  8. Karnaugh Maps & Flip-Flops (A Level)
  9. Gates That Do Arithmetic
  10. Check Your Understanding