Inside Flash Memory and Drives
In 1984, Dr. Fujio Masuoka of Toshiba announced flash to the world. Today, flash memory is everywhere – pen drives, thumb drives, MP3/MP4 players, digital cameras, PDAs, and virtually all portable electronic devices that need to store data. In fact, they’re slated to replace hard disk drives pretty soon.
Inside a flash drive
Flash drives basically store data on an electronically erasable programmable read only memory (EEPROM) chip. This has a lattice of columns (bitlines) and rows (wordlines). Each point of intersection is a cell. A typical flash chip contains billions of such cells. Each cell is made of a transistor – a MOSFET, to be precise – which has an additional gate called a ‘floating’ gate added on to it.
MOSFETs
A MOSFET (Metal Oxide Semiconductor Field Effect Transistor) is midway between a diode (two p and n type semiconductor layers) and a transistor (sandwiched layers of p-type and n-type semiconductor layers). An n-type semiconductor releases electrons more readily, while and p-type semiconductors allow electrons to flown into them easily. The MOSFET, however, is
- Fowler-Nordhein Tunneling: This is a phenomenon where electrons are emitted from a semiconductor into a dielectric or a vacuum when persuaded by a powerful electric field. Unlike other forms of emission, electrons pass through a barrier – instead of working around it – because it has not yet lost its wave function and, decaying into the barrier, thus heightening the probability of it emerging on the other side.
- Hot Carrier Injection: If an electron or a ‘hole’ ( an absent electron) in a semiconductor can be made to gain sufficient kinetic energy to pass through a barrier, the process is known as ‘Hot Carrier Injection’.
The two most common kinds of flash memory are NAND and NOR. The terms are from Boolean logic and are immensely useful for the creation of universal Boolean operations.
NAND – which is short for ‘Not AND’ refers to the Boolean logic operation that says that if any one input is false, the conclusion is true. Since computers only understand zeroes and ones, in the language of electronics, if any one input is a 0 (zero), the output must be a 1 (one). NOR (short for ‘Not OR’) is a Boolean which is true if none of the inputs are true – i.e. if any – or both – of the two inputs is a one (1), the result is a zero. Both of these can be used to make NOT, AND, OR XOR or XNOR, and so they’re called ‘Universal Gates’ – and that’s what makes them useful.
NAND and NOR gates are so designed as to function in the above manner. As you can see in the figure, the Control Gate in every cell is connected to the horizontal ‘Word Line’ (WL). The ‘Bit Line’ (BL) connects all the drains together – which is actually the data bus of the chip. The Source Line (SL) connects all the sources to the ground.
NAND vs NOR
NAND and NOR basically differ in architecture and they both have their pros and cons. NAND has its cells arranged in a series – like a NAND gate – and therefore lets you erase and write data faster, uses less space (about 60 per cent of a NOR flash) because it doesn’t need so many
How flash drives work
Any data storage device must be able to perform the three basic actions of Write, Read and Erase. Whether it’s NAND or NOR, reading, writing or erasing are all controlled entirely by the voltage combination applied to the WL and the BL. In the case of flash drives, it’s all about
Erasing
Since none of the Floating Gates (FG) contain negative charge to begin with, all the bits will be set to ‘1’. Ergo, if you want to erase a programmed cell, you’ll need to set it back to ‘1’ – or rather, compel the FG to empty itself of electrons. Applying a voltage (between about 9V and 12V) from the source to the control gate along a Word Line would cause the electrons trapped in the Floating Gate to break out and ‘tunnel’ to the Source and the p-type substrate. The Floating Gate is now free of electrons and set again to ‘1’.
Programming
Given that all the cells are already at ‘1’, programming a blank flash memory device becomes restricted to setting a cell to the binary ‘0’ value. To write into a flash drive, then, a high voltage (about 7V) is applied to the Bit Line (the Drain) and a higher one (around 12V) to the Word Line (the Source). Electrons will now flow from the Source to the Drain. Typically, some over-excited electrons will jump and tumble into the FG (remember the ‘Hot Carrier Injection’ process?), getting trapped there, giving a negative charge. Turn the power off and the electrons still stay there, thanks to the insulation of the oxide around the FG. Thus, entire blocks of cells can be programmed into millions of sequences of zeroes and ones, literally, at the speed of light.
Reading
When a current is passed from the Control Gate (about 5V) to the Drain (about 1V), the current begins to flow between the two. The voltage is not high enough to bump electrons into the FG if it is not negatively charged but high enough to detect insulation or conduction at every cell. The cell sensor tracks the current flow and identifies whether a particular cell is conducting or remains insulating. Accordingly, it arrives at a binary code of ones (1s) for every conducting cell and zeroes (0s) for every insulating one.
Types of flash drives
When it comes to flash storage devices these days, NOR flash takes a back seat and it seems to NAND all the way. Two basic forms of NAND are the preferred form of storage in solid state devices today: Single-Level Cells (SLC) and Multi-Level Cells (MLC).
Single-Level Cells
Multi-Level Cells
Manufacturers, like Intel, use the same transistors for their SLC and MLC flash. The difference is in how data is stored or read. In the case of a Multi-Level Cell, every cell can represent four states:
a) 00 (two zeroes) indicate that the cell is fully programmed:
b) 01 (a zero and a one) represent a partially programmed cell:
c) 10 (a one and a zero) show that the cell is partly erased:
d) 11(two ones) indicate that the cell is fully erased
SLCs vs. MLCs
Let’s take a better look at the differences between SLC and MLC flash drives.
MLCs take longer time to read and write data because it needs to track more minute gradations. SLCs can read and write data much faster. However, an MLC flash can hold double the number of transistors on the same wafer size as compared to an SLC flash. This allows greater density and thus, more memory on the same size chip bringing down the cost per MB. Cheap thumb drives or pen drives, therefore, prefer MLC.
SLCs, however, score on one parameter – lifespan. Every flash drive has a limited number of erase/programmed cycles. This is because the silicon oxide material that is used to separate the Floating Gate from other parts of the cell suffers wear and tear with the repeated ‘tunneling’ of electrons during erasure or programming. By and by, the material dissipates and electrons don’t move about the way they should. Note that reading does not reduce life of the flash memory because the process does not involve the passage of electrons through the oxide, only detection of voltage difference.
All SSDs erase in blocks (groups of pages) and write in pages (groups of cells). At the rate we go about juggling data in our flash drives, the average drive should wear out really fast. Luckily, SLC flash drives deteriorate only after about 100,000 write/erase cycles – which could last decades, unless you insist on rewriting all day and night for several years at a stretch (MLCs last for only about 10,000 such cycles). Deleting data is different. When you erase data, the drive doesn’t really erase it, but only marks a set of pages as ‘invalid’ and stops showing them up when you open the drive folder on your screen. It then waits until you write in some data, removes the data from the ‘erased’ cells and puts the new bit values into them. This reduces the wear and tear and increases the lifespan of the drive.
Of course, not all drives delete the same way. Some poorly built flash drives have high Write Amplification factors – which is a technical way of talking about how much ‘writing’ actually happens. Therefore, if you want to change just a few pages of data, the drive will erase the entire block that contains those pages, make the changes and write the new block in, thus increasing the number of times ‘tunneling’ happens. This reduces the lifespan of the drive. To put it briefly, MLCs have a high density and can hold more data at cheaper costs and smaller sizes, while SLCs need less power, are more durable and allow faster writing and erasing of data. Choice a particular kind of drive would depend on your requirements.
Flash memory is not without its drawbacks. Some cells get unintentionally programmed while programming other adjacent ones ( a phenomenon called ‘Program Disturb’). Sometimes the threshold value is misread and a ‘1’ is recorded instead of a ‘0’ (called ‘Read Disturb’). Charge may leak out of the FG, affecting data retention. Some question the ability of flash drives to store information when it comes to less than 30 nanometers. Manufacturers all over the world are working to better the existing technology and eliminate the drawbacks of both, MLCs as well as SLCs. For all practical purposes, NAND will do for the average consumer for the next few years at least. Flash is the future.
How to protect your Flash Drive
Never lost your pen drive or got a virus infection in it? You’re kidding me. Given that they’re featherweight and getting tinier by the day, chances of your flash memory device getting into the wrong hands are increasing day by day. And everybody knows how the ‘Autoplay’ function in Windows gets Trojans and worms into the works. Here are a few tips to safeguard your flash data:
- Buy a wire protected flash drive: Once a flash drive is write protected, data will only get written if you disable the ‘write protect’ function.
- Put in a password: There’s plenty of freeware on the web which allows you to password protect your flash drive, thus ensuring that only you have access to the data in it.
- Encrypt the data: If you do this, even after somebody cracks your password, the data will only look like gobbledygook to him.
- Anti-virus: Clean your flash drive of malicious software every time you plug it into a computer, using reliable anti-virus software.