Counting in binary works like a car's odometer whose wheels only have two digits, 0 and 1. Add 1 to the rightmost wheel. If it was already 1, it rolls over to 0 and nudges the next wheel, and so on.
0, 1, 10, 11, 100, 101, 110, 111, 1000, …
The rule for adding 1: starting from the right, flip every bit up to and including the first 0. So 1011 + 1 flips the two trailing 1s to 0 and the 0 to 1, giving 1100.
Patterns worth seeing in the sequence:
- bit 0 alternates every step: 0, 1, 0, 1, …
- bit 1 alternates every 2 steps, bit 2 every 4, and bit k every 2ᵏ
- a run of all 1s is always one step before a power of 2:
0111+ 1 =1000
That alternating pattern is what a hardware binary up counter produces, and it's why each counter bit toggles at half the rate of the bit below it.
With a fixed number of bits the count wraps around: in 3 bits, 111 + 1 = 000.