Build An 8-Bit Computer by Ben Eater - Registers and Arithmetic Logic Units (ALU) (Kit 2 of 4)
Registers: Most CPUs have several registers which store small amounts of data the CPU is processing. In our simple breadboard CPU, we'll build three 8-bit registers: A, B, and IR. The A and B registers are general-purpose registers. IR (the instruction register) works similarly, but we'll only use it for storing the current instruction that is being executed. Register build videos below.
Arithmetic Logic Unit (ALU):
The arithmetic logic unit (ALU) part of a CPU is usually capable of performing various arithmetic, bitwise and comparison operations on binary numbers. In our simple breadboard CPU, the ALU is only able to add and subtract. It is connected to the A and B registers, and it outputs either the sum of A+B or the difference of A-B. ALU build videos below.
Before diving into building the ALU, check out these two videos (below). The first shows how we can use hardware to add numbers in binary. The second video explains how negative numbers work. Between the two videos, you'll know how to add negative numbers which means you'll know how to subtract!