How Computers Represent Information

Opening Image

The Secret Language of Computers

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

Theme Stated

"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.

Setup

The Challenge: Two Worlds

Our World 🌍

We understand rich information:

  • Text: "Hello, World!"
  • Numbers: 1, 2, 3, 1234, 1 million
  • Images: colorful photos
  • Sound: music, voices
  • Video: movies, animations
Computer's World 💻

Only knows two states:

ON (1) / OFF (0)

1

Switch ON

0

Switch OFF

The Big Question:

How do we bridge these two worlds? 🌉

Catalyst

The First Challenge

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! 🚀

Break into Two

Understanding Number Systems

Decimal (Base 10) - What We Know

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$

Binary (Base 2) - Computer's Language

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$! ✓

Fun and Games - Numbers & Text

Converting Everything to Numbers

Step 1: Master Binary Conversion

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

Step 2: Text = Numbers!

ASCII System:

'A' → 65 → 01000001₂
'a' → 97 → 01100001₂
'0' → 48 → 00110000₂

Unicode for Everyone

Global characters:

'你' → U+4F60
'😀' → U+1F600
4 billion+ characters!

Fun and Games - Images

Step 3: Images = Colored Numbers

Pixels: Tiny Dots of Color

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!

Midpoint

The Critical Question 🤔

Wait... How Does the Computer Know?

We can represent everything as numbers. But look at this:

01001000 01000101 01001100 01001100 01001111

Is this:

  • The text "HELLO"?
  • Five separate numbers (72, 69, 76, 76, 79)?
  • Part of an image's color data?
  • Sound wave samples?

The Problem:

The same binary sequence could mean different things! How does the computer decide? 😰

All Is Lost

The Complexity Challenge

The Scale of the Problem

📸 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!

Break into Three

💡 The Solution: Context!

File Formats Provide Context

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! ✓

Finale

The Complete System

How Everything Comes Together

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!

Final Image

From 0 and 1 to Everything

The Hardware 💾

Transistors: billions of tiny switches

ON = 1, OFF = 0

The Software 💻

Programs that interpret binary

Numbers → Text → Images → Sound

The Foundation of Computer Science

Everything is information. Information is numbers. Numbers are binary.

Key Takeaways
Binary (0,1) matches transistor states
Numbers convert using division method
Text uses ASCII/Unicode encoding
Images = pixels with RGB (0-255)
Video = rapid image sequences
Sound = sampled wave data

"Understanding representation is the first step to understanding computation."

- QuiverLearn