Understanding Number Bases: Decimal, Binary, Hex, and Octal
The number system we use every day is the Decimal system (Base 10). It is called Base 10 because it utilizes ten distinct symbols: 0 through 9. Whenever we count past 9, we add a new column to the left (the "tens" place, then the "hundreds" place, and so on).
However, mathematically, you can construct a number system using any amount of base symbols. A "Base" simply defines how many digits you can count before you have to carry over to the next column.
- Binary (Base 2): Only uses 0 and 1.
- Octal (Base 8): Only uses 0 through 7.
- Hexadecimal (Base 16): Uses 0-9, and then A-F to represent 10-15.
Why Computers Use Binary and Hexadecimal
At their physical core, computers are just massive networks of microscopic switches (transistors). A switch can only be in one of two states: ON or OFF. Therefore, the native language of computer hardware is Binary, where 1 represents ON (electrical current) and 0 represents OFF (no current).
While binary is perfect for hardware, it is terribly inefficient for humans to read. For example, the decimal number 2,000 is written as 11111010000 in binary. This is where Hexadecimal comes in. Because 16 is a power of 2 (2⁴), Hexadecimal maps perfectly to binary. One single Hexadecimal character can represent exactly four binary digits (a nibble). This allows software engineers to condense long, unreadable binary strings into short, manageable Hex codes (like HTML color codes or memory addresses).
How to Convert Numbers Between Different Bases Manually
Converting from Decimal to Binary manually requires a process called "successive division." You divide your decimal number by 2, write down the remainder, and then divide the quotient by 2 again. You repeat this until the quotient is 0. The binary number is simply the remainders read in reverse order.
Converting from Binary to Decimal involves multiplying each bit by 2 raised to the power of its position index (starting at 0 from the right). For example, to convert 101: (1 × 2²) + (0 × 2¹) + (1 × 2⁰) = 4 + 0 + 1 = 5.