Data writing method of flash memory and control device thereof
阅读说明:本技术 闪存的数据写入方法与其控制装置 (Data writing method of flash memory and control device thereof ) 是由 杨宗杰 于 2015-03-31 设计创作,主要内容包括:本发明公开了一种闪存的数据写入方法与其控制装置,所述闪存包括有多个多层单元,其中每一个多层单元可用来储存多个位,所述方法包括有:分别对所述多个多层单元中的每一个多层单元储存一第一位;判断所述每一个多层单元是否都分别储存了所述第一位;以及当所述每一个多层单元都分别储存了所述第一位时,分别对所述每一个多层单元储存一第二位。本发明可大幅减少所述闪存内满载数据被抹去的次数,并增加所述闪存内未满载数据被抹去的次数,以提高所述闪存的写入速度和使用寿命。(The invention discloses a data writing method of flash memory and a control device thereof, wherein the flash memory comprises a plurality of multi-layer units, each multi-layer unit can be used for storing a plurality of bits, and the method comprises the following steps: storing a first bit for each of the plurality of multi-level cells, respectively; judging whether each multi-layer unit stores the first bit or not; and storing a second bit for each of the multi-level cells when the first bit is stored for each of the multi-level cells. The invention can greatly reduce the times of erasing the full-load data in the flash memory and increase the times of erasing the non-full-load data in the flash memory so as to improve the writing speed and the service life of the flash memory.)
1. A method for writing data into a flash memory, the flash memory comprising a plurality of multi-level cells, wherein each multi-level cell is configured to store a plurality of bits, the method comprising:
storing a set of data on an nth bit of each of the plurality of MLCs on average, wherein n is a positive integer greater than 0;
judging whether the nth bit of each multi-layer unit stores data respectively; and
when the nth bit of each multi-layer unit stores the first bit respectively, storing the (n + 1) th bit of each multi-layer unit respectively;
wherein storing the set of data in the nth bit of each MLC on average comprises, for each MLC:
determining a data polarity of data to be written to the nth bit of the multi-layered cell to determine whether an amount of injected charge is to the multi-layered cell; wherein if the data polarity is a first polarity, a first amount of charge is not injected into a floating gate of the multi-layered cell; and injecting the first amount of charge into the floating gate of the multi-layered cell if the data polarity is a second polarity, the second polarity being different from the first polarity.
2. The method of claim 1, wherein for each of the multilevel cells, the nth bit is a most significant bit stored by the multilevel cell and the n +1 th bit is a least significant bit stored by the multilevel cell.
3. The method of claim 1, wherein for each of the multilevel cells, the nth bit is a least significant bit stored by the multilevel cell and the n +1 th bit is a most significant bit stored by the multilevel cell.
4. The method of claim 1, wherein: also includes:
judging whether each multi-layer unit stores the (n + 1) th bit respectively; and
when the (n + 1) th bit is stored in each multi-level cell, a data one is stored in the (n + 2) th bit of each multi-level cell.
5. The method of claim 4, wherein for each of the multilevel cells, the nth bit is a most significant bit stored by the multilevel cell, the n +1 th bit is a second significant bit stored by the multilevel cell, and the n +2 th bit is a least significant bit stored by the multilevel cell.
6. The method of claim 4, wherein for each of the multilevel cells, the nth bit is a least significant bit stored by the multilevel cell, the n +1 th bit is a second significant bit stored by the multilevel cell, and the n +2 th bit is a most significant bit stored by the multilevel cell.
7. The method of claim 1, wherein the first polarity is bit 1 and the second polarity is bit 0; or the first polarity is bit 0 and the second polarity is bit 1.
8. The method of claim 1, wherein the step of storing the (n + 1) th bit for each of the multilevel cells comprises:
for each of the multi-layer units:
determining the data polarity of the (n + 1) th bit to be written to the multi-level cell;
not injecting a second amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the first polarity and if the data polarity of the n +1 th bit of the multi-layered cell is the first polarity;
injecting the second amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the first polarity and if the data polarity of the n +1 th bit of the multi-layered cell is the second polarity;
not injecting a third amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the second polarity and if the data polarity of the n +1 th bit of the multi-layered cell is the first polarity;
injecting the third amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the second polarity and if the data polarity of the n +1 th bit of the multi-layered cell is the second polarity.
9. The method of claim 8, wherein the second amount of charge is different from the third amount of charge.
10. The method of claim 4, wherein the step of storing the (n + 2) th bit for each of the multilevel cells comprises:
for each of the multi-layer units:
determining the data polarity of the n +2 th bit to be written to the multi-level cell;
if the data polarity of the nth bit of the multi-level cell is the first polarity, if the data polarity of the n +1 th bit of the multi-level cell is the first polarity, and
if the data polarity of the n +2 th bit of the multi-level cell is the first polarity,
injecting no fourth charge amount into the floating gate of the multi-layered cell;
if the data polarity of the nth bit of the multi-level cell is the first polarity, if the data polarity of the n +1 th bit of the multi-level cell is the first polarity, and
if the data polarity of the n +2 th bit of the multi-level cell is the second polarity,
injecting the fourth amount of charge into the floating gate of the multi-layered cell;
if the data polarity of the nth bit of the multi-level cell is the first polarity, if the data polarity of the n +1 th bit of the multi-level cell is the second polarity, and
if the data polarity of the n +2 th bit of the multi-level cell is the first polarity,
injecting no fifth charge amount into the floating gate of the multi-layered cell;
if the data polarity of the nth bit of the multi-level cell is the first polarity, if the data polarity of the n +1 th bit of the multi-level cell is the second polarity, and
if the data polarity of the n +2 th bit of the multi-level cell is the second polarity,
injecting the fifth amount of charge into the floating gate of the multi-layered cell;
if the data polarity of the nth bit of the multi-level cell is the second polarity, if the data polarity of the n +1 th bit of the multi-level cell is the first polarity, and
if the data polarity of the n +2 th bit of the multi-level cell is the first polarity,
injecting no sixth charge amount into the floating gate of the multi-layered cell;
if the data polarity of the nth bit of the multi-level cell is the second polarity, if the data polarity of the n +1 th bit of the multi-level cell is the first polarity, and
if the data polarity of the n +2 th bit of the multi-level cell is the second polarity,
injecting the sixth amount of charge into the floating gate of the multi-layered cell;
if the data polarity of the nth bit of the multi-level cell is the second polarity, if the data polarity of the n +1 th bit of the multi-level cell is the second polarity, and
if the data polarity of the n +2 th bit of the multi-level cell is the first polarity,
injecting no seventh amount of charge into the floating gate of the multi-layered cell;
if the data polarity of the nth bit of the multi-level cell is the second polarity, if the data polarity of the n +1 th bit of the multi-level cell is the second polarity, and
if the data polarity of the n +2 th bit of the multi-level cell is the second polarity,
the seventh amount of charge is injected into the floating gate of the multi-layered cell.
11. The method of claim 10, wherein the fourth, fifth, sixth, and seventh amounts of charge are different amounts of charge from one another.
12. A control device for writing data to a flash memory, the flash memory including a plurality of multi-level cells, each multi-level cell operable to store a plurality of bits, the control device comprising:
a write circuit for storing a set of data on average in an nth bit of each of the plurality of MLCs, wherein n is a positive integer greater than 0; (ii) a And
a judging circuit for judging whether the nth bit of each of the plurality of layers of cells is stored; wherein if the nth bit of each of the multi-level cells stores the first bit, the (n + 1) th bit of each of the multi-level cells is stored;
wherein the write circuit includes:
a judging unit for judging the data polarity of the data to be written into the nth bit of the multi-layer unit to determine whether the injection charge quantity to the multi-layer unit is available; and a write unit, wherein if the data polarity is a first polarity, the write unit does not inject a first charge amount to a floating gate of the multi-layered cell; and if the data polarity is a second polarity, the writing unit injects the first charge amount to the floating gate of the multi-layered unit, and the second polarity is different from the first polarity.
13. The control apparatus of claim 12 wherein, for each of said multilevel cells, said nth bit is a most significant bit stored by said multilevel cell and said n +1 th bit is a least significant bit stored by said multilevel cell.
14. The control apparatus of claim 12 wherein, for each of said multilevel cells, said nth bit is a least significant bit stored by said multilevel cell and said n +1 th bit is a most significant bit stored by said multilevel cell.
15. The control apparatus as claimed in claim 12, wherein the determining circuit is further configured to determine whether each of the multi-level cells stores the (n + 1) th bit, and the writing circuit stores an (n + 2) th bit for each of the multi-level cells when the determining circuit determines that each of the multi-level cells stores the (n + 1) th bit.
16. The control device as claimed in claim 15, wherein for each of said multilevel cells, said nth bit is a most significant bit stored by said multilevel cell, said n +1 th bit is a second significant bit stored by said multilevel cell, and said n +2 th bit is a least significant bit stored by said multilevel cell.
17. The control apparatus of claim 15, wherein for each of the multi-level cells, the nth bit is a least significant bit stored by the multi-level cell, the n +1 th bit is a second significant bit stored by the multi-level cell, and the n +2 th bit is a most significant bit stored by the multi-level cell.
18. The control apparatus of claim 12, wherein the first polarity is bit 1 and the second polarity is bit 0; or the first polarity is bit 0 and the second polarity is bit 1.
19. The control apparatus as claimed in claim 12, wherein said judging unit is further operable to judge the polarity of said data to be written into said n +1 th bit of said multi-level cell; if the data polarity of the nth bit of the multi-layered cell is the first polarity and if the data polarity of the n +1 th bit of the multi-layered cell is the first polarity, the write unit does not inject a second amount of charge into the floating gate of the multi-layered cell; the write unit injects the second amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the first polarity and if the data polarity of the n +1 th bit of the multi-layered cell is the second polarity; if the data polarity of the nth bit of the multi-layered cell is the second polarity and if the data polarity of the n +1 th bit of the multi-layered cell is the first polarity, the write unit does not inject a third amount of charge into the floating gate of the multi-layered cell; the write unit injects the third amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the second polarity and if the data polarity of the n +1 th bit of the multi-layered cell is the second polarity.
20. The control apparatus of claim 19, wherein the second amount of charge is different from the third amount of charge.
21. The control apparatus as claimed in claim 15, wherein said judging unit is further operable to judge the polarity of said data to be written into said n +2 th bit of said multi-level cell; if the data polarity of the nth bit of the multi-layered cell is the first polarity, if the data polarity of the n +1 th bit of the multi-layered cell is the first polarity, and if the data polarity of the n +2 th bit of the multi-layered cell is the first polarity, the write unit does not inject a fourth amount of charge into the floating gate of the multi-layered cell; the write unit injects the fourth amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the first polarity, if the data polarity of the n +1 th bit of the multi-layered cell is the first polarity, and if the data polarity of the n +2 th bit of the multi-layered cell is the second polarity; the write unit does not inject a fifth amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the first polarity, if the data polarity of the n +1 th bit of the multi-layered cell is the second polarity, and if the data polarity of the n +2 th bit of the multi-layered cell is the first polarity; the write unit injects the fifth amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the first polarity, if the data polarity of the n +1 th bit of the multi-layered cell is the second polarity, and if the data polarity of the n +2 th bit of the multi-layered cell is the second polarity; if the data polarity of the nth bit of the multi-layered cell is the second polarity, if the data polarity of the n +1 th bit of the multi-layered cell is the first polarity, and if the data polarity of the n +2 th bit of the multi-layered cell is the first polarity, the write unit does not inject a sixth charge amount to the floating gate of the multi-layered cell; the write unit injects the sixth amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the second polarity, if the data polarity of the n +1 th bit of the multi-layered cell is the first polarity, and if the data polarity of the n +2 th bit of the multi-layered cell is the second polarity; if the data polarity of the nth bit of the multi-layered cell is the second polarity, if the data polarity of the n +1 th bit of the multi-layered cell is the second polarity, and if the data polarity of the n +2 th bit of the multi-layered cell is the first polarity, the write unit does not inject a seventh amount of charge into the floating gate of the multi-layered cell; the write unit injects the seventh amount of charge into the floating gate of the multi-layered cell if the data polarity of the nth bit of the multi-layered cell is the second polarity, if the data polarity of the n +1 th bit of the multi-layered cell is the second polarity, and if the data polarity of the n +2 th bit of the multi-layered cell is the second polarity.
22. The control apparatus of claim 21, wherein the fourth, fifth, sixth, and seventh charge amounts are different charges from each other.
Technical Field
The present invention relates to a method for writing data into a flash memory and a control device thereof, and more particularly, to a method for improving the lifespan and operating speed of a flash memory and a control device thereof.
Background
Generally, when a flash memory control circuit writes a data into a memory cell of a flash memory, the flash memory control circuit erases the data previously stored in the memory cell before writing the data into the memory cell. However, this slows down the data writing speed of the flash memory because the flash memory control circuit must take time to erase the data previously stored in the memory cells. Furthermore, in general, the lifetime of a flash memory is limited by the number of writes and erases to the flash memory. If the number of times of writing and erasing of the flash memory is higher, the service life of the flash memory is shorter. In summary, the shorter the number of writes and erases of the flash memory, the longer the lifetime of the flash memory. Therefore, how to simultaneously increase the data writing speed and the service life of the flash memory has become an urgent problem to be solved in the field.
Disclosure of Invention
Therefore, the method and the control device disclosed by the invention mainly improve the service life and the operation speed of the flash memory.
According to a first embodiment of the present invention, a method for writing data into a flash memory is disclosed, wherein the flash memory comprises a plurality of multi-level cells, each of which is configured to store a plurality of bits, the method comprising: storing a set of data on an nth bit of each of the plurality of MLCs on average, wherein n is a positive integer greater than 0; judging whether the nth bit of each multi-layer unit stores data respectively; and storing the (n + 1) th bit of each multi-layer unit when the nth bit of each multi-layer unit stores the first bit respectively; wherein storing the set of data in the nth bit of each MLC on average comprises, for each MLC: determining a data polarity of data to be written to the nth bit of the multi-layered cell to determine whether an amount of injected charge is to the multi-layered cell; wherein if the data polarity is a first polarity, a first amount of charge is not injected into a floating gate of the multi-layered cell; and injecting the first amount of charge into the floating gate of the multi-layered cell if the data polarity is a second polarity, the second polarity being different from the first polarity.
According to a second embodiment of the present invention, a control device for writing data into a flash memory is disclosed, wherein the flash memory comprises a plurality of multi-level cells, each of which is configured to store a plurality of bits. The control device comprises a write circuit and a judgment circuit, wherein the write circuit is used for respectively storing a group of data in an nth bit of each multi-layer unit in the multi-layer units on average, and n is a positive integer greater than 0; and the judging circuit is used for judging whether the nth bit of each multi-layer unit is stored respectively; wherein if the nth bit of each of the multi-level cells stores the first bit, the (n + 1) th bit of each of the multi-level cells is stored. Wherein, the write circuit includes: a judging unit for judging the data polarity of the data to be written into the nth bit of the multi-layer unit to determine whether the injection charge quantity to the multi-layer unit is available; and a write unit, wherein if the data polarity is a first polarity, the write unit does not inject a first charge amount to a floating gate of the multi-layered cell; and if the data polarity is a second polarity, the writing unit injects the first charge amount to the floating gate of the multi-layered unit, and the second polarity is different from the first polarity.
According to the above embodiment, the present invention can greatly reduce the number of times of erasing the full-loaded data in the flash memory, and increase the number of times of erasing the non-full-loaded data in the flash memory, so as to improve the writing speed and the service life of the flash memory.
Drawings
Fig. 1 is a schematic diagram of a control device according to an embodiment of the present invention.
FIG. 2 is a schematic diagram of a multi-level cell according to an embodiment of the present invention.
FIG. 3 is a flowchart of an embodiment of a method for writing data to a flash memory.
FIG. 4 is a schematic diagram of an embodiment of the charge distribution after 8192 multi-level cells in a flash memory are all written with one bit of data.
FIG. 5 is a schematic diagram of an embodiment of the charge distribution after 8192 multi-level cells in a flash memory are written with two bits of data.
FIG. 6 is a schematic diagram of an embodiment of the charge distribution after three bits of data are written to 8192 multi-level cells in a flash memory according to the present invention.
FIG. 7 is a schematic diagram of an embodiment of the criteria for writing three bits of data to each MLC in a flash memory according to the present invention.
Wherein the reference numerals are as follows:
100 control device
102 flash memory
104 write circuit
106 judging circuit
108 setting circuit
110 reading circuit
102_1-102_ n flash paging
200 multi-layer cell
202 control gate
204 floating gate
206 oxide layer
208 source region
210 drain region
212P type substrate
300 method
302 to 324 steps
Curves 402-404, 502-508, 602-616
Detailed Description
Certain terms are used throughout the description and following claims to refer to particular components. As one of ordinary skill in the art will appreciate, manufacturers may refer to a component by different names. This specification and the claims that follow do not intend to distinguish between components that differ in name but not function. In the following description and in the claims, the terms "include" and "comprise" are used in an open-ended fashion, and thus should be interpreted to mean "include, but not limited to. Furthermore, the term "coupled" is used herein to encompass any direct and indirect electrical connection, such that if a first device is coupled to a second device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections.
Please refer to fig. 1. Fig. 1 is a schematic diagram of a
In addition, each of the multi-layer cells can be regarded as a Metal Oxide Semiconductor Field Effect Transistor (MOSFET), as shown in fig. 2. FIG. 2 is a schematic diagram of a multi-level cell 200 according to an embodiment of the present invention. The multi-layer cell 200 includes a control gate 202 and a floating gate 204, wherein the control gate 202 and the floating gate 204 are separated by an oxide layer 206. For convenience, the multi-layer cell 200 of the present embodiment is implemented as an N-type mosfet, such that a source region 208 and a drain region 210 of the mosfet are both N-type regions, and a P-type substrate 212 is disposed between the source region 208 and the drain region 210.
In addition, in order to more clearly describe the spirit of the present invention, the multi-level cell described in the present embodiment is a Triple Level Cell (TLC) as an example. However, the present invention is not limited thereto, and any Multi-level flash memory cell (MLC) is within the scope of the present invention.
According to the embodiment of the present invention, the
Further, the operation of the
step 302: starting a data write operation of the
step 304: storing the first bit separately for each of the plurality of multi-level cells;
step 306: judging whether each multi-layer unit stores the first bit respectively, if so, jumping to a
step 308: judging whether data are written into the
step 310: storing the second bit separately for each of the plurality of multi-level cells;
step 312: judging whether each multi-layer unit stores the second bit respectively, if so, jumping to step 314, and if not, jumping to step 310;
step 314: judging whether data are written into the
step 316: storing the third bit separately for each of the plurality of multi-level cells;
step 318: judging whether each multi-layer unit stores the third bit respectively, if so, jumping to step 320, and if not, jumping to step 316;
step 320: judging whether data are written into the
step 322: writing data to another flash memory or erasing (erase) charge within the plurality of multi-level cells of
step 324: the data write operation of the
First, the floating gates of the plurality of multi-level cells of
Referring to fig. 4, fig. 4 is a schematic diagram illustrating the charge distribution after 8192 multi-level cells in the
In addition, in this embodiment, since the
On the other hand, in
In
In
Fig. 5 is a schematic diagram illustrating the charge distribution after 8192 multi-level cells in the
Furthermore, as can be seen from the above data writing operation, when the data polarity of the first bit of the multi-layered cell is
In
In
In
Fig. 6 is a schematic diagram illustrating the charge distribution after 8192 cells in the
Furthermore, as can be seen from the above data writing operation, when the data polarity of the first bit and the data polarity of the second bit of the multi-layered cell are bit 11 and the data polarity of the third bit is bit 1, the write circuit 104 does not inject any charge amount into the floating gate of the multi-layered cell; when the data polarity of the first bit, the second bit, and the third bit of the multi-layered cell is bit 11 and bit 0, the write circuit 104 only injects the fourth charge into the floating gate of the multi-layered cell; when the data polarity of the first bit, the second bit, and the third bit of the multi-layered cell is bit 01 and bit 1, the write circuit 104 only injects the first charge amount into the floating gate of the multi-layered cell; when the data polarity of the first bit, the data polarity of the second bit is bit 01, and the data polarity of the third bit is bit 0, the write circuit 104 injects the first charge amount and the sixth charge amount into the floating gate of the multi-layered cell; when the data polarity of the first, second bits of the multi-layered cell is bit 00 and the data polarity of the third bit is bit 1, the write circuit 104 only injects the first and third charge amounts into the floating gate of the multi-layered cell; when the data polarity of the first, second bits of the multi-layered cell is bit 00 and the data polarity of the third bit is bit 0, the write circuit 104 only injects the first, third and seventh charge amounts into the floating gate of the multi-layered cell; when the data polarity of the first bit, the second bit, and the third bit of the multi-layered cell is bit 10 and bit 1, the write circuit 104 only injects the second charge amount into the floating gate of the multi-layered cell; when the data polarity of the first bit, the second bit, and the third bit of the multi-layered cell is bit 10 and bit 0, the write circuit 104 only injects the second charge amount and the fifth charge amount into the floating gate of the multi-layered cell. Accordingly, the charges stored in the floating gates of the multi-layered cells written with data of
In
In
It can be seen from the above-described steps of
It should be noted that although the above embodiments are exemplified by three-level flash memory cells capable of storing three bits, it should be understood by those skilled in the art that the data writing method of the present invention is also applicable to any multi-level flash memory cells after reading the operation characteristics of the embodiments, and thus the present invention also falls within the scope of the present invention.
According to the
It can be known from the two different data writing operations that the
In summary, the control method of the flash memory control circuit disclosed in the present invention writes data into the lower bits of each multi-level cell in a flash memory, and writes data into the upper bits of each multi-level cell after the lower bits are all written with data. Therefore, the invention can greatly reduce the times of erasing the full-load data in the flash memory and increase the times of erasing the non-full-load data in the flash memory so as to improve the writing speed and the service life of the flash memory.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
- 上一篇:一种医用注射器针头装配设备
- 下一篇:用于补偿电阻存储器设备的劣化的方法和系统