01
Binary numbers
An unsigned n-bit value ranges from 0 to 2ⁿ−1. Two's complement ranges from −2ⁿ⁻¹ to 2ⁿ⁻¹−1. To form −x, invert positive x and add 1.
02
Half-adder
A half-adder adds A and B: Sum=A XOR B and Carry=A AND B. It has no carry-in.
Build it yourself: Half-adder
03
Full-adder
A full-adder adds A, B, and Cin: Sum=A XOR B XOR Cin; Cout=(A AND B) OR (Cin AND (A XOR B)). It can be built from two half-adders and an OR gate.
Build it yourself: Full-adder
04
Ripple-carry adder
In a multi-bit adder, each lower Cout feeds the next Cin. Carry ripple forms a long critical path; delay grows roughly linearly with width.
Build it yourself: 2-bit ripple-carry adder
05
Binary multiplier
Each partial product is an AND of one A bit and one B bit. Shifted partial products are added. Multiplying two n-bit unsigned values may require 2n bits.
Build it yourself: 2×2 multiplier
06
ALU and subtraction
An ALU computes logic and arithmetic candidates and a MUX selects one. Subtraction reuses the adder: A−B=A+NOT(B)+1.
Build it yourself: 1-bit ALU · 1-bit comparator
SELF-CHECK
Check your understanding
Half-adder for 1+1?
Sum=0, Carry=1.
−14 in 8 bits?
11110010.
What does a full-adder add?
A, B, and Cin.
How is A−B performed?
A+NOT(B)+1.