Why Flash Memory Remembers With the Power Off
You already know the bargain behind the three kinds of storage, and you know how a hard drive holds on to a file: magnetism, on a spinning disc, sitting there whether the power is on or not.
Now look again at what was said about the other two. Information in an SSD or a USB stick is "held electronically". That is not really an answer. Electricity is the thing that stops when you pull the plug — so how can a file made of electricity survive being switched off?
Electricity does not need to be moving
The word "electricity" usually makes people think of something flowing: a current running down a wire, going somewhere.
But an electric charge does not have to go anywhere. Rub a balloon on your hair and it sticks to a wall. Nothing is flowing. There is simply some charge on the balloon that has nowhere to go, and it stays put until it finds a way out.
That is the whole idea behind flash memory. It does not keep a current running. It keeps a small amount of charge stuck.
A room with no doors
Inside a flash chip there are billions of tiny cells. Each one is built in layers, and the important layer is a small patch of metal called the floating gate.
It is called floating because it is not joined to anything. It is walled in on every side by a material that electricity cannot cross — the same reason the plastic round a cable keeps the current inside. There is no wire in, no wire out, no path anywhere.
So if you can get some charge in there, it has no way of leaving. Not when the power goes off. Not when the computer is thrown in a drawer for a year.
So how does anything get in?
Here is the part that sounds like cheating, and is not.
Given a big enough push — a much higher voltage than the chip uses for ordinary work — some charge can be forced straight through the wall and into the floating gate. It is not going round the wall or through a gap. It is being shoved through a barrier that would normally stop it.
Once it is through, the push stops, and the wall goes back to being a wall.
Step through one cell being filled, left alone, and read.
Four stages in the life of a single cell. Watch stage 3 especially — it is the one where nothing happens, and that is the whole point of it.
- The floating gate is empty. Read this cell and you get a 0.
- A high voltage on the control gate forces charge through the wall and into the floating gate.
- The power is switched off. The charge is still in there, because there is nowhere for it to go.
- To read the cell, a current is sent along the wire underneath. Charge sitting overhead makes that current harder to push through — and how hard it is to push through is the answer.
Stage 4 is worth reading twice. The computer never looks inside the floating gate. It cannot. It asks a question about the wire underneath, and the answer to that question depends on what is trapped above.
A 1 and a 0 are not two different things stored in the cell. They are the same cell, easy or hard to push a current through.
Why this explains the price
Both facts you already know about SSDs come out of this.
Why it is fast. There is no arm and no disc, so there is no waiting for anything to spin round. Reading a cell means putting a voltage on a wire and seeing what happens, and every cell is the same distance away — which is to say, no distance at all.
Why it costs more. A hard drive stores more by adding another metal disc. A flash chip stores more by having more cells, and every single cell has to be built with its own walled room, at a size far too small to see. The disc is cheap because it is one plain object. The chip is expensive because it is billions of tiny ones.
The catch nobody mentions
Forcing charge through a wall damages the wall a little. Not much — but a little, every single time.
After enough writes the wall stops being a perfect wall, and the cell can no longer hold its charge reliably. Flash memory does not last forever. It lasts a certain number of writes.
This is why an SSD quietly spreads your writing around instead of using the same cells over and over, a habit called wear levelling. If your computer kept rewriting one cell, that cell would wear out while billions of others sat unused. So it does not. It keeps moving on.
A USB stick sits in a drawer for a whole year with no power at all. Why is the file still on it?
- The stick has a tiny battery inside keeping the memory alive
- The charge is sealed inside the floating gate and there is no path out of it
- The file is rewritten from the magnetic disc each time you plug it in
- Files only disappear from a computer if you delete them
Next time you pull a USB stick out without thinking about it, that is what you just did: shut a few billion tiny rooms and walked off with them in your pocket, each one still holding the pinch of electricity somebody forced into it.