8How does a cell store a bit? 1Inject electrons: Hot electron injection mechanism, or Fowler-Nordheim tunneling mechanismRemove electrons: Fowler-Nordheim tunneling mechanism
9Single-level cell and Multi-level cell Single-level cell: Two levels One bit1cellcellMulti-level cell: q levels bits12q-1cellcellcellcellTypical number of cell levels: 2, 4, 8, 16
10How is a cell programmed? Through multiple rounds of charge injectionSource: [Bandyopadhyay, Serrano, Hasler 2005]Target levelA flash cell
11Speed and physical limits Speed of operations:Read: FastWrite: Slower (due to multiple rounds of programming)Erase: Very slowPhysical limits:Endurance. (In NOR, a block can stand about 100,000 to1,000,000 erasures.In NAND, it can stand 10,000 to 100,000 erasures.)Physical size (e.g., 34nm).Voltage.Number of electrons.
12NOR and NAND Flash Memories NOR: Older, still used.NAND: Newer, much more popular now.
13What is a NOR flash memory Cells form blocks. A blockhas about 100,000 cells.2. NOR is a random-access device. Every cell is directly addressable by the processor. That is, a cell can be individually read and programmed.Word lineBit lineControl gateFloating gate(-)Oxide layerDrainSourceflash memory cell
15Block erasureIn NOR, the level of a cell can be increased individually andmultiple times. But to lower any cell level, the whole blockmust be erased at the same time.Blockblock of cells
16What is a NAND flash memory Cells form blocks. Every block is an array. Every row is a page.BlockpagepageTypically: 32 to 128 rows (pages)pagepageRead and write:A page as a unit.Typically: 512 to 2048 cellsin a row (page)Block erasure!!!!!!
17Writing a page in NANDA page can be written only once before the block is erased.It is even recommended that the pages are written sequentially.Page 1Partial writing: A page is partitionedinto 4 parts, and we can write a partat a time.Page 2…………Page 64Part 1Part 2Part 3Part 4A pageNote: This is logic partition.Why?: Programming is not very accurate, especially withmultiple times of writing (for the same page, andfor the interference between pages).
18A typical NAND page with spare bytes 64 Bytes of spare areaA page:2KB of dataMetadataECCUndefined bits
19Comparison of NOR & NAND flash Basic difference: Different ways to connect cells in a block.Additional difference: Ways to inject charge, used voltages.NOR: cellsare independentNAND: Cells in thesame column areconnected (and disturbeach other).
20Comparison of NOR & NAND flash 1. Lower density.1. Higher density.2. Random access.2. Page access.3. More reliable.3. Less reliable, error-prone.(Requires ECCs.)4. Slower erase.4. Faster erase.5. Faster random read.5. Faster streaming read.6. Mainly to store code.6. Mainly to store data.
22Wear levelingWear leveling: Let the blocks be erased about the same number of times.Method: Write data in different places (instead of the same block).How to know the block’s level of wearing out:Count the number of erasures, orMeasure the performance of its cells (e.g., erase latencies), orOther methods?Alternative approach: Just use randomization (i.e., randomly usethe blocks, and hopefully, things will even out).
23Wear leveling techniques Simple case:If all the data in a block are obsolete, just erase it.Write in blocks that are less worn out.What if the blocks contain both obsolete and valid data?Page 1: validPage 2: obsoletePage 3: obsoletePage 4: obsolete…………Page 64: valid
24Combining wear leveling with garbage collection This happens when we want to re-use those blocks that containboth valid and invalid (obsolete) data.Approaches:Use a cost/benefit ratio to decide which block to erase.(Before erasing it, the valid data need to be moved first.)(2) Store frequently-changing data together, and store datathat do not change much together. (Reason: After a while,in a block containing frequently-changing data, most of thedata are probably already invalid.)(3) Many heuristic approaches. (And many patents.)Most important: Design it based on the application.
25When garbage collection is done Garbage collection (of blocks) can happen when:As background work, i.e., when CPU is idle; or(2) On demand, i.e., when there is not enough free space.
26Mapping How to use flash memories to store data? One approach: Treat the flash memory as a block device, much like disk sectors.Advantage: Allow standard file systems to use flash.Problems with a simple linear mapping from virtual blocks to flash-memory pages:Some blocks can be erased too often.Unable (or inefficient) to write data smaller than a flash block.Solution: Wear leveling (that is, to move data around).Mapping between virtual blocks and physical pages is needed.The spare part in a page may have bits indicating if the page is free/used orvalid/obsolete.
27Mapping Direct map Virtual blocks Physical pages Inverse map Stored in RAM, or partiallyin RAM and partially in flash.Inverse mapPhysical pages Virtual blocksStored in flash.Flash Translation Layer (FTL):A technique tostore some of the direct map in flash, andreduce the cost of updating the maps stored in flash.
28Flash file systemsTens of flash file systems (FFS) have been designed.Clearly, more of them will be designed……A flash file system:Is a data structure that represents a collection of mutablerandom-access files in a hierarchical name space.Provides the block mapping technique.Does wear leveling and garbage collection.Maybe design a different, more flash-specific file system?Do the same for data structures, such as B-trees and R-trees.
29More flash-specific file systems Most of the flash-specific file systems use the same overall principle, that of a log-structured file system.Why? It is easier to record the small changes (and write them down sequentially), than to rewrite the whole file.
30What happens when the blocks are read/erased/writtenagain and again…
31Disturb mechanismsWrite/read disturb: When a cell is programmed (or read), the cells inthe same column/row are softly programmed.For some MLC, it is even recommended that after reading the same page1000 times, write the clean data back again.
32Errors, Signal processing, and ECCs When a block is erased, its quality goes down.The rate of errors increases…Types of errors:Random errors.Fixed-position errors (because the cells really becomedefected).Cells in the same column can become bad together.Ways to correct errors:Signal processingECCs (Hamming, BCH codes.)(Reed-Solomn codes? LDPC codes? Under study.)
33New Area in Information Theory: Coding for Flash Memories
35Rewriting codes WOM (write-once memory) code Floating code: Joint coding of multiple variablesExample: 2 bits are stored in 3 cells with 4 levels. Every time one bit is changed.How many rewrites can be supported?0,11,11,11,00,10,01,00,0Now use floating codes.
36Floating codes cell levels data Example: 2 bits are stored in 3 cells with 4 levels. Every time one bit is changed.cell levelsdata
37Rewriting codes 3 writes 7 writes WOM (write-once memory) code Floating code: Joint coding of multiple variablesExample: 2 bits are stored in 3 cells with 4 levels. Every time one bit is changed.How many rewrites can be supported?3 writes7 writes0,11,10,01,0Now use floating codes.0,11,10,01,0
38Floating codesWhen two binary variables are stored in n cells of q levels, an optimalfloating code can support rewrites.When k variables of alphabet size L are stored in n cells of q levels, thenumber of rewrites that a floating code can support is:If n is large rewritestimes betterIf k,L are large Roughly rewritesNo coding Roughly rewrites
39More general model for rewriting Floating codes: Every rewrite changes one variable.011111State transitions of data001101Example: 3 binary variablesHypercube010110000100Buffer codes: Remember most recent data. [BJB’07]State transitions of data: De Bruijn graphMore general: [JLSB’09]Maximum degree:The data change in abounded-degree graph.
40Trajectory code for bounded-degree rewrite Model: The state-transition diagram of the data has boundeddegreeThis code is asymptotically optimal.[Jiang, Langberg, Schwartz, Bruck, ISIT’09]
42Cell Programming Noisy, monotonic Trend: more levels, smaller cells Question: How to write datareliably when cells cannot beprogrammed reliably?Challenges: overshoot, worst-case constraint.Approach: adaptive cell-ensemble programming.Rank modulation is such an approach.
43Rank Modulation Analog cell levels induce permutations. Example: 3 cells can induce 3!=6 permutationsPermutations represent data.Method of programming: from low to high.Advantage: no overshoot, adaptive coding.123132213231312321
44Rewriting; Error correction Rewrite: How to rewrite data in the rank modulation scheme?Error correction: How to design error-correcting codes? What does error mean?
45A few other topics: (3) Data movement Block 1Block 2Block nEmpty blockNo coding:erasures are needed.With coding:erasures are needed.[Jiang, Mateescu, Yaakobi, Bruck, Siegel, Vardy, Wolf, ISIT’09]