Skip to content

Binary and Bits

Every photo, song, and video game on your phone — all of it, no exceptions — is stored as an enormous string of just two symbols: 0 and 1. That sounds like a strange way to represent something as rich as a photograph of your dog, but it turns out that “only two options” is exactly what makes electronics reliable, cheap, and fast enough to build a modern computer.

Why only two symbols?

A MOSFET switch is either conducting or it isn’t — there’s no natural “half on” state that a circuit can hold onto reliably. Electrical noise, tiny voltage wobbles, and manufacturing variation all make it hard to distinguish, say, 10 different voltage levels cleanly. But distinguishing just two — “high voltage” versus “low voltage” — is easy even in a noisy, imperfect wire. Engineers picked two states because two states are almost impossible to get wrong.

🧩 Think of it like… a light switch on a wall. You can tell instantly whether it's up or down, even in a dim room, even if the switch is a little worn. Now imagine a dimmer switch with ten brightness settings — in poor light, is it set to 6 or 7? That ambiguity is exactly the problem chip designers avoid by sticking to just "on" and "off."

Each 0 or 1 is called a bit (short for “binary digit”) — the smallest possible unit of information a computer can store or move. Group 8 bits together and you get a byte, the unit typically used to represent one character of text or one small number. A kilobyte, megabyte, and gigabyte are just 1,024 bytes, 1,024 kilobytes, and 1,024 megabytes respectively (computers count in powers of two, since that’s what falls naturally out of binary digits).

Counting in binary

We’re used to counting in base 10 (decimal), where each digit position represents a power of ten: ones, tens, hundreds, and so on. Binary works exactly the same way, except each position represents a power of two.

N=i=0n1bi2iN = \sum_{i=0}^{n-1} b_i \cdot 2^i

Here NN is the decimal value, bib_i is the bit in position ii (either 0 or 1), and 2i2^i is the place value of that position — 1, 2, 4, 8, 16, and so on, doubling each time you move left. So the binary number 1011 means: one 8, zero 4s, one 2, one 1 — that’s 8+0+2+1=118 + 0 + 2 + 1 = 11 in decimal.

    flowchart LR
    subgraph Binary["Binary: 1 0 1 1"]
    direction LR
    b3["1<br/>(2³ = 8)"] --- b2["0<br/>(2² = 4)"] --- b1["1<br/>(2¹ = 2)"] --- b0["1<br/>(2⁰ = 1)"]
    end
    Binary --> Sum["8 + 0 + 2 + 1 = 11 (decimal)"]
  

Counting up in binary looks unfamiliar at first, but it’s mechanical once you see the pattern:

DecimalBinaryDecimalBinary
0000081000
1000191001
20010101010
30011111011
40100121100
50101131101
60110141110
70111151111

Just like a car odometer rolls “9” over to “10”, a binary digit rolls “1” over to “0” and carries into the next position — it just happens after every 2 instead of every 10.

With nn bits you can represent 2n2^n distinct values. That’s why an 8-bit byte can hold 256 different values (0 through 255), and why a 32-bit number tops out around 4.3 billion — a limit that mattered a lot before 64-bit computing became standard.

From bits to voltage

Inside a real chip, a bit isn’t an abstract symbol — it’s a voltage on a wire. A typical modern chip might treat anything above roughly 0.7 of its supply voltage as a logical “1” and anything below roughly 0.3 of it as a logical “0”, leaving a deliberate no-man’s-land in between that a well-designed circuit should never sit in for long. That mapping — voltage in, clean binary digit out — is what lets a physical device (the transistor) implement an abstract idea (a bit). Everything you’ll see in the logic gates and CMOS logic pages builds directly on this: gates take voltages representing bits as input and produce a voltage representing a new bit as output.

Voltage on a wire, over timeVdd0V10101forbidden zone

Key takeaways

  • Computers use binary (0/1) because two clearly separated voltage states are far more reliable to detect than many close-together levels.
  • A bit is one binary digit; 8 bits make a byte; larger units (KB, MB, GB) scale by powers of 1,024.
  • Any binary number can be converted to decimal by summing bi2ib_i \cdot 2^i over each bit position.
  • On a real chip, a bit is physically represented as a high or low voltage, which a transistor switch can read and act on.

Continue to Logic Gates to see how these bits get combined and transformed, or jump back to the MOSFET to review the physical switch underneath it all.