Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can NAND flash memory cells only be directly written to when they are empty?

I'm trying to understand why you have to erase cells before writing to them with respect to SSDs and how they slow down over time.

like image 965
nevster Avatar asked Oct 16 '25 14:10

nevster


2 Answers

Here is how writing to NAND and erasing works:

When a block is erased, all the bits are set to 1. To change bits from 1 to 0, bits are programmed (written to). Programming cannot change bits from 0 to 1.

Let's suppose you have to store the value 11001100. First, the block needs to erased to represent all 1s (11111111). Then, the particular bits are programmed (11001100). Now, the same memory location cannot be programmed to 11111100, because programming cannot change a 0 to 1.

This is the reason NAND finds a free/empty page with all 1s and then changes the specific bits from 1 to 0. The conventional idea that writing can change 1s to 0s and 0s to 1s is not true for NAND flash. The fact that the NAND programming operation can only change bits from 1 to 0, means that we need an erased page before we start writing.

The following figure shows the relationship between pages and blocks, from an article on flashdba.com:

SSD hierarchy

For more, consult this introduction to NAND flash by Micron.

like image 62
Adesh Shetty Avatar answered Oct 18 '25 14:10

Adesh Shetty


Why erasure before write?

Erasing a cell means removing most electrons from its floating gate. No electrons in the floating gate commonly represents binary 1:

erased cell

This and the next illustration are from "How Does Flash Memory Work? (SSD)" by BLITZ.

Assuming one cell represents one bit (that's called single-level cell, or SLC for short), you could informally say that erasing is the write operation: You set the cell/bit to 1 by erasing the cell which means removing most electrons from the floating gate. On the other hand, filling the floating gate with electrons is how setting the bit to 0 is physically implemented:

programmed cell

A non-empty cell with a valid amount of electrons—representing a zero for SLC—is referred to as a programmed cell.

Of significance here is that erasure (setting bits to 1) is rather coarse-grained in flash memory: You erase whole blocks which typically consist of about 40.000 cells. Erasing cells in bulk is faster than erasing individual cells. This whole-block-erasing strategy is what differentiates EEPROM from flash memory. Tangentially, that's also what gave flash memory its name:

According to Toshiba, the name "flash" was suggested by Masuoka's [the inventor of flash] colleague, Shōji Ariizumi, because the erasure process of the memory contents reminded him of the flash of a camera. — From Wikipedia

When one cell represents multiple bits via the amount of electrons it contains, I can think of two reasons why you'd want to empty the cell before putting electrons into it:

  1. You can only increase the amount of electrons for individual cells. The sole way of lowering the electron count is by erasing and that means removing (nearly) all electrons from the whole block of cells. I'm not aware if any SSD takes this shortcut to represent a different state: "just" increasing the amount of electrons in a cell without emptying it first.
  2. As described in this video lecture by Jisung Park of ETH Zürich: Writing to cells is unreliable, getting in the right amount of electrons is difficult and takes multiple tries (see also incremental step-pulse programming). Starting with an empty cell and filling it gradually until it has the right amount of electrons is more reliable than trying to add the correct amount of electrons with other electrons already present in the cell. And, as mentioned above, you'd only be able to increase, not decrease, the electrons for individual cells.

Slowdown of cells over time

Moving electrons in and out of the floating gate physically damages the insulating barriers around the floating gate. The silicon dioxide, SiO₂, starts leaking the electrons stored in the floating gate after enough writes and erasures. If untreated, those leaks cause data corruption. For example, the cell's value changes from 101 to 011 by itself due to lost electrons. To avoid data corruption, the SSD regularly refreshes those cells.

Another problem in aging cells is that reading from or writing to them might take longer since they got more unreliable after too many electrons have been shot through the silicon dioxide insulators around the floating gate.

As shown in the following annotated screenshot from an excellent video by Branch Education, those silicon dioxide (SiO₂) insulators can be fewer than 100 atoms, about 8 nanometres, wide:

NAND memory cell with thickness of insulators

like image 44
Matthias Braun Avatar answered Oct 18 '25 14:10

Matthias Braun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!