为什么NA​​ND闪存单元只有空的时候才能直接写入?

发布于 2024-09-11 01:34:22 字数 50 浏览 2 评论 0原文

我试图理解为什么在写入 SSD 之前必须先擦除单元,以及它们如何随着时间的推移而变慢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

谁把谁当真 2024-09-18 01:34:47

根据现代闪存芯片的设计方式,在一个方向上对单元进行编程比在另一个方向上更容易。如果一个芯片在 256 个 65,536 字节的块中保存 16,777,216 字节,每个块只能作为一个单元进行擦除,那么它将需要约 1.28 亿个“小”电路来允许对各个位进行编程,并需要 256 个“大”电路来擦除这些块。对于允许擦除 256 字节页的芯片来说,需要 65,536 个这样的“大”电路。我不确定芯片的哪一部分会被这么多页擦除电路耗尽,但这将是重要的。使用更大的擦除块可以使芯片的制造成本更便宜;对于许多应用来说,具有大擦除块的较便宜的芯片比具有较小擦除块的较昂贵的芯片更可取。

The way modern flash chips are designed, it's easier to program a cell in one direction than the other. If a chip holding 16,777,216 bytes in 256 blocks of 65,536 bytes each can only be erased as a unit, then it will require ~128 million "little" circuits to allow programming of the individual bits, and 256 "large" circuits to erase those blocks. For the chip to allow pages of 256 bytes to be erased would require 65,536 of those "large" circuits. I'm not sure what fraction of the chip would be used up by that many page-erase circuits, but it would be significant. Using larger erase blocks allows chips to be manufactured more cheaply; for many applications, a cheaper chip with large erase blocks is preferable to a more costly chip with smaller ones.

第七度阳光i 2024-09-18 01:34:43

我试图理解为什么在写入之前必须擦除单元格

在写入之前不必擦除闪存单元。但是,您一次只能写入一整块单元格。通常,这些单元块的大小至少为 128KB。

假设您正在向 SSD 写入一个 4KB 文件。嗯,您必须一次写入一个 128KB 的块。如果该 128KB 块中已经有数据,则驱动器固件必须将 128KB 块读入其内存,修改要写入的 4KB 部分,然后将整个 128KB 块写回闪存。

I'm trying to understand why you have to erase cells before writing to them

You don't have to erase a flash memory cell before writing to it. However, you can only write to one entire block of cells at a time. Typically these blocks of cells are at least 128KB in size.

So suppose you are writing a 4KB file to your SSD. Well, you have to write one 128KB block at a time. If there is already data in that 128KB block, the drive firmware has to read the 128KB block into its memory, modify the 4KB section you are writing to, and then write the entire 128KB block back out to the flash memory.

扛起拖把扫天下 2024-09-18 01:34:40

维基百科文章似乎至少暗示了答案。看来“隧道注入”用于写入,“隧道释放”用于擦除。我将让物理学家来准确解释其含义。

The Wikipedia article seems to at least hint at the answer. It appears that "tunnel injection" is used for writing and "tunnel release" for erasing. I'll leave it to the physicists to explain exactly what the implications of that are.

驱逐舰岛风号 2024-09-18 01:34:37

为什么要先擦除再写入?

擦除单元意味着从其浮动栅极中去除大部分电子。浮栅中没有电子通常代表二进制 1:

erased cell

此图和下图来自 “闪存如何工作?(SSD)” 作者:闪电战

假设一个单元格代表一位(称为单级单元格,或简称 SLC),您可以非正式地说擦除写入操作:通过擦除单元将单元/位设置为 1,这意味着从浮栅中移除大部分电子。另一方面,用电子填充浮动栅极是将位设置为 0 的物理实现方式:

programmed cell

A non - 具有有效电子量的空单元(代表 SLC 的零)被称为编程单元。

这里重要的是,闪存中的擦除(将位设置为 1)是相当粗粒度的:您擦除通常由大约 40,000 个单元组成的整个块。批量擦除单元比擦除单个单元更快。这种全块擦除策略是 EEPROM 与闪存的区别。顺便说一句,这也是闪存名称的由来:

据东芝称,“闪存”这个名称是由增冈(闪存的发明者)同事有泉正司建议的,因为内存内容的擦除过程让他想起了相机的闪光灯。 — 来自维基百科

当一个单元通过其包含的电子数量表示多个位时,我可以想到在将电子放入电池之前要清空电池的两个原因:

  1. 您只能增加单个电池的电子数量。降低电子计数的唯一方法是擦除,这意味着从整个细胞块中去除(几乎)所有电子。我不知道是否有任何 SSD 采用这种快捷方式来表示不同的状态:“只是”增加单元中的电子数量,而不先将其清空。
  2. 正如苏黎世联邦理工学院 Jisung Park 的此视频讲座中所述:写入单元格不可靠,获得适量的电子很困难,需要多次尝试(另请参阅增量步进脉冲编程)。从一个空电池开始,逐渐填充它,直到它具有适量的电子,这比尝试添加正确数量的电子和电池中已存在的其他电子更可靠。而且,如上所述,您只能增加而不是减少单个细胞的电子。

随着时间的推移,电池的速度减慢

将电子移入和移出浮栅会物理损坏浮栅周围的绝缘屏障。在足够的写入和擦除后,二氧化硅 SiO2 开始泄漏存储在浮置栅极中的电子。如果不加以处理,这些泄漏会导致数据损坏。例如,由于失去电子,电池的值自行从 101 变为 011。为了避免数据损坏,SSD 会定期刷新这些单元。

老化电池的另一个问题是,读取或写入它们可能需要更长时间,因为在太多电子穿过浮栅周围的二氧化硅绝缘体后,它们变得更加不可靠。

如以下带注释的屏幕截图所示,摘自 精彩视频 ://www.youtube.com/c/BranchEducation" rel="nofollow noreferrer">Branch Education,那些二氧化硅 (SiO2) 绝缘体可以少于 100 个原子,大约 8 个纳米,宽:

具有绝缘体厚度的 NAND 存储单元

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

强辩 2024-09-18 01:34:33

以下是写入 NAND 和擦除的工作原理:

当擦除一个块时,所有位都设置为 1。要将位从 1 更改为 0,需要对位进行编程(写入)。编程无法将位从 0 更改为 1。

假设您必须存储值 11001100。首先,需要擦除该块以表示全 1 (11111111)。然后,对特定位进行编程(11001100)。现在,相同的内存位置无法编程为 11111100,因为编程无法将 0 更改为 1。

这就是 NAND 找到全 1 的空闲/空页,然后将特定位从 1 更改为 0 的原因。传统的想法是写入可以将 1 变为 0,而 0 变为 1,对于 NAND 闪存来说则不然。事实上,NAND 编程操作只能将位从 1 更改为 0,这意味着我们在开始写入之前需要擦除页。

下图展示了页面和块的关系,来自flashdba.com 上的一篇文章

SSD Hierarchy

有关更多信息,请参阅美光 NAND 闪存介绍

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文