Background technology
In portable electronic product or embedded system, nonvolatile Sheffer stroke gate flash memory (Nandflash memory) is one of storage device that the most often uses at present.For example, PDA(Personal Digital Assistant), mobile phone, digital camera, MP3 walkman and recording pen etc. are provided with the Sheffer stroke gate flash memory.Yet; Owing to the correctness that is stored in the data in the Sheffer stroke gate flash memory can reduce along with the increase of its access times; Therefore in order to solve the problem of error in data; In existing Sheffer stroke gate flash memory, can arranging in pairs or groups, the error correcting code that is fit to (ErrorCodes Correction, ECC) repairs the data that mistake occurs by configuration.For instance; In data page size (Page size) is in the Sheffer stroke gate flash memory of 2K; Can provide the space of exceptional space (Spare area) 64 bytes (Bytes) to be used as the operation code (Parity code) that particular error corrigendum code calculation is produced when the data of this data page being carried out error correcting code calculation; And be in the Sheffer stroke gate flash memory of 4K in data page size, can provide the space of exceptional space 218 bytes (Bytes) to be used as the operation code that this particular error corrigendum code calculation is produced when the data of this data page being carried out this error correcting code calculation.
Please refer to Fig. 1.Shown in Figure 1 is the collocation method of the exceptional space of each data page in one known (Conventional) Sheffer stroke gate flash memory; Wherein correcting code calculation when this particular error is to adopt a reed-solomon (Reed-Solomon) error correction code calculation and a BCH (Bose, Chaudhuri and Hocquengham) error correction code calculation.When using a BCH8 error correction code calculation that this Sheffer stroke gate flash memory is encoded, the operation code that its coding back is produced can take the exceptional space of each data page 13 byte.When using reed-solomon 6 (Reed-Solomon6) error correction code calculation that this Sheffer stroke gate flash memory is encoded, the operation code that its coding back is produced can take the exceptional space of each data page 15 byte.When using reed-solomon 8 (Reed-Solomon8) error correction code calculation that this Sheffer stroke gate flash memory is encoded, the operation code that its coding back is produced can take the exceptional space of each data page 20 byte.When using reed-solomon 10 (Reed-Solomon10) error correction code calculation or a BCH15 error correction code calculation that this Sheffer stroke gate flash memory is encoded, the operation code that its coding back is produced can take the exceptional space of each data page 25 byte.On the other hand, when known Sheffer stroke gate flash memory used this reed-solomon error correction code calculation with this BCH error correction code calculation, the storage data space that all can dispose 512 bytes was in each data page.Therefore, a known Sheffer stroke gate flash memory is when using this reed-solomon error correction code calculation with this BCH error correction code calculation, and the ability of its error in data corrigendum has just been limited by preset exceptional space size.In other words; It is that the default exceptional space of each data page is limited that this reed-solomon error correction code calculation can't provide the reason of better error in data corrigendum ability to this known Sheffer stroke gate flash memory with this BCH error correction code calculation, and then causes user's inconvenience greatly.
Embodiment
In instructions and follow-up the application's claim, used some vocabulary to censure specific element.Having common knowledge the knowledgeable in the affiliated field should understand, and hardware manufacturer may be called same element with different nouns.This instructions and follow-up claim are not used as distinguishing the mode of element with the difference of title, but the criterion that is used as distinguishing with the difference of element on function.Be an open term mentioned " comprising " in instructions and the follow-up request quite in the whole text, so should be construed to " comprise but be not limited to ".In addition; " coupling " speech is to comprise any indirect means that are electrically connected that directly reach at this; Therefore; Be coupled to one second device if describe one first device in the literary composition, then represent this first device can directly be electrically connected in this second device, perhaps be electrically connected to this second device through other device or the intersegmental ground connection of connection hand.
Please be simultaneously referring to figs. 2 and 3, shown in Figure 2 is according to an a kind of embodiment process flow diagram that is applied to the collocation method 200 of a flash memory (flash memory) of the present invention.Shown in Figure 3 be collocation method 200 of the present invention for the configuration of this flash memory before flash memory 300a and configuration back flash memory 300b synoptic diagram.Note that this flash memory in the present embodiment is to explain with a Sheffer stroke gate flash memory (Nand Flash Memory) for the clearer spirit of the present invention place of describing, yet this is not limit by the present invention.In other words, be familiar with this operator and should understand, any storage device with flash memory characteristic, for example a rejection gate flash memory (Nor Flash Memory) is category of the present invention place.If can reach identical result substantially, the sequence of steps that does not need necessarily to shine in the flow process shown in Figure 2 is carried out, and step shown in Figure 2 not necessarily will carry out continuously, that is other step also can insert wherein, and collocation method 200 includes the following step:
Step 202: a preliminary data storage volume that reduces corresponding to this flash memory decides a real data storage volume;
Step 204: a preliminary exceptional space capacity that increases corresponding to this flash memory decides a real account external space capacity, and wherein the summation of this preliminary data storage volume and this preliminary exceptional space capacity equals the summation of this real data storage volume and this real account external space capacity; And
Step 206: this real data storage volume of configuration and this real account external space capacity in this flash memory; Wherein this real data storage volume is in order to storage data; And this real account external space capacity is in order to store an error correcting code (Error Codes Correction, ECC) operation code (Parity Bytes) that when these data are carried out an error correcting code computing, produced of algorithm.
Because the least unit of exchanges data is a data page (Page) between this flash memory and the primary memory, therefore this flash memory is to illustrate with the unit of data page in Fig. 3.Before this flash memory did not carry out capacity configuration through collocation method 200 of the present invention, storage data space 302a in its each data page and the capacity configuration size of an exceptional space 304a were default according to a specific error correction code calculation.For instance; When utilizing reed-solomon 10 (Reed-Solomon10) error correction code calculation or a BCH15 (Bose; When Chaudhuri and Hocquengham15) the error correction code calculation came that the data of 512 bytes (Bytes) in the storage data space 302a in each data page are carried out an error correcting code computing, exceptional space 304 amount of capacity that the operation code that is produced after its computing is occupied were to be preset as 25 bytes.Yet, when the amount of capacity of exceptional space 304a when being set to 25 bytes, this specific error correction code calculation just has been limited the decoding ability of each data page in this flash memory.Simultaneously, the access times of this flash memory also have been limited.Therefore; As far as this specific error correction code calculation; When being configured, the storage volume of the step 202 of collocation method 200 of the present invention pair this flash memory can estimate a preliminary data storage volume of this flash memory earlier; The total data storage volume that this preliminary data storage volume is this flash memory, as shown in Figure 3.This preliminary data storage volume is the summation of the storage data space 302a in all each data pages.Then, this preliminary data storage volume that collocation method 200 reduces corresponding to this flash memory decides a real data storage volume, makes that this real data storage volume is less than this preliminary data storage volume.Same, this real data storage volume is the summation of the storage data space 302b in all each data pages.Note that for convenience's sake, in the present embodiment storage data space 302a in each data page and 302b all with 512 bytes as explanation, yet this is not limited by the present invention.In step 204; In order to improve the error correction ability of this specific error correction code calculation to each data page; The preliminary exceptional space capacity that collocation method increases corresponding to this flash memory decides a real account external space capacity, and wherein the summation of this preliminary data storage volume and this preliminary exceptional space capacity equals the summation of this real data storage volume and this real account external space capacity.In step 206; This real data storage volume of configuration and this real account external space capacity in this flash memory; Wherein this real data storage volume is in order to storage data, and this real account external space capacity is in order to store the operation code (ParityBytes) that this specific error correction code calculation is produced when these data are carried out an error correcting code computing.Please refer again to Fig. 3; Because after this flash memory carries out capacity configuration through collocation method 200; Storage data space 302b in each data page still is maintained at the size of 512 bytes; And the exceptional space 304b in each data page can be greater than 25 bytes, and therefore this specific error correction code calculation just is able to improve to the error correction ability of each data page, and then has prolonged the access times of this flash memory.Though note that after configuration shown in Figure 3 each storage data space 302b and exceptional space 304b arrange with mode at interval among the flash memory 300b, yet this is not limited by the present invention.In other words, the storage data space 302b of each data page and its corresponding exceptional space 304b might not be adjacent, that is the arrangement of each storage data space 302b and exceptional space 304b can tool elasticity change according to design requirement.For instance, in another embodiment of the present invention, its be continuously dispose same number more continuously behind a plurality of storage datas of the configuration space 302b exceptional space 304b to be combined into the data page of corresponding number.
Please refer to Fig. 4.Shown in Figure 4 is according to a kind of another embodiment process flow diagram that is applied to the collocation method 400 of a flash memory of the present invention.In like manner, for the clearer spirit of the present invention place of describing, this flash memory in the present embodiment is to explain with a Sheffer stroke gate flash memory, yet this is not limit by the present invention.In other words, be familiar with this operator and should understand, any storage device with flash memory characteristic, for example a rejection gate flash memory is category of the present invention place.If can reach identical result substantially, the sequence of steps that does not need necessarily to shine in the flow process shown in Figure 4 is carried out, and step shown in Figure 4 not necessarily will carry out continuously, that is other step also can insert wherein, and collocation method 400 includes the following step:
Step 402: determine a real data storage volume and a real account external space capacity, wherein this real account external space capacity is greater than corresponding to an error correcting code (Error Codes Correction, ECC) one of algorithm preset byte; And
Step 404: this real data storage volume of configuration and this real account external space capacity in this flash memory; Wherein this real data storage volume is in order to storage data, and this real account external space capacity is in order to store the operation code (ParityBytes) that this error correction code calculation is produced when these data are carried out an error correcting code computing.
As the first above-mentioned embodiment; When utilizing reed-solomon 10 (Reed-Solomon10) error correction code calculation or a BCH15 (Bose; When Chaudhuri and Hocquengham15) the error correction code calculation came that the data of 512 bytes (Bytes) in the storage data space in each data page of this flash memory are carried out an error correcting code computing, the exceptional space amount of capacity that the operation code that is produced after its computing is occupied was to be preset as 25 bytes.And step 402 can determine the real data storage area and the real account external space in each data page, and wherein this real account external space capacity is greater than 25 bytes, and real data storage area capacity is 512 bytes.In step 404; Configuration this real data storage volume of each data page and this real account external space capacity in this flash memory; Wherein this real data storage volume is in order to storage data, and this real account external space capacity is in order to store the operation code (Parity Bytes) that this specific error correction code calculation is produced when these data are carried out an error correcting code computing.Hence one can see that; Because after this flash memory carries out capacity configuration through collocation method 400; Real data storage area in each data page still is maintained at the size of 512 bytes; And the real account external space in each data page can be greater than 25 preset bytes, and therefore this specific error correction code calculation just is able to improve to the error correction ability of each data page, and then has prolonged the access times of this flash memory.
In sum, though the present invention first and second embodiment explain that with reed-solomon 10 error correction code calculations and this BCH15 error correction code calculation so it is not limit by the scope of the invention.In other words; When this specific error correction code calculation is a BCH8 (Bose; Chaudhuri and Hocquengham8) during the error correction code calculation; Behind the above-mentioned collocation method that discloses, the exceptional space in each data page just can dispose greater than 13 bytes the space, it also belongs to category of the present invention place; When this specific error correction code calculation is reed-solomon 6 (Reed-Solomon6) error correction code calculation; Behind the above-mentioned collocation method that discloses; Exceptional space in each data page just can dispose the space greater than 15 bytes, and it also belongs to category of the present invention place; When this specific error correction code calculation is reed-solomon 8 (Reed-Solomon8) error correction code calculation; Behind the above-mentioned collocation method that discloses; Exceptional space in each data page just can dispose the space greater than 20 bytes, and it also belongs to category of the present invention place.More definite; To a flash memory; When if this specific error correction code calculation is a BCH8 error correction code calculation; Behind the above-mentioned collocation method that discloses, this flash memory can utilize any than BCH8 more the error correction code calculation of high-order carry out error correction calculation, for example utilize reed-solomon 10, BCH15 error correction code calculation or the like.
The above is merely preferred embodiment of the present invention, and all changes that is equal to or replacements of having done according to the application's claim scope all should belong to covering scope of the present invention.