The present invention relates to a method for operating a memory arrangement.
During the programming of data, numerous applications such as, for example, portable data carriers, mobile data processing, wireless data and power transmission and also security-relevant devices require that the original contents of a memory cell be retained during programming in the event of the power supply failing or being disconnected.
“EEPROMs” (Electrically Erasable and Programmable Read Only Memories) or flash memories and flash EEPROMs, respectively, are currently customary electrically erasable and programmable nonvolatile semiconductor memories. Memory devices of this type have a high memory cell density and may be electrically erased or reprogrammed at any time. In this case, the memory devices are generally subdivided into a number of sectors. These sectors are in turn subdivided into a multiplicity of pages.
In EEPROMs, the data can be stored page by page in individual segments of the pages. In order to be erased, the data are marked segment by segment. A flash memory can only be programmed page by page, whereas an EEPROM has a considerably lower granularity on account of its structure. In a flash memory, data which are to be erased are marked but they are only erased page by page.
In order to program data of a flash memory, a copy of the data of one or more memory pages is loaded into a further memory. For the purposes of storing the data, the previously copied data of a memory page are erased and the programmed data are stored on the page. Voltage dips and the failure or disconnection of the power supply during programming may result in a programming or erasure operation being aborted. It is therefore possible, once an erasure operation has been carried out, that the original data are erased and that the copy of the data is no longer available in the main memory either as a result of a power failure which has occurred.
The applicant, at least, is aware of the fact that complex algorithms containing a plurality of erasure and programming cycles are used during the programming of data in order to avoid data loss and undefined data states as a result of a power failure (tearing-proof programming), twice to four times the programming time being required.
An object of the present invention is to specify a simple and fast method for operating a memory arrangement, the method enabling “tearing-proof programming” of data of a memory device, so that it is possible, in the event of a power failure, to continue to access the original data once programming has been carried out.
In the case of the method according to the invention for operating a memory arrangement, the memory arrangement comprises a nonvolatile memory, for example a flash memory, and an address translation unit, for example a main memory, the nonvolatile memory having memory pages and at least one additional memory page which may be addressed by means of physical addresses. In the address translation unit, the physical addresses of the memory pages of the flash memory are assigned to the addresses which may be logically addressed by the processor. The logical addresses are translated into physical addresses in the address translation unit, with the result that it is possible to quickly access the memory pages. An unaddressable area of the memory pages of the flash memory on the one hand stores the logical addresses which have been assigned to the physical addresses of a memory page and, on the other hand, incorporates a counter. In order to program an addressed memory page, a copy of the data and a copy of the data of the unaddressable area are copied to a further memory for processing and the counter associated with the copy of the data is incremented by one. After programming has been completed, the processed copy of the data and the data of the unaddressable area are stored in the additional memory page.
The invention is explained in more detail below on the basis of an exemplary embodiment and with reference to the figures. Identical or corresponding elements in different figures are provided with identical reference symbols.
a shows an exemplary embodiment of a sector of a nonvolatile memory;
b shows an exemplary embodiment of an address translation unit;
c shows a memory page of a nonvolatile memory;
d shows the contents of the memory page shown in
e shows a further memory page of a nonvolatile memory after programming;
f shows the address translation unit after programming of the memory page; and
g shows the memory pages of the nonvolatile memory after programming.
In the case of the method according to the invention for operating a memory arrangement, the memory arrangement comprises a nonvolatile memory, for example a flash memory, and an address translation unit, for example a main memory, the nonvolatile memory having memory pages and at least one additional memory page which may be addressed by means of physical addresses. In the address translation unit, the physical addresses of the memory pages of the flash memory are assigned to the addresses which may be logically addressed by the processor. The logical addresses are translated into physical addresses in the address translation unit, with the result that it is possible to quickly access the memory pages. An unaddressable area of the memory pages of the flash memory on the one hand stores the logical addresses which have been assigned to the physical addresses of a memory page and, on the other hand, incorporates a counter. In order to program an addressed memory page, a copy of the data and a copy of the data of the unaddressable area are copied to a further memory for processing and the counter associated with the copy of the data is incremented by one. After programming has been completed, the processed copy of the data and the data of the unaddressable area are stored in the additional memory page.
As a result of the fact that the programmed data are stored on the additional memory page, the original data must not be erased before the programmed data have been stored. The original data on the memory page may only be erased once the programmed data have been stored. The memory page subsequently assumes the function of an additional memory page. In the address translation unit, the physical address is furthermore assigned to the additional memory page in the place of the logical address assigned to the addressed memory page.
It is particularly advantageous that, once programming has been carried out, the data are still present on the memory page and the changed data are present on the additional memory page and can be differentiated on the basis of their different counter value in the unaddressable area. The particular advantage of the method according to the invention is evident therefrom. An interruption in the power supply when programming the data has no effect on the original data, with the result that the latter can still be accessed. If, in the event of an interruption in the power supply, the data have already been stored on the additional memory page, the logical addresses of the associated physical addresses of a memory page and additional memory page (the logical addresses being stored in the unaddressable area of the memory page and in the unaddressable area of the additional memory page) are evaluated sector by sector when power supply is resumed. The previously evaluated physical addresses of the memory pages are assigned to the logical addresses of the address translation unit. If two memory pages having a different physical address and having a matching logical address are found, only that physical address of a memory page which has a higher counter reading in the unaddressable area is assigned to the corresponding logical address in the address translation unit.
A further particular advantage of the method according to the invention results from the fact that, during programming, a flash memory has the granularity of an EEPROM. As a result of the fact that the changed data are stored in the additional memory page of the nonvolatile memory, only the changed data are affected in the event of an interruption in the power supply, with the result that it is still possible to access all data of the memory page.
a shows an exemplary embodiment of a sector 3 of the nonvolatile memory 2. The sector 3 of the nonvolatile memory 2 has the memory pages 31, 32, 33, 34 and 35. In column 1, the variables P1, P2, P3, P4 and P5 represent the physical addresses of the respective memory page 31, 32, 33, 34 and 35 and, in column 2, the variables A, B, C and D represent the data stored in the memory pages 31, 32, 33 and 34. Column 3 represents an unaddressable area, which, in this exemplary embodiment, is located in the side areas of the nonvolatile memory 2. The unaddressable area is not confined to the nonvolatile memory 2 and can thus be located in any desired memory. This unaddressable area contains, for every memory page, the logical address, which has been assigned to the physical address of the memory page in the address translation unit 5, and a counter. The logical addresses are represented by the variables L1, L2, L3, L4 and L5 and the counter is represented by the variable CNTX. The memory pages 31, 32, 33 and 34 which are shown in rows 1 to 4 of the sector 3 may be addressed by the processor, while the memory page 35 in row 5 represents an additional memory page, which cannot be addressed by the processor. The additional memory page furthermore does not contain addressable data and does not contain data in the unaddressable area.
An address translation unit 5, which serves to translate the logical addresses into the physical addresses of the memory pages of the nonvolatile memory 2, is shown in
The manner in which the data of the memory pages of the nonvolatile memory 2 are advantageously programmed is explained with reference to
c shows the first memory page of the nonvolatile memory 2, as shown in
As shown in
An interruption in the power supply results in the assignments of the logical addresses L1, L2, L3 and L4 to the physical addresses P1, P2, P3, P4 and P5 of the memory pages 31, 32, 33, 34 and 35 being reconstructed in the address translation unit 5. To this end, the logical address L1, L2, L3 and L4 in the unaddressable area and also the physical address P1, P2, P3, P4 and P5 of the respective memory page 31, 32, 33, 34 and 35 are evaluated and the physical address P1, P2, P3, P4 and P5 is assigned to the respective logical address L1, L2, L3 and L4 in the address translation unit 5. In the event that two memory pages and thus two physical addresses have a matching logical address, the counts of the counters of the two memory pages are compared and that physical address of the memory page which has the higher counter count is assigned to the logical address in the address translation unit 5.
f shows the assignment of the addresses in the address translation unit 5 once programming has been carried out. Since the changed data A′ were stored in the additional memory page 35, as is shown in
As shown in the first row of
Number | Date | Country | Kind |
---|---|---|---|
102 52 059.3 | Nov 2002 | DE | national |
This application is a continuation of International Patent Application Serial No. PCT/DE03/003437, filed Oct. 16, 2003, which published in German on May 21, 2004 as WO 2004/042740, and is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/DE03/03437 | Oct 2003 | US |
Child | 11125819 | May 2005 | US |