Binary & Data Representation
How computers store and process data using 1s and 0s
Computers only understand two things: 0 and 1. Everything — text, images, videos, games — is stored as patterns of 0s and 1s (binary).
Binary Number System:
Binary to Decimal Conversion:
1011 in binary = (1×8) + (0×4) + (1×2) + (1×1) = 8 + 0 + 2 + 1 = 11 in decimal
Decimal to Binary:
25 in decimal: 25 = 16+8+1 → 11001
Hexadecimal (Base 16):
Uses digits 0-9 and A-F (A=10, B=11... F=15)
Used because it's shorter than binary: FF in hex = 11111111 in binary = 255 in decimal
Data Storage Units:
1 bit → 1 nibble (4 bits) → 1 byte (8 bits) → 1 KB (1024 bytes) → 1 MB → 1 GB → 1 TB
How Data is Stored:
Key Points to Remember
- 1Binary uses base 2 (0 and 1), Hex uses base 16 (0-F)
- 28 bits = 1 byte, 1024 bytes = 1 KB
- 3ASCII assigns numbers to characters (A=65)
- 4Images = pixels with colour values, Sound = samples at intervals
Pakistan Example
Easypaisa & JazzCash Transactions
When you send Rs 1,000 via Easypaisa, your phone converts everything to binary. Your phone number (11 digits) is stored as binary. The amount 1000 in binary is 1111101000 (10 bits). The MPIN you enter gets converted to binary, encrypted (scrambled using complex binary operations), and sent over the network as electromagnetic signals representing 0s and 1s. Even the beep sound you hear is stored as binary samples. Millions of binary digits fly through Pakistan's mobile networks every second for just one transaction!