What is binary?
Binary is a number system that uses only two digits: 0 and 1. Every piece of data your computer processes is stored as a sequence of these two digits. Electronic circuits have two natural states, on (1) and off (0).
How binary counting works
In binary (base-2), each position represents a power of 2: 1, 2, 4, 8, 16, 32, 64, 128, and so on.
Binary to decimal: step-by-step
Example: Convert 1011 to decimal
- Position 3 (value 8): digit is 1 → 1 × 8 = 8
- Position 2 (value 4): digit is 0 → 0 × 4 = 0
- Position 1 (value 2): digit is 1 → 1 × 2 = 2
- Position 0 (value 1): digit is 1 → 1 × 1 = 1
- Total: 8 + 0 + 2 + 1 = 11
Decimal to binary: the division method
Example: Convert decimal 25 to binary
- 25 ÷ 2 = 12 remainder 1
- 12 ÷ 2 = 6 remainder 0
- 6 ÷ 2 = 3 remainder 0
- 3 ÷ 2 = 1 remainder 1
- 1 ÷ 2 = 0 remainder 1
- Reading remainders bottom to top: 11001
Why computers use 8-bit bytes
A single binary digit is called a bit. Eight bits form a byte. One byte can represent 2⁸ = 256 different values (0–255).
Binary addition
Rules: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (write 0, carry 1).
1010 + 0111 = 10001 = decimal 17. Check: 10 + 7 = 17. Correct.