This content originally appeared on DEV Community and was authored by Hari R
An Example
Let’s say you and your friend are playing a secret game using a flashlight.
- Flashlight ON = Yes (1)
- Flashlight OFF = No (0)
You both agree on a secret code:
- One flash = “Hello”
- Two flashes = “Come here”
- No flash = “Goodbye”
Even though you’re just using ON and OFF, you’re communicating. That’s the key idea.
Now… Imagine a Computer Doing the Same Thing
Inside every computer are billions of tiny flashlights — well, kind of.
They’re called transistors, and they also have two states:
- Electricity flowing = ON (1)
- No electricity = OFF (0)
So just like your flashlight game, a computer uses these ONs and OFFs to form patterns — and those patterns represent letters, pictures, songs, even entire video games.
Same Example, Now in Tech Terms:
Let’s say you press the letter A on your keyboard.
- Your computer turns that into a pattern of ONs and OFFs: 01000001
- Each 1 or 0 is made by a transistor turning electricity ON or OFF
- Billions of these switching patterns fly through the computer’s brain (the CPU)
- The screen reads the pattern and shows you the letter A
From your simple key press… to a dance of electricity… to something you see on screen
The Big Idea:
Computers speak in 1s and 0s because they’re made of tiny switches (transistors) that only understand ON and OFF.
Those switches use electricity — and when you control electricity in patterns, you can make a machine understand and do almost anything.
So next time you open your laptop or phone, just remember — there’s a massive, invisible flashlight game happening inside. And it’s how everything works.
This content originally appeared on DEV Community and was authored by Hari R