Build kit

How a CPU Counts

The second kit in the Hardware Basics series. We build from transistors what every processor counts with — the adder: from one bit to eight, negative numbers and subtraction, the C, Z, N, V flags, comparison and a signed calculator. Bonus: decimal math, as in pocket calculators. A standalone kit that starts from the transistor. 1,208 transistors.

This kit is free: all lessons are open, no sign-up needed.

ABSUB−2

What is inside

  1. Introduction
  2. History: how machines learned to add
  3. Lesson 1. Gates and the half adder: 1 + 1 = 10
  4. Lesson 2. The full adder and 4 bits: the carry runs through the digits
  5. Lesson 3. Negative numbers and subtraction: two's complement
  6. Lesson 4. 8 bits and comparison: CMP is subtraction
  7. Lesson 5. The ± calculator: the minus on a lamp, the magnitude on the display
  8. Lesson 6 (bonus). Decimal math: add six
  9. Summary
  10. All the parts
  11. Instructions in pictures