Turning the World Into Switches
How a photo, a song, and your words all become patterns of on and off that a machine can hold.
A quick note on how we teach here. You won't find equations or numbers in this series, and that is on purpose. The goal is understanding, not arithmetic, so every idea is explained in plain words and simple pictures. When you want the math later, the rest of Internals Decoded is ready for you.
Welcome back. In the last two pieces, we saw that a computer is a machine that follows instructions, and that a row of its tiny switches can hold a pattern of on and off. That pattern can stand for a number, counted out in binary. But a computer does not just hold numbers. It holds your photos, your music, your typed messages. How does a picture of a sunset or a favorite song become nothing but switches?
The answer is simple. Anything we want a computer to handle, we first turn into a pattern of on and off. We agree on a code for the translation, and later we use the same code to turn it back so a person can see it or hear it.
A secret code between friends
Imagine you and a friend want to send messages without speaking. You decide on a secret code. When you want to send the word “hello,” you whistle a little tune. Your friend hears the tune and knows it means “hello” because you both agreed on it beforehand. The tune is not the word itself. It is a pattern that stands for the word.
If you wanted to send a whole sentence, you would need a longer pattern, maybe a sequence of different whistles. That is exactly what a computer does. It turns every picture, every sound, every word into a long pattern of on and off switches, using a code everyone agrees on. Nothing magic happens. It is just a translation, like your whistle code.
Turning a picture into switches
Think of a picture made of tiny colored tiles, like a mosaic on a wall. If you stand far back, you see the whole image. Up close, you see a grid of little squares, each a single color. A computer stores a photo in a similar way. It breaks the image into a huge grid of tiny dots. Each dot is called a pixel. When a phone camera boasts about megapixels, it is telling you how many of these dots it records. The grid is so fine that you cannot see the individual dots unless you zoom way in.
For each dot, the computer needs to record the color. To describe a color, the computer uses a small set of numbers. One number says how much red is in the color, another says how much green, and another says how much blue. Mixing these three is how a screen makes the huge range of colors you see on it. So for every single dot, the computer stores those numbers as patterns of on and off. The whole photo becomes a long, long list of switch patterns. When you open the photo later, the computer reads those patterns, rebuilds the grid of colored dots, and paints them on your screen.
Turning sound into switches
Sound is a wave that travels through the air. Picture the ocean. A wave rises and falls smoothly. If you wanted to describe that wave to someone far away, you could take a series of quick snapshots. At each moment, you measure how high the water is. You write down that height. If you take snapshots often enough, the list of heights can be used to redraw the wave.
A computer does this with sound. It listens to the sound wave and takes measurements over and over, at a furious pace. Each measurement is a number that says how strong the wave is at that instant. That number gets stored as a pattern of switches. The computer collects a long list of these measurements. When you play the sound back, the computer reads the numbers, rebuilds the wave, and sends it to a speaker. Your ear hears the smooth wave again, as if the original sound were right there.
Turning words into switches
Words are made of letters. Just like your secret whistle code, the computer has an agreed code for letters. Every letter, every punctuation mark, and even a blank space gets its own pattern of switches. When you type a message, each character is turned into its pattern, one after another. The computer stores that long sequence of switches. Later, it can turn them back into letters on the screen. A sentence you type becomes a string of on and off patterns, no different in principle from the patterns that hold a photo or a song.
The format matters
The translation only works if both sides agree on the code. If your friend thinks your whistle tune means “goodbye” but you meant “hello,” you have a problem. The computer world has many agreed formats so that different machines can share pictures, sounds, and text without confusion. A simple format for a photo might say: “store the red number first, then green, then blue.” When a program opens that photo, it expects the same order. If it expected blue first, the colors would come out all wrong. These shared formats are what let you send a picture from your phone to a friend’s phone and have it look the same. They are called file formats. The letters after the dot in a file name, like jpg or png, tell the computer which one to use.
What we call this
When we take something from the real world and turn it into a pattern of switches that a computer can hold, we call that representing it. The stored pattern is called data. So a photo file is data. A song file is data. Your typed words are data. When you hear people in AI talk about “the data,” they mean these stored patterns that stand for things in the world. The data is not the real sunset or the real song. It is the computer’s picture of it, made of switches.
Where this is heading
Now the computer can hold a picture of the world. It can store a photo, a piece of music, a written message. But holding something is not the same as doing anything with it. A photo sitting in memory is just a silent pattern. The computer still has to be told what to actually do with it, step by step.
Test yourself
A friend opens your beach photo on their computer, and the blue sky shows up orange. The photo looks fine on your phone. Using this piece, what might have gone wrong?
Answer: The photo itself is probably fine. The switches still hold the same patterns. More likely, the program on your friend's computer is reading the color numbers in a different order from the one the photo was saved in. If the photo was stored red first, then green, then blue, but the program expects blue first, it swaps the red and blue numbers for every dot. A blue sky has a lot of blue and only a little red, so after the swap it shows a lot of red and only a little blue, which looks orange. The two sides did not agree on the format. That is why shared file formats matter so much.
Next: A Recipe the Machine Follows. It shows how a computer is told what to do, step by step, with a recipe called a program.