Skip to content
BetterDL

Binary counting

Also called: counting in binary

Counting up in base 2: 0, 1, 10, 11, 100, … Each step adds 1 at the LSB, and every 1 that overflows resets to 0 and carries left.

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.

B2B1B0

Worked example

Example

What comes after 10111₂?

Flip bits from the right up to and including the first 0.

  1. 1.

    The three trailing 1s become 0s.

  2. 2.

    The first 0 (bit 3) becomes 1.

  3. 3.

    Result: 11000₂. Check: 23 + 1 = 24 = 16 + 8.

Common mistakes

  • Writing 2 after 1. In binary, 1 + 1 = 10.

  • Flipping only the LSB when it's already 1. The carry has to keep going.

  • Forgetting that a fixed-width count wraps back to all zeros.

Practice Binary counting

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Binary counting is taught in Number Systems.