Number Base Systems
| System | Base | Digits Used | Example |
|---|---|---|---|
| Binary | 2 | 0, 1 | 1010₂ = 10 |
| Octal | 8 | 0–7 | 12₈ = 10 |
| Decimal | 10 | 0–9 | 10 |
| Hexadecimal | 16 | 0–9, A–F | A₁₆ = 10 |
Binary Arithmetic Rules
Subtraction uses two's complement method
Binary × 2 = left shift by 1 bit
Binary ÷ 2 = right shift by 1 bit
Powers of 2 Reference
| 2^n | Decimal | Binary |
|---|---|---|
| 2⁰ | 1 | 1 |
| 2¹ | 2 | 10 |
| 2² | 4 | 100 |
| 2³ | 8 | 1000 |
| 2⁴ | 16 | 10000 |
| 2⁷ | 128 | 10000000 |
| 2⁸ | 256 | 100000000 |
| 2¹⁰ | 1,024 (1 KB) | 10000000000 |
| 2²⁰ | 1,048,576 (1 MB) | 100000000000000000000 |
Frequently Asked Questions
Why do computers use binary?
Electronic circuits are most reliable with two states: on (1) and off (0). Binary arithmetic can be implemented with simple logic gates (AND, OR, NOT). Using more states would require more complex and error-prone circuitry. Binary maps directly to the physical reality of digital electronics.
What is two's complement?
Two's complement is the standard method for representing negative numbers in binary. To negate a number: invert all bits (one's complement) then add 1. This lets the CPU perform subtraction using the same addition circuits. An 8-bit signed integer ranges from −128 to +127.
How do I convert a decimal fraction to binary?
Multiply the fractional part by 2 repeatedly, recording the integer part each time. For example, 0.625: 0.625×2=1.25 (bit=1), 0.25×2=0.5 (bit=0), 0.5×2=1.0 (bit=1) → 0.625 = 0.101₂. Some fractions (like 0.1) have infinite binary representations, causing floating-point rounding in computers.