Background technology
Flash memory (Flash) is a kind of memory storage that is used to store data, even it has the characteristic (non-volatile) that stops the power supply supply and also keep data to be wiped.Owing to this reason,, and has application trend more and more widely so flash memory has been used as the data storage device of the electronic product such as mobile phone, PDA and MP3 player.
In general, Flash can be divided into NOR type Flash and NAND type Flash.Their something in common is: data are stored (writing data) by programming operation, and wipe by erase operation.The two all is a voltage-controlled device, the wiping of NAND type Flash and write and all be based on tunnel effect, and electric current passes the insulation course between floating grid and the silicon base layer, and floating grid is charged (write data) or discharges (obliterated data).And NOR type Flash obliterated data still is based on tunnel effect (electric current is from the floating grid to the silicon base layer), but then is to adopt thermoelectron injection mode (electric current is from the floating grid to the source electrode) when writing data.
General, if carry out programming operation, then the threshold voltage of Flash storage unit (cell) raises; On the contrary, if carry out erase operation, then the threshold voltage of this Flash storage unit reduces.For example, in the Flash of NAND type, if carry out programming operation, then the threshold voltage of storage unit increases to and is higher than 0V.If the execution erase operation, then the threshold voltage of storage unit is reduced to and is lower than 0V.
Referring to Fig. 1, existing process of Flash being carried out programming operation is described simply.
Step 101, data input step;
Step 102, current byte is carried out data verification;
If this byte of step 103 needs programming, then it is programmed, return step 102 then;
If this byte checking of step 104 is passed through, promptly the data of being stored are identical with the required data that write, and do not needed programming operation, then finish the programming operation to this byte, enter the programming process of next byte.
At the byte of each required programming, repeat to finish above-mentioned step 102 to 104, just can realize the programming operation of Flash.
But in actual applications, above-mentioned programming operation process exists some problems and defective.Concrete, in programming process, after being finished, a byte programming needs its programmed result is verified, if checking is not passed through, also need this byte is carried out programming operation again.Because in this process, programming operation and verification operation are different to the grid of the cell of control Flash and the added voltage that drains, when to single byte operation (the corresponding cell in byte position), switching controls grid that does not stop and drain voltage will influence program speed greatly.
For example, for NOR type Flash, when programming operation, grid and the added voltage of drain electrode approximately are respectively: 9.0V and 4.2V, and when verification operation, grid and the added voltage of drain electrode are respectively: 5.5V and 1.0V.Grid voltage and drain voltage are produced by voltage pump respectively, voltage when switching significantly, the time that need discharge and recharge.Because voltage switching times of the prior art is more, the time of discharging and recharging adds up just more considerable, has a strong impact on program speed.
In a word, need the urgent technical matters that solves of those skilled in the art to be exactly at present: how can propose a kind of follow-on operation scheme for programming, can improve existing Flash program speed.
Summary of the invention
Technical matters to be solved by this invention provides a kind of method and apparatus that flash memory Flash is carried out data programing, it can carry out data programing by whole page or leaf based on of Flash, reduce the switching times of the voltage of control grid and drain electrode, thereby can improve existing Flash program speed.
In order to solve the problems of the technologies described above, the embodiment of the invention discloses and a kind of flash memory is carried out the method for data programing, may further comprise the steps:
Step a, data input step;
Step b, verify whole current page, obtaining wherein needs the byte of programming, and is recorded to corresponding memory buffer; If in current page, there is not the byte that need programme, then finish data programing to current page, enter down one page;
Step c, the foundation information that described memory buffer write down are programmed to corresponding byte successively; If the byte to required programming in the current page is all programmed, then return step b; Otherwise, continue execution in step c, next byte is operated.
Preferably,, can also comprise: all programmed when finishing when the data of being imported, then need not to enter down one page, finished whole programming operation for step b.
Preferably, verify whole current page by following steps: beginning with the byte from the start address of this page is unit, the data that relatively need the data that write to this byte and this byte to store; Comparative result is write relevant position with the corresponding memory buffer of this byte address; Repeat above-mentioned steps, until complete current page of checking.
Preferably, when the address of the current byte of operating is last address of current page, is judged to be the byte of required programming in the current page is all programmed.
Preferably, step c may further include: the comparative result that read buffer memory is stored; Programming is if desired carried out next step after then corresponding byte being programmed; Otherwise, directly carry out next step; Judge whether current byte is last address of current page, if, then return step b, otherwise, the next comparative result that read buffer memory is stored returned.
Preferably, in step b, when the checking for current page belonged to the checking of programming back, only the byte of programming operation had been carried out in checking.
According to another embodiment of the present invention, also disclose and a kind of flash memory has been carried out the device of data programing, comprise with lower member:
Data input cell;
Authentication unit is used to verify whole current page, and obtaining wherein needs the byte of programming, and is recorded to corresponding memory buffer; If in current page, there is not the byte that need programme, then finish data programing operation to current page, enter down one page;
Programming unit is used for successively corresponding byte being programmed according to the information that described memory buffer write down; When the byte of required programming has all been programmed in to current page, then trigger authentication unit; Otherwise, continue next byte is operated.
Preferably, described authentication unit may further include:
Comparison module, being used for beginning with the byte from the start address of this page is unit, the data that relatively need the data that write to this byte and this byte to store;
Logging modle is used for comparative result is write relevant position with the corresponding memory buffer of this byte address;
Scheduler module is used to repeat to call above-mentioned module, until complete current page of checking.
Preferably, described programming unit may further include:
Read module is used for the comparative result that read buffer memory is stored;
Programming module is used for when needs are programmed, and triggers the first redirect module after then corresponding byte being programmed; Otherwise, directly trigger the first redirect module;
The first redirect module is used to judge whether current byte is last address of current page, if, then trigger authentication unit, otherwise, the next comparative result that notice read module read buffer memory is stored.
Preferably, described authentication unit can also comprise: the second redirect module, when the data of importing when data input cell have all been programmed and finished, then need not to enter down one page, and finish whole programming operation.
Compared with prior art, the present invention has the following advantages:
General, Flash can be divided into a plurality of (block), and each piece (block) can be divided into a plurality of sectors (sector) again, and each sector (sector) can be divided into a plurality of pages or leaves (page) again, and each page or leaf (page) can comprise a plurality of bytes.The present invention carries out data authentication step in the programming operation process and data write step at a whole page or leaf, carrying out data again after thereby the data that can be stored in the byte of the whole page or leaf to are verified writes, and carry out data in the byte of whole page or leaf and carry out whole page data verification again after writing one, load the grid and the upward switching times of different voltages that drains so can reduce greatly, save discharging and recharging the time of grid and drain voltage pump, and then improved the program speed of Flash.
And for Flash, page or leaf is the logic least unit that Flash carries out programming operation, and is general, and each data programing operation all can take at least one page or leaf, so the present invention on the basis of improving program speed, can not influence programmed result simultaneously yet.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
One of core concept of the present invention is: changed prior art at single byte verify, the pattern of repetitive operation such as programming, and adopted at whole page or leaf verify, the pattern of repetitive operation such as programming, make when verification operation or programming operation, can carry out at byte in batches, load the grid and the upward switching times of different voltages that drains thereby can reduce, saved and switched required discharging and recharging the time, improved the program speed of Flash.
With reference to Fig. 2, show and a kind of flash memory is carried out the method embodiment 1 of data programing, it is characterized in that, comprising:
Step 201, data input step; More particularly, the data that received (being the required data that write) can be stored in the page buffer of flash memory, so that the later programmed step is obtained;
Step 202, verify whole current page, obtaining wherein needs the byte of programming, and is recorded to corresponding memory buffer; If in current page, there is not the byte that need programme, then finish data programing operation to current page, enter down one page;
Certainly, need to prove, all programmed when finishing, then need not to enter down the checking and the programming process of one page, directly finish whole programming operation and get final product when the data of being imported.
Step 203, the foundation information that described memory buffer write down are programmed to corresponding byte successively;
If step 204 is all programmed to the byte of required programming in the current page, then return step 202.Otherwise, continue execution in step 203, next byte in the current page is operated.If current page is operated each byte according to the mode from the start address to the end address, then when the address of the current byte of operating is last address of current page, just can knows the byte of required programming in the current page is all programmed.
After returning step 202, again verify current page, whether correct with the check programming, if there is the incorrect byte of programming, then still need it is programmed once more, till all correct, promptly in current page, there has not been the byte that need programme, enter then the checking and the programming process of one page down.
For NOR type Flash and NAND type Flash, basic identical at the data programing operating process of the two, the operating voltage that just is applied on the memory cell has varying level, has just described no longer respectively in the embodiment of the invention.
Programming embodiment illustrated in fig. 2 can be applied in the user and write under the various situations of data, certainly, because in the Flash operation, the general programming operation that all after erase operation, just carries out, that is, carry out programming operation under the completely erased situation of the data that present embodiment can be in being stored in memory cell.To this, belong to those skilled in the art should know, the present invention no longer describes in detail.
In the verification step of step 202, a kind of situation is first this page or leaf to be verified, to determine having which byte to be programmed in this page or leaf; Another kind of situation is the page or leaf through programming to be verified, to check that whether it is by correct programming.In both cases, can all bytes of this page be compared one by one, need be programmed the byte that writes data with definite, and the record result.
In a preferred embodiment of the invention, to when verifying, can only verifying that also the related byte of this programming write operation gets final product through the page or leaf of programming because other bytes in verification step before, be verified by, can omit.Certainly,, cause its data mode to change,, then can verify whole bytes of current page for fear of this situation owing in the programming ablation process, may influence adjacent cell.Be well known that, the just corresponding cell in byte position, general, a byte has 8, then just corresponding 8 cell of byte.
The ultimate principle of verification step is, reading under the program verification condition is the current conversion in the drain electrode voltage then, and compares with reference voltage on the grid that voltage is added to cell, according to comparative result, judge that the data of being stored among this cell are " 1 " or " 0 "; And then compare with data (being the data that step 101 receives) that the required programming of current byte writes, if consistent, illustrate that then this byte does not need programming to write, otherwise just explanation needs programming to write.For example, carry out erase operation earlier, then the cell of all bytes in the current page should be " 1 ", if the data that required programming writes are " 1 " just, then just need not current byte has been programmed, and the data that write when required programming are during for " 0 ", comparative result---" inconsistent " that then needs to write down this cell.Step 203 is exactly that the cell of these comparative results for " inconsistent " programmed.
Preferably, in step 202, can verify whole current page by the step of following more refinement: beginning with the byte from the start address of this page is unit, the data that relatively need the data that write to this byte and this byte to store; Comparative result is write relevant position with the corresponding memory buffer of this byte address; Repeat above-mentioned steps, until complete current page of checking.The i.e. comparative result of each cell in each byte of detail record in memory buffer, in programming step, compared result is programmed for the cell of " inconsistent " then.
Preferably, programming step can be refined as following several sub-steps: the comparative result that read buffer memory is stored; Programming if desired, execution in step 204 after then corresponding byte being programmed; Otherwise, direct execution in step 204.Be used in the step 204 to judge condition that all bytes have all programmed can for: judge whether current byte is last address of current page, if then be judged to be all and programme.If in step 204, current byte is not last address of current page, then returns step 203 and continues to carry out the next comparative result that read buffer memory is stored.
With reference to Fig. 3, show that the present invention is a kind of to carry out the embodiment 2 of data programing to flash memory, specifically can comprise:
Step 301, to begin with the byte from the start address of one page be that unit verifies, relatively whether this byte data of storing are consistent with the required data that write; The result is write in the memory buffer of this byte address correspondence; Certainly, generally can one the corresponding memory buffer of byte, the comparative result of this byte can be stored in the memory buffer with the corresponding position of this byte address on.
Step 302, verified current byte after, increase byte address, the byte of next address is verified, up to complete page or leaf of checking.Whether concrete, byte that can be by judging current checking is last byte of this page or leaf, if then carry out next step, otherwise the increase byte address is proceeded to verify.
Step 303, whether will carry out programming operation according to the checking results verification, execution in step 304 then if necessary, otherwise finish programming operation at this page.The situation (data that are required data that write and former storage are inconsistent) that whether has "No" in the comparative result of promptly checking in the memory buffer to be stored, if having, then explanation need be programmed to some bytes in the current page.
Step 304, read a comparative result the storer, judge whether and to programme to this byte, execution in step 305 then if necessary, otherwise execution in step 306 according to comparative result from buffering.Simply, store whole comparative results, read successively and get final product, can reduce calculating like this byte address.Certainly, also can directly write down the comparative result of " inconsistent " and the address of respective byte, and need not write down the comparative result of " unanimity ", promptly only write down the byte address that to programme.
Step 305, carry out programming operation to the byte of corresponding address according to the data that received (data that need write to this byte).
Step 306, the byte of judging current operation whether be this page last byte (as, last address that its address is this page), if then return execution in step 301, the current page of having programmed is verified once more, finished to guarantee that data programing writes accurately.If not last byte of this page, then return execution in step 304, continue to read next comparative result.
Current operation described in the step 306 is write fashionablely carrying out programming, is the programming write operation; Do not carry out the programming write fashionable, for reading the operation of comparative result.
With reference to Fig. 4, show that the present invention is a kind of to carry out the device embodiment of data programing to flash memory, specifically can comprise with lower member:
Data input cell 401;
Authentication unit 402 is used to verify whole current page, and obtaining wherein needs the byte of programming, and is recorded to corresponding memory buffer; If in current page, there is not the byte that need programme, then finish data programing operation to current page, enter the verification of programming operation of one page down;
Programming unit 403 is used for successively corresponding byte being programmed according to the information that described memory buffer write down; When the byte of required programming has all been programmed in to current page, then trigger authentication unit 402; Otherwise, continue next byte is operated.
In a preferred embodiment, described authentication unit 402 may further include following submodule:
Comparison module 4021, being used for beginning with the byte from the start address of this page is unit, the data that relatively need the data that write to this byte and this byte to store;
Logging modle 4022 is used for comparative result is write relevant position with the corresponding memory buffer of this byte address;
Scheduler module 4023 is used to repeat to call above-mentioned module, until complete current page of checking.
In a preferred embodiment, described programming unit 403 may further include following submodule:
Read module 4031 is used for the comparative result that read buffer memory is stored;
Programming module 4032 is used for when needs are programmed, and triggers the first redirect module 4033 after then corresponding byte being programmed; Otherwise, directly trigger the first redirect module 4033;
The first redirect module 4033 is used to judge whether current byte is last address of current page, if, then trigger authentication unit 402, otherwise, the next comparative result that notice read module 4031 read buffer memories are stored.
Preferably, embodiment illustrated in fig. 4 in, described authentication unit 402 can also comprise:
The second redirect module 4024 when the data of being imported when data input cell 401 have all been programmed and finished, if authentication unit 402 determines not have the byte that need programme in current page, then need not to enter down one page, finishes whole programming operation and gets final product.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For device embodiment, because it is similar substantially to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
Need to prove that device embodiment of the present invention can adopt the mode of hardware circuit to be arranged in the Flash flash memory and realize, also can be used as the external devices individualism, for example, the situation that adopts specific purpose tool to programme and write at needs.
More than to a kind of method and apparatus that the Flash flash memory is carried out data programing provided by the present invention, be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.