Every computer system runs on electricity. At the hardware level, billions of microscopic transistors switch between two states—on (1) and off (0). Explore how those electrical pulses build base-2 numbers, how they convert to base-10 decimal, what happens when bits shift or overflow, and why humans rely on hexadecimal shorthand.
Base-2 · Binary
0, 1
Two digits matching transistor states (off and on). Columns double right-to-left.
Base-10 · Decimal (Denary)
0–9
Ten digits used in everyday life. Each column multiplies by 10 moving left.
Base-16 · Hexadecimal
0–9, A–F
Sixteen digits where each symbol compacts four binary bits (one nibble).
01 · Physical Layer
Transistors turn electricity into binary digits
All computer systems run on electricity. Inside a microchip, tiny electronic components called transistors act as switches that allow electrical current to be either on or off in a circuit.
In binary logic, an electrical pulse that is on represents 1, and off represents 0. By combining large banks of transistors together, a computer represents numbers, text, colours, and instructions.
Toggle the eight switches on the right—starting from the source pattern 10101110—to see how physical circuit states map directly to an 8-bit binary byte and its decimal value.
8-Transistor Switchboard (1 Byte = 8 Bits)
Binary Pattern
1010 1110
Active Switches Sum
128 + 32 + 8 + 4 + 2
Decimal Value
174
02 · Base-2 & Base-10
Place value multiplies each column by its base
Base-2 Place Value Columns (Powers of 2) — Click any bit101011102
Base-10 Place Value Columns (Powers of 10)17410
Step-by-Step Conversion Method
Comparing the Systems
The base of a number system defines how many unique digits a column can hold before spilling over to the left.
Property
Decimal (Base-10)
Binary (Base-2)
Digits used
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
0, 1
Column multiplier
× 10 moving left
× 2 moving left
First 4 columns
1,000 · 100 · 10 · 1
8 · 4 · 2 · 1
Counting & Spillover
How binary counts upward
Just as decimal resets 9 to 0 and carries 1 into the tens column, binary columns start at 0, rise to 1, and then spill over into the next column, resetting the smaller column back to 0.
Try loading 12 (00001100) and clicking +1 Count repeatedly to watch the rightmost columns reset and spill left.
03 · Arithmetic, Shifts & Limits
Shifting bits multiplies, divides, and risks overflow
Binary Shifts Explained
Because each binary column is worth twice the column to its right, sliding every bit in a register produces instant multiplication or division by powers of 2:
Logical Left Shift (<<): Moves every bit left and fills empty spaces on the right with 0. Shifting left by n places multiplies by 2n (1 place = ×2, 2 places = ×4).
Logical Right Shift (>>): Moves every bit right and fills empty spaces on the left with 0. Shifting right by n places divides by 2n, discarding any remainder bits that fall off the right edge.
4-Bit Binary Addition & Carry Lab
Rules: 0+0=0, 0+1=1, 1+1=10, 1+1+1=11 (and 1+1+1+1=100 with carry). Click any input bit below to toggle it.
8-Bit Shift Register Simulator
Shifted Out (Left)
—
Shifted Out (Right)
—
Register Ready
Current stored value: 13. Perform a left or right shift to observe bit movement.
Real-World Overflow · 1996
Why memory size matters: the Ariane 5 explosion
Overflow errors occur when a calculation or conversion produces a value larger than the memory allocated to store it. They can have severe consequences: in 1996, the European Space Agency (ESA) launched an unmanned rocket called the Ariane 5.
During flight, the rocket’s guidance software converted a 64-bit number into a 16-bit number. Because the value was larger than 32,767 (the maximum positive signed 16-bit integer), an overflow error occurred. The corrupted number caused the rocket to receive data claiming it was off course; the rocket boosters immediately overcorrected, causing the explosion.
04 · Base-16 Shorthand
Hexadecimal groups four bits into one readable digit
Hexadecimal is a base-16 number system consisting of 16 digits: 0–9 followed by the letters A, B, C, D, E, F (representing 10 to 15). Moving from right to left, place value columns multiply by 16 (1, 16, 256…).
Because four binary digits (one nibble) represent values from 0 to 15, every nibble maps cleanly to exactly one hexadecimal digit—for example, binary 1110 equals E (14). Splitting an 8-bit byte into two nibbles makes conversion fast and reliable.
Key Distinction
Computers still only understand binary. Hexadecimal is not faster for a processor to execute—it exists for humans. It shortens long binary strings so programmers and designers make fewer mistakes when reading web colours, MAC addresses, and memory dumps.