Imagine everything you see on your screen—emojis, photos, music, games...
Emojis
Music
Games
Images
...are all made of just two symbols:
0 1 0 1 0 1
"In the digital world, everything is a number, and every number can be represented as zeros and ones."
This is the foundation of computer science.
We understand rich information:
Only knows two states:
ON (1) / OFF (0)
Switch ON
Switch OFF
The Big Question:
How do we bridge these two worlds? 🌉
Let's start simple: How do we represent the number 11 in binary?
Our number system
11
Decimal (base 10)
Computer's system
????
Binary (base 2)
If we can solve this, we can represent ANY number! 🚀
The number 1234 breaks down as:
$1234 = 1 \times 10^3 + 2 \times 10^2 + 3 \times 10^1 + 4 \times 10^0$
$1234 = 1000 + 200 + 30 + 4$
Same idea, but with powers of 2:
$1011_2 = 1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^0$
$1011_2 = 8 + 0 + 2 + 1 = 11_{10}$
$11_{10}$ = $1011_2$! ✓
Division Method for 23:
23 ÷ 2 = 11 remainder 1
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Read bottom to top: 10111
ASCII System:
'A' → 65 → 01000001₂
'a' → 97 → 01100001₂
'0' → 48
→ 00110000₂
Global characters:
'你' → U+4F60
'😀' → U+1F600
4 billion+ characters!
Every image is made of pixels. Each pixel has a color defined by mixing Red, Green, and Blue light.
Red
(255, 0, 0)
Green
(0, 255, 0)
Blue
(0, 0, 255)
Yellow
(255, 255, 0)
White
(255, 255, 255)
Black
(0, 0, 0)
The Math:
3 colors × 256 values each = 16,777,216 possible colors!
A 1920×1080 image = 2,073,600 pixels × 3 bytes = ~6 MB!
We can represent everything as numbers. But look at this:
Is this:
The Problem:
The same binary sequence could mean different things! How does the computer decide? 😰
📸 Images:
Millions of pixels, each with 3 color values
How do we know where one pixel ends and another begins?
🎵 Sound:
44,100 samples per second for CD quality
How do we distinguish sound from image data?
🎬 Video:
24-60 images per second, each with millions of pixels
How do we organize this massive amount of data?
😱 Without context, it's just meaningless bytes!
The Magic: File Headers
Every file starts with special bytes that tell the computer what type of data follows:
FF D8 FF...
.JPEG image
→ Decode as pixels
89 50 4E 47...
.PNG image
→ Decode as pixels
25 50 44 46...
.PDF document
→ Decode as text/graphics
FF FB...
.MP3 audio
→ Decode as sound
Same bytes, different meaning—thanks to context! ✓
1️⃣ Numbers
Decimal → Binary using
division method
23₁₀ = 10111₂
2️⃣ Text
Characters → ASCII/Unicode
codes → Binary
'A' = 65 = 01000001₂
3️⃣ Images
Pixels → RGB values (0-255)
→ Binary
(255,0,0) = Red pixel
4️⃣ Sound
Waves → Samples (44.1k/sec) →
Binary
Continuous → Digital
5️⃣ Video
Image sequences → 24-60 fps →
Binary
Flipbook effect
6️⃣ Context
File headers tell computers
how to interpret
.jpg, .mp3, .txt
The Power:
Every app, website, film, and
game is built on this foundation of binary representation!
Transistors: billions of tiny switches
ON = 1, OFF = 0
Programs that interpret binary
Numbers → Text → Images → Sound
The Foundation of Computer Science
Everything is information. Information is numbers. Numbers are binary.
"Understanding representation is the first step to understanding computation."
- QuiverLearn