← Unit

Bit Lab

Size
Lab 1 · Why do computers use zeros and ones?

A computer can only distinguish two states

Inside the processor there are billions of transistors. Each one works like a switch: it lets current through or it does not. We call that smallest state, 0 or 1, a bit (binary digit).

Why two states and not ten

5 V threshold 0 V 010 101

A real signal has noise, but that does not matter: everything above the threshold is a 1 and everything below it is a 0. With two states that are far apart, the computer almost never makes a mistake. With ten voltage levels, a little noise could turn a 6 into a 7.

With n bits, how many combinations are there?

Combinations82³ = 8

Every bit you add doubles the number of combinations. With 8 bits (one byte) there are 256: numbers from 0 to 255.

Switch on bulbs and make a number click on each bulb

Binary00000000 Decimal0 Hexadecimal00 Octal0
All off = 0
Each position is worth double the one on its right: 1, 2, 4, 8, 16, 32, 64, 128. The number is the sum of the bulbs that are on. Try "Shift left ←": moving all the bits one position to the left multiplies by 2, just as adding a zero in decimal multiplies by 10.