lesson

Updated 6 days ago
Every photo, song, and video game on your device looks completely different on screen. Yet deep inside the hardware, all of it is stored as one simple thing: microscopic electrical switches flipped on or off.
A single switch is called a bit, short for binary digit. When electricity flows through the switch, it represents a 1 (on), and when no electricity flows, it represents a 0 (off).
๐Interactive diagram
A single switch can only say yes or no, so how do we store letters, colors, or whole words?
From Bits to Bytes
To store complex information, computers bundle 8 bits together into a unit called a byte. With 8 switches, you get 28=256 unique combinations of 0s and 1s.
Computers use agreed-upon translation tables called character encoding (like ASCII or Unicode) to match each byte combination to a specific letter, number, or symbol.
๐Interactive diagram
If millions of bytes form your files, where does your computer keep them while you are working versus when you power down?
RAM vs. Permanent Storage
Your computer uses two distinct types of storage: fast temporary memory and durable long-term storage. RAM (Random Access Memory) holds active data that the processor needs right now, but it is volatile, meaning everything vanishes the instant power turns off.
To keep files safe forever, computers write data to non-volatile storage like Solid State Drives (SSDs) or flash chips, which trap electrical charges in tiny floating cells that hold their values even without power.
๐Interactive diagram