How does flash memory write data?

Flash memory writes data in a very different way than traditional hard drives. Instead of relying on moving parts like disks and heads, flash memory uses electrical charges to store data.

How is flash memory structured?

Flash memory consists of memory cells arranged in blocks. Each cell can hold one bit of data in the form of an electrical charge. A charged cell represents 1, while an uncharged cell represents 0. Cells are grouped into pages, typically 4-16KB in size, and pages are grouped into blocks, typically 256KB to 4MB in size.

How are bits written to flash memory?

To write a bit to a flash memory cell, a strong voltage is applied to the cell to inject electrons into the floating gate structure in the cell, charging it up. This charge gets trapped in the floating gate, enabling the cell to store data even when power is removed. To write a 0 bit, the floating gate is discharged of electrons.

What happens during a write operation?

Here are the steps involved in writing data to a flash memory chip:

  1. The write command and data are received by the flash memory controller.
  2. The controller identifies the correct block and page to write to based on the logical address.
  3. The page in the block is erased by discharging all the cells to the uncharged (1) state.
  4. The new data is programmed into the page by selectively charging cells to represent 1s.
  5. The new page data is read back and compared to the input data to verify it was written correctly.
  6. If verification fails, steps 3-5 are repeated until successful.

Why is erasing required before writing?

Flash memory cells can only transition from 1 to 0 when programmed – electrons can be injected into the floating gate to charge it, but not removed easily. To set cells back to 1s, an entire block must be erased together by discharging the floating gates of all cells. This reset allows cells to then be re-written by programming selected cells to 0 as needed.

What is the page write process?

The basic write operation programs a single page at a time. The steps include:

  1. The page to be written is erased by resetting all cells to 1.
  2. The input data is buffered into a page register circuit.
  3. The data is programmed into the page by applying high voltage pulses to inject electrons into selected cells based on the page register contents.
  4. The page data is read back into the register and compared bit-by-bit to the input data.
  5. If any bits fail to verify, they are reprogrammed and verified again until successful.

This process repeats for each page that needs to be written. Writing can take up to several milliseconds for each page.

What is the block erase process?

Before writing new data to a block, the entire block must first be erased:

  1. The target block is selected and an erase command issued.
  2. An erase voltage pulse is applied to the memory cells’ substrates to discharge the floating gates.
  3. The block is verified to check all cells read 1s.
  4. If any bits fail to verify as erased, steps 2-3 are repeated until successful.

A block erase can take up to several hundred milliseconds due to this iterative verify process.

Why does flash use erasing and programming steps?

Flash memory utilizes this erase-before-program process for a few reasons:

  • Cells can only transition from 1 to 0 when programmed, requiring erase to reset cells from 0 to 1.
  • Erasing resets cells to a known state before new data is written.
  • It allows blocks to be erased and re-written without affecting other blocks.
  • It enables flash memory to emulate random access write behavior despite its inherent block structure.

What is the difference between NOR and NAND flash writes?

NOR and NAND flash use different interface methods:

  • NOR flash – Provides direct random access to memory cells like RAM. Writes data to cells directly. Supports true byte-level random writes.
  • NAND flash – Access data sequentially in pages and blocks. Requires page erase before write. Doesn’t support true random write access.

NAND architecture provides higher densities by removing random access circuits, while NOR provides full random access at lower densities.

What is the write endurance of flash memory?

Flash memory cells can only withstand a limited number of erase cycles before becoming unreliable. Typical flash endurance ratings:

  • SLC NAND flash – 100,000 erase cycles
  • MLC NAND flash – 3,000-10,000 cycles
  • TLC NAND flash – 1,000 cycles

Higher-end enterprise SLC flash can reach 1 million cycles. Wear leveling algorithms help distribute writes across all cells to maximize overall endurance.

How has flash memory scaling affected writes?

As process geometries shrink, flash memory faces challenges including:

  • Reduced write endurance due to thinner oxide layers
  • Slower write speeds due to capacitive coupling between cells
  • Higher error rates requiring more robust ECC (error correction coding)

Manufacturers combat these issues with advanced materials like 3D NAND, proprietary programming algorithms, and stronger ECC implementations.

What performance factors affect flash write speeds?

Key factors impacting write performance include:

  • Interface – Faster interfaces like NVMe enable higher data transfer speeds.
  • Parallelism – More channels and chips allow concurrent access to increase write throughput.
  • Program algorithms – Multi-step programming pulses optimized for a given flash type and density.
  • Garbage collection – Cleaning up invalid pages creates free space for writes but impacts performance.

Better interfaces, architecture, algorithms, and processors enable modern SSDs to deliver upwards of 3.5GB/s write speeds.

How is flash memory write performance measured?

Flash write speed is measured in several ways, including:

  • Page program time – Time to write one page, measured in microseconds.
  • Block erase time – Time to erase one block, up to a few milliseconds.
  • Sustained throughput – Steady write speed with garbage collection, measured in MB/s or GB/s.
  • IOPS – Small random write performance in Input/Output Operations Per Second.
  • Latency – Time from write command to completion, a major performance metric.

Faster page program times, lower latencies, higher sustained throughput and IOPS all contribute to improved real-world write speeds.

How does flash write performance compare to hard drives?

Flash memory offers vastly faster write performance than hard disk drives. A comparison:

Flash SSD Hard Disk Drive
Sustained Write Throughput Up to 3.5GB/s Up to 250MB/s
Write IOPS 100,000 to 750,000 A few hundred
Write Latency 10-100 microseconds 2-5 milliseconds

Flash write speeds are up to 1,000x faster than hard drives thanks to inherent advantages of solid-state technology.

How do SLC, MLC and TLC compare in writes?

Higher flash memory cell bit density comes at the cost of slower write speeds and endurance:

SLC MLC TLC
Bits per cell 1 2 3
Write Speed Faster Slower Slowest
Endurance 100,000 cycles 3,000-10,000 cycles 1,000 cycles

However, controllers and algorithms help maximize performance – even TLC NAND can achieve 500MB/s writes in modern SSDs.

What is 3D NAND and how does it impact writes?

3D NAND flash stacks memory cells vertically in 32-100+ layers rather than shrinking cells on a 2D planar layout. This provides density improvements without shrinking cells and impacting performance. Key advantages include:

  • Higher write endurance – 10x more cycles than planar NAND
  • Faster writes – Better scalability to higher capacities
  • More reliable – Less cell-to-cell interference

3D NAND enables flash vendors to continue improving storage density, performance and endurance as planar NAND limitations are reached.

Conclusion

Flash memory provides fast and reliable storage through ingenious use of electrical charges in floating gate cells. Carefully engineered program, read and erase operations enable NAND flash to emulate random access memory while providing the density advantages of block storage. Continued evolution of flash technology including 3D NAND will enable solid state storage to keep pace with growing speed and reliability demands.