What is flash memory? It is a type of memory that can store data without power and can erase memory in blocks. It is a type of electronically erasable programmable read only memory (EEPROM).
Computers store information on their memory chips in binary, which means everything is reduced to a 1 and a 0. When the computer wants to read the information, it scans the memory chip and translates the 1s and the 0s back into something that we can read, or an image or a movie. Every character you are reading has been rendered from binary. For example, “hello” in binary is 0100100001000101010011000100110001001111. H – 01001000, E – 01000101, L – 01001100, L – 01001100, O – 01001111.
However, the computer doesn’t actually store the information as 1s and 0s. There are three different methods it uses. The first method is in random access memory where the information is stored using electrons. A memory chip is made up of billions of capacitors. These capacitors are able to hold electrons. If a capacitor is holding electrons, then it is a 1 and if a capacitor is empty of electrons, then it is a 0. A single capacitor is a bit of data and there are 8 bits in a byte, so a byte has 8 capacitors. “Hello” has 40 different bits of data, which is 5 bytes. A 16-gigabyte memory card has 128 billion capacitors. The capacitors cannot hold the electrons when the computer is turned off, so RAM is only usable when the computer has power. The second way is on the hard disk drive where the information is stored magnetically. The computer has a spinning hard disk and it stores the information on it by marking microscopic lines that are magnetic. When the computer reads the information, every magnetic line is considered a 1 and every nonmagnetic line is considered a 0. The third method uses transistors to hold a charge and this is how flash memory works. A transistor is made of a conductive material like silicon or germanium. They can take in electrons in the same way as a capacitor, but they don’t lose them. In RAM, the presence of electrons makes a 1, but with flash memory, an electron charge makes a 0 and no charge is a 1. Because they don’t lose their electrons, they keep the data when they are switched off as well.
A transistor has two ends. The electrons can enter in through the one end, called the source, and they can leave the transistor through the other end, called the drain. There is a gate at one end and electrons are stored in the transistor when the gate is closed, being read as 0. If the gate is left open, the electrons go straight through and the transistor is empty, being read as 1. With non-flash memory, when the power is turned off, the electrons don’t stay in the transistor. Flash drives need to work when there is no power source and this is done with something called a floating gate. A floating gate is a gate just like the one that keeps the electrons in the transistor, but it is separated from the transistor by a thin, oxide layer. The oxide is an insulator but because it is thin, electrons can pass through it if there is a strong enough current. When the computer writes to a flash memory, it uses enough current that the electrons fill the transistor, pass across the insulating layer and stick to the floating gate. The computer uses enough current for the electrons to pass over the floating gate, but they don’t have enough energy to get back across, so they stay stuck to the floating gate. They can stay that way for years without any extra power and without loss of memory.
When you want to erase data from the flash memory, the computer supplies an electric current to the entrance of the transistor and a negative charge to the gates. This repels the electrons on one side and attracts them on the other so they jump across the insulating layer and leave the transistor. Flash memory drives are very useful because they can store the information without needing any power, but they can’t be used indefinitely. Every time the gates are electrified, they wear a little. Different drives have different ratings but they are good for about 100,000 write / erase cycles before they start to leak data. And this is what I learned today.
Photo by Kei Scampa: https://www.pexels.com/photo/unrecognizable-person-showing-usb-on-blurred-background-4318581/
Sources
https://www.techtarget.com/searchstorage/definition/flash-memory
https://www.techopedia.com/definition/24481/flash-memory
https://www.gridgain.com/wiki/How_In-Memory_Computing_Works
https://androidgrl.github.io/2019/01/01/binary/
https://study.com/learn/lesson/binary-language-explained.html
https://builtin.com/hardware/transistor
https://www.quora.com/How-is-data-written-or-read-on-a-flash-drive
https://volga.eng.yale.edu/teaching-resources/flash-drives/methods-and-materials