Memory device having error detection and correction function, and methods for writing and erasing the memory device

Abstract: The present invention relates to a memory device and specifically the multilevel type with error check and correction function and having a data input (DI), a data output (DO) and an address input (AI) and being of the type comprising first memory means (DM) designed to be accessed by means of address for containing user data, second memory means (EM) for containing error data concerning said user data, a control logic (CL) designed to receive in the writing phase from said address input (AI) and said data input (DI) a writing address and user data respectively and to generate error data and to write said data in said first means (DM) and second means (EM) respectively and designed to receive in the reading phase from said address input (AI) a reading address and extract corresponding user data and error data and combine them to correct any errors and supply them to said data output (DO) and characterised in that said second means (EM) are the type designed to be accessed by means of content and said content for access corresponding to addresses of said first means (DM).

Description: The present invention relates to a memory device with error check and correction function and having a data input (DI), a data output (DO) and an address input (AI) and of the type comprising: a) first memory means (DM) designed to be accessed by means of address for containing user data, b) second memory means (EM) for containing error data concerning said user data, c) a control logic (CL) designed to receive in the writing phase from said address input (AI) and said data input (DI) a writing address and user data respectively to generate error data and to write said user data and error data in said first (DM) and second (EM) memory means respectively and designed to receive in the reading phase from said address input (AI) a reading address and to extract corresponding user data and error data and to combine them for correction of any errors and to supply them to said data output (DO) and wherein said second memory means (EM) are the type designed to be accessed by means of content and said content for access corresponding to addresses of said first memory means (DM) for which error data is stored, said control logic including check means (VM) having a first input coupled to an output of said first memory means (DM) to receive data read from said first memory means. The invention also relates to a method for writing corrected user data in a memory device of the type comprising first memory means (DM) for containing user data designed to be accessed by means of address and second memory means (EM) for containing error data concerning said user data designed to be accessed by means of content and comprising the following phases: a) send to said device a writing address, b) send to said device user data to be memorised, c) write the user data to be memorised in said first memory means (DM) in a position corresponding to said writing address, d) access by means of said writing address to user data addressed in said first memory means (DM), e) check the identity of said user data to be memorised and of said addressed user data and in case of failure of said check: e1) generate error data capable of correcting errors in the addressed user data, and e2) write said error data generated in said second memory means (EM) and associate them for access to said writing address, characterised in that said access is a read-after-write access performed during the write phase to determine whether any errors occurred in writing the user data to be memorized in said first memory means. The problem of error correction in conventional memories has been faced in the past. U.S. patent 4,958,352 proposes, for example, a semiconductor memory device equipped with an Error Check and Correction Circuit (ECC) comprising a first cell matrix for the actual data and a second cell matrix for the error check and correction data. With every data word, 8 bits in the example, is associated an error check and correction word, 4 bits in the example, permitting identification and correction of a single error, which is usually sufficient. Every binary datum is memorised in a different memory cell. The reading and writing operations are controlled and coordinated by a complex circuitry (also comprising the error check and correction circuit) which can be described as a control logic which, in the writing phase, is designed to receive a writing address and user data, generate error data and write said data in the first and second matrix respectively and, in the reading phase, is designed to receive a reading address, extract corresponding user data and error data from the first and second matrices respectively, combine them to correct any errors, and supply them at output. The solution proposed by said U.S. patent involves for good efficiency of the device the employment of a considerable number of memory cells; in the example 33% of the cells of the device are dedicated to error identification and correction. If errors are rare said employment is not justified. U. S. Patent No. 4,654,847 contains the features from the preambles of the appended claims and discloses an apparatus that detects and corrects memory errors during a read phase. When data is read from memory and found to be erroneous, the data is corrected and stored in a spare portion of a small alternative memory array. In addition, the identity of the corrected data is also stored in the alternate memory array. During a subsequent read of the data from the main memory, the alternate memory array is simultaneously consulted. The identity of the corrected data, stored in the alternate memory array, is compared with the incoming address, and the corrected data is read from the spare portion of the alternate memory array. A particular type of phenomena which originates rare steady and/or intermittent errors occurs in EEPROM and flash EPROM memories written and/or erased by means of Fowler-Nordheim tunnelling. Said "writing" mechanism (this term is used in a broad sense in the present document) exhibits in addition to a normal dispersion a queue of a few cells having much higher writing speeds and furthermore there may be present "erratic bits", i.e. cells which from a certain point onward exhibit for a certain variable time interval a much higher writing speed. It was sought to obviate this problem a priori by using special writing strategies (many very fine programming steps) such as to adapt to the different writing speeds of the various cells, or using a priori normal writing strategies and recovering a posteriori the "overwritten" or "overerased" cells by means of the same special writing strategies. This problem is much more severe for multilevel memories where cell characteristics dispersion must of course be limited. The purpose of the present invention is to supply a memory device and in particular the multilevel type capable of identifying and correcting any errors and not exhibiting the shortcomings of the known art. This purpose is attained by means of the memory device of the above mentioned type having furthermore the characteristics set forth in the characterising part of claim 1. Additional advantageous aspects of the present invention are set forth in the dependent claims. In accordance with another aspect the present invention concerns also a writing method and an erasure method having the functions set forth in claims 10 or 13 and 14 respectively. In case of error, by using for memorising error data instead of a conventional memory matrix of the independent memory means designed to be accessed by means of the content and in which the content for access corresponds to addresses of the memory means containing user data, the number of cells dedicated to error check and correction proves to be rather small. Since the error data are written only in case of error this does not substantially affect the average time for writing the user data to memory. In addition, even if there is an error, part of the error data memorisation operations can be executed in parallel with the user data memorisation operations and the additional time required is thus reduced. Furthermore, since the error data memorisation operations can be provided independently by the user information memorisation operations, the remaining part of the operations not yet executed can be executed in parallel next considering that it is highly improbable that errors will occur in two consecutive writing operations. In the case of EEPROM and flash EPROM memories there can be used, thanks to the device in accordance with the present invention, normal writing strategies while leaving recovery of the writing errors to the error data. The present invention is clarified by the following description of some embodiments considered together with the annexed drawings wherein - FIG. 1 shows a block diagram of the memory device in accordance with an embodiment of the present invention, FIG. 2 shows a possible diagram in greater detail of the device of FIG. 1 limited to the blocks affected by a reading operation, FIG. 3 shows a first possible diagram in greater detail of the device of FIG. 1 limited to the blocks affected by a writing operation, FIG. 4 shows a second possible diagram in greater detail of the device of FIG. 1 limited to the blocks affected by a writing operation, FIG. 5 shows a third possible diagram in greater detail of the device of FIG. 1 limited to the blocks affected by a writing operation, and FIG. 6 shows a fourth possible diagram in greater detail of the device of FIG. 1 limited to the blocks affected by a writing operation. With reference to FIG. 1 the memory device in accordance with this embodiment of the present invention has an error check and correction function and possesses a data input DI, a data output DO and an address input AI and in addition there are of course the usual control signals CNTR received at input and generated at output and which are exchanged between the various circuit blocks included in the device. It includes: a) first memory means DM designed to be acceded to by means of address for containing user data; b) second memory means EM for containing error data related to the user data and of a type designed to be acceded to by means of content and such content for access corresponding to addresses of the first memory means DM; c) a control logic CL designed to receive in the writing phase from the address input AI and the data input DI a writing address and user data respectively, generate error data and write such data in the first and second memory means respectively, and designed to receive in the reading phase from the address input AI a reading address, extract corresponding user data and error data, and combine them to correct any errors and supply them to the data output DO. The error data contained in the memory means EM can be of various kinds corresponding to the user data themselves, to data designed to identify and correct possible errors in the user data, or data designed to correct specific errors occurring in the writing of the user data. FIG. 2 shows a possible diagram in greater detail of the device of FIG. 1 limited to the blocks affected by a reading operation. The address input AI of the device is connected to the address input of the memory means DM and the input of access to the memory means EM. The data outputs of the means DM and EM are connected to the error connection means inputs CM designed to combine the input signals. The output of the means CM is connected to the data output DO of the device. Depending on the type of error data contained in the memory means EM said means CM can consist of simple switches, means designed to identify and correct on the basis of the error data at the input, any errors in the user data, or in means designed to correct on the basis of the error data at the input specific errors occurring in the previous writing of the user data. Naturally the means CM must provide said operations only if error data associated with the address concerned are found in the memory means EM. This can be achieved e.g. by having the means EM generate a control signal indicating to the means CM the presence or not of the error data or, if error data is missing, having the combination of the input data with the means CM give as a result the unchanged user data. A mathematical example could be: the sum of "zero" with any number gives the same number. Four different possible detailed block diagrams of the device of FIG. 1 limited to the blocks affected by the writing operation are discussed below. With reference to FIG. 3 the first diagram represents the first memory means DM and the second memory means EM. Both are connected to the address input AI and the data input DI and furthermore the former exhibit a read/write control input R/W and the latter a writing enablement signal W-EN. The data input DI and the output of the means DM are connected to the inputs of the check means VM which are designed to generate in the writing phase a check signal corresponding to the comparison between the data at their input. Said check signal is sent to the input W-EN of the means EM. With this architecture the writing of the error data in the means EM takes place only if an error has occurred in writing the user data in the memory means DM. In the example of FIG. 3 the user data are memorised in the means EM after the finding of an error. Alternatively the user data can be memorised simultaneously in the means DM and EM and if no error is found the error data are erased from the means EM. The check signal is however to be sent to an erasure control input, not shown in FIG. 3, of the means EM. With reference to FIG. 4 the second diagram is the same as the former except that the data input DI is connected to the means EM not directly but through a first coder COD1. Said coder is capable of generating error data in such a manner that they correspond to the coding of the user data by means of an algorithm capable of identifying and correcting a predetermined number of errors. For a good discussion of said code and algorithm types reference can be had to the book by Jiri Adamek, "FOUNDATIONS OF CODING", John Wiley & Sons, 1991. Even for this diagram the same remarks made for the diagram of FIG. 3 apply . Furthermore the check signal can also be sent to an operational enablement input, not shown in FIG. 4, of the coder COD1. In this manner generation of the error data takes place only in case of a writing error. With reference to FIG. 5 the third diagram is identical to the second except that one of the inputs of the check means VM is connected to the output of the coder COD1 instead of to the data input DI. In this case generation of the error data takes place independently of any writing errors. The check means will comprise a more complex circuitry than that necessary in the above diagrams and indeed they must be so in order to identify the presence of data errors at the output of the means DM by using an algorithm corresponding to that used in the coder COD1. With reference to FIG. 6 the fourth diagram is a bit different from those discussed above. It represents the first memory means DM and the second memory means EM. Both are connected to the address input AI while only the former are connected to the data input DI and in addition the former exhibit an input R/W for read/write control and the latter a writing enablement signal W-EN and a data input. The data input DI and the output of the means DM are connected to the inputs of check means VM which are designed to generate in the writing phase a check signal corresponding to the comparison between the data at their input. More specifically the check signal consists in this case of a difference signal, which is sent to a second coder COD2, and an outcome signal which is sent to a writing logic WL. The output of the coder COD2 is sent to the data input of the means EM while the output of the writing logic WL is sent to the input W-EN of the means EM. The difference signal corresponds to the difference between the digital data making up the signals supplied to the inputs of the means VM. The outcome signal corresponds to the outcome of the comparison identity/non-identity between said digital data. The coder COD2 is then suitable to generate the error data in such a manner that they correspond to the coding of said difference. As mentioned above, the present invention finds advantageous employment for multilevel memories. In this case the memory means EM can be the multilevel type like the means DM or they can be the two-level type to ensure greater reliability. Further advantages are achieved if the first and second memory means consist of two semiconductor memory cell matrices and specifically the EEPROM or flash EPROM type. It is natural that even the memory means EM are subject to errors which can exist right from production or can appear during normal operation. In many cases said errors can be accepted given the small size of said means and hence the limited effect on productivity or on failures during operation. If this is not acceptable for any reason it can be thought to provide redundancy for memory means EM or apply thereto known error correction means or error correction means in accordance with the present invention. To be able to use such a type of memory device it is necessary to use reading, writing and erasure methods specifically adapted thereto. The method for reading user data corrected by a memory device of the type comprising first memory means DM for containing user data designed to be accessed by means of address and second memory means EM for containing error data concerning the user data and designed to be accessed by means of content comprises the following phases: a) send to said device a reading address corresponding to the user data to be read, b) access by means of the reading address to user data addressed in the first memory means DM, c) access by means of the content of the reading address to possible error data in the second memory means EM, and d) combine the addressed user data and any error data to obtain the corrected user data. If there are no error data corresponding to said reading address the corrected data correspond to the addressed data and phase d) has no effect. One method in accordance with the present invention for writing corrected user data in a memory device of the type comprising first memory means DM for containing user data designed to be accessed by means of address and second memory means EM for containing error data concerning the user data designed to be accessed by means of content comprises the following phases: a) send to said device a writing address, b) send to said device user data to be memorised, c) write the user data to be memorised in said first memory means DM in a position corresponding to said writing address, d) access by means of said writing address to user data addressed in the first memory means DM, e) check the identity of the user data to be memorised and of the addressed user data and in case of failure of said check: e1) generate error data capable of correcting errors in the addressed user data, and e2) write said error data generated in the second memory means EM and associate them for access to said writing address, characterised in that said access is a read-after-write access performed during the write phase to determine whether any errors occurred in writing the user data to be memorized in said first memory means. An advantageous choice for its simplicity, the error data generated correspond to the user data to be memorised, hence phase e1) has no effect. It may be important, in particular in the case of intermittent errors, to be able to reuse the memory cells of the second memory means EM when they are no longer used for memorising error data associated with a certain address of the means DM. This occurs when the cells of the first means DM corresponding to said certain address have first originated writing errors and subsequently resumed correct operation. The solution to this problem may be that, if the identity check does not fail, any error data associated with the writing address are erased from the second means EM. Erasure will thus take place really only in the case or rewriting of cells which had previously originated writing errors. This erasure could take place, in a quite simple manner, e.g. by marking the error data as "erased" instead of erasing them physically. A second writing method in accordance with the present invention and an alternative to that discussed above but identical thereto in its essential part could be used if it is preferred to parallelise the operations of writing the user data in the first memory means DM and of error data in the second memory means EM. This comprises the following phases: a) send to said device a writing address, b) send to said device user data to be memorised, c) write the user data to be memorised in the first memory means DM in a position corresponding to the writing address, d) access by means of the writing address to user data addressed in the first memory means DM, e) generate error data capable of correcting errors in the addressed user data, f) write the error data in the second memory means EM and associate them with the writing address for access, g) check during the write phase the identity of the user data to be memorised and of the addressed user data, and h) if the check is successful, erase from the second memory means EM the error data associated with the writing address. The two writing methods discussed refer to generic user data. As mentioned above, taking the term "write" in a broad sense, said methods can also be termed erasure methods when the erasure operation is thought of as the writing of a predetermined datum which is the same for all the cells or words. Based on this consideration said methods could be used also to overcome the problem of 'bit depletion' during erasure of the flash EPROM memories. Indeed, if after a normal total erasure of a device or of a sector of such a memory it is seen that few cells, for any reason, are not erased (i.e. do not contain the desired data) instead of continuing the total erasure of the memory, by applying the present methods error data are generated and written in the means EM. In this manner the possible erasure of the other cells is prevented. Often however the erasure operation refers to the mere marking of the 'erased' cell. The method in accordance with the present invention of erasing (in the most common sense of the term) user data in a memory device of the type comprising first memory means DM for containing user data designed to be accessed by means of address and second memory means EM for containing error data concerning the user data designed to be accessed by means of content comprises the following phases: a) send to said device an erasure address, b) erase from the first memory means DM user data in a position corresponding to the erasure address, and c) erase from the second memory means EM any associated error data for access to the erasure address. Not all the devices in general have the erasure function and more often the memory cells are rewritten. In this case the procedure for reuse of the cells of the second memory EM is discussed above.

Claims: Memory device with error check and correction function and having a data input (DI), a data output (DO) and an address input (AI) and of the type comprising: a) first memory means (DM) designed to be accessed by means of address for containing user data, b) second memory means (EM) for containing error data concerning said user data, c) a control logic (CL) designed to receive in the writing phase from said address input (AI) and said data input (DI) a writing address and user data respectively to generate error data and to write said user data and error data in said first (DM) and second (EM) memory means respectively and designed to receive in the reading phase from said address input (AI) a reading address and to extract corresponding user data and error data and to combine them for correction of any errors and to supply them to said data output (DO) and wherein said second memory means (EM) are the type designed to be accessed by means of content and said content for access corresponding to addresses of said first memory means (DM) for which error data is stored, said control logic including check means (VM) having a first input coupled to an output of said first memory means (DM) to receive data read from said first memory means, characterised in that said check means also has a second input coupled to said data input (DI) and is structured to, during the write phase, receive data read from that memory location in said first memory means which was just written to, compare the data read from said memory location to the user data written to said memory location, and create a check signal based on the comparison. Device in accordance with claim 1 in which said check signal enables the writing of said second memory means (EM) if an error occurs in writing said user data in said first memory means (DM). Device in accordance with claim 2 in which said check signal enables furthermore the generation of said error data in the writing phase. Device in accordance with claim 1 in which said check signal enables erasure from said second memory means (EM) of said error data if no error occurs in the writing of said user data in said first memory means (DM). Device in accordance with claim 1 in which said error data correspond to said user data. Device in accordance with claim 1 comprising furthermore a coder (COD1) designed to generate said error data in such a manner that they correspond to the coding of said user data by means of an algorithm capable of identifying and correcting a predetermined number of errors. Device in accordance with claim 1 comprising furthermore a coder (COD2) designed to generate said error data in such a manner that they correspond to the coding of the difference between said user data and the data read from said memory location of said first memory means (DM). Device in accordance with claim 1 in which said first memory means (DM) are the multilevel type and said second memory means (EM) are the two-level type. Device in accordance with claim 1 in which said first (DM) and second (EM) memory means consist of respective first and second semiconductor memory cell matrices of the EEPROM or flash EPROM type. Method for writing corrected user data in a memory device of the type comprising first memory means (DM) for containing user data designed to be accessed by means of address and second memory means (EM) for containing error data concerning said user data designed to be accessed by means of content and comprising the following phases: a) send to said device a writing address, b) send to said device user data to be memorised, c) write the user data to be memorised in said first memory means (DM) in a position corresponding to said writing address, d) access by means of said writing address to user data addressed in said first memory means (DM), e) check the identity of said user data to be memorised and of said addressed user data and in case of failure of said check: e1) generate error data capable of correcting errors in the addressed user data, and e2) write said error data generated in said second memory means (EM) and associate them for access to said writing address, characterised in that said access is a read-after-write access performed during the write phase to determine whether any errors occurred in writing the user data to be memorized in said first memory means. Writing method in accordance with claim 10 in which said generated error data correspond to said user data to be memorised and said phase e1) has no effect. Writing method in accordance with claim 10 in which in case of non-failure of said check there are erased from said second means (EM) any error data associated with said writing address. Method of writing corrected user data in a memory device of the type comprising first memory means (DM) for containing user data designed to be accessed by means of address and second memory means (EM) for containing error data concerning said user data designed to be accessed by means of content and comprising the following phases: a) send to said device a writing address, b) send to said device user data to be memorised, c) write said user data to be memorised in said first memory means (DM) in a position corresponding to said writing address, d) access by means of said writing address to user data addressed in said first memory means (DM), e) generate error data capable of correcting errors in said addressed user data, f) write said error data in said second memory means (EM) and associate them with said writing address for access, g) check during the write phase the identity of said user data to be memorised and of said addressed user data, and characterized in that: h) if the check is successful erase from said second memory means (EM) the error data associated with said writing address. Method of erasing user data in a memory device of the type comprising first memory means (DM) for containing user data designed to be accessed by means of address and second memory means (EM) for containing error data concerning said user data designed to be accessed by means of content and comprising the following phases: a) send to said device an erasure address, b) erase from said first memory means (DM) user data in a position corresponding to the erasure address, and characterised by: c) erase from said second memory means (EM) any associated error data for access to said erasure address.

Inventors: BALDI LIVIO, BALDI, LIVIO
Applicants: ST MICROELECTRONICS SRL, STMICROELECTRONICS S.R.L.
Application year: 1994
Main classification: G11C29
IPC codes: G11C11, G11C29, G06F11, G06F12