The invention relates to a flash memory and a writing method thereof, and more particularly, to a flash memory and a writing method thereof that can execute a programming while erasing operation.
In NOR flash memories, the speed of performing an erase operation is much slower than the speed of performing a program operation. In the application of the Internet of Things, the so-called on-the-air firmware update is a very important function for the flash memory. Therefore, if the time required for data update by the flash memory can be effectively reduced, the risk due to power loss or defective software versions can be effectively reduced for the content of the flash memory.
The invention provides to a flash memory and a writing method thereof, which can accelerate a data writing speed of the memory by executing a programming while erasing operation and can reduce power consumption.
The flash memory of the invention includes a plurality of memory blocks and a plurality of multiplex circuits. The memory blocks are arranged into a plurality of memory banks. The multiplex circuits are coupled to the memory banks, respectively. Each of the memory blocks transmits a plurality of erase voltages or a plurality of program voltages to the corresponding memory bank for executing an erase operation or a program operation. The program operation is executed by one of the memory banks while the erase operation is executed by another one of the memory banks according to a programming while erasing instruction.
The writing method of the flash memory of the invention includes: arranging a plurality of memory blocks into a plurality of memory banks; providing a plurality of multiplex circuits to respectively correspond to the memory banks so that each of the memory blocks transmits a plurality of erase voltages or a plurality of program voltages to the corresponding memory bank for executing an erase operation or a program operation; and executing the program operation by one of the memory banks while executing the erase operation by another one of the memory banks according to a programming while erasing instruction.
Based on the above, the memory blocks are arranged into multiple memory banks in the invention. The multiplex circuits are used to provide different voltage supply pipelines. According to the programming while erasing instruction, multiple erase voltages are provided to one of the memory banks for executing the erase operation, and multiple program voltages are provided to another one of the memory banks for executing the program operation. In the embodiment of the invention, among the different memory banks, the program operation and erase operation can be executed synchronously to effectively reduce the time required for memory writing.
Referring to
In this embodiment, the multiplex circuits 130 and 140 can conduct proper operation voltages according to a program instruction PGMCMD, or an erase instruction ERSCMD. One of the multiplex circuits 130 and 140 can make the corresponding memory bank (one of the memory banks BK1 and BKN) execute the erase operation according to the erase instruction ERSCMD. The other one of the multiplex circuits 130 and 140 can make the corresponding memory bank (the other one of the memory banks BK1 and BKN) execute the program operation according to the program instruction PGMCMD.
For instance, please refer to
When the flash memory chip 102 receives the erase instruction ERSCMD, the multiplex circuit 130 can provide the erase voltages ERSV to the memory bank BK1 so that the memory bank BK1 can execute the erase operation. Meanwhile, the multiplex circuit 140 can provide the program voltages PGV to the memory bank BKN so that the memory bank BKN can execute the program operation if a program instruction PGMCMD is received with an address other than the memory bank BK1 to be erased, and here for example the address is located in the memory bank BKN. Here, it should be noted that in this example, a plurality of status flags can be set for the corresponding memory banks BK1 and BKN respectively. Take the memory block BK1 as an example, one status flag can record an erase status and another status flag can record a program status of the memory bank BK1. The multiplex circuits 130 and 140 can make the corresponding memory banks BK1 and BKN execute the erase operation or the program operation according to values of the status flags.
It is particularly worth noting that in the embodiment of the invention, the program operation of the memory bank BKN is executed synchronously with the erase operation of the memory bank BK1 in the above example. Under the premise that the erase operation requires a relatively long operation time, the program operation of the memory bank BKN does not require additional operation time. Therefore, the program operation of the memory bank BKN does not need to be completed in a hurry, but can be executed through a degraded program operation. Here, the so-called degraded program operation is achieved by reducing the number of bits of programmed memory cells and/or reducing (compared to a general program operation) voltage values the program voltages that produce a hot carrier injection effect. Accordingly, power consumption can be reduced by reducing a program current required in the program operation, and making the program current less than an expected value (the expected value can be equal to a current value of the program current required for the general program operation).
For an arranging method of memory blocks in the embodiment of the invention, reference can be made according to
In
Further, in
Referring to
In addition, the multiplex circuit 321 is configured to provide the erase voltages ERSV or the program voltages PGV to the bit line select switch driver 331, the word line driver 341 and the drivers 351 and 361 to make the memory blocks in the memory bank BK1 execute the erase operation or the program operation. The multiplex circuit 322 is configured to provide the erase voltages ERSV or the program voltages PGV to the bit line select switch driver 332, the word line driver 342 and the drivers 352 and 362 to make the memory blocks in the memory bank BK1 execute the erase operation or the program operation. Among them, the bit line select switch drivers 331 and 332 are configured to control on or off of a plurality of bit line switches; the word line drivers 341 and 342 respectively provide a plurality of word line voltages to a plurality of word lines; the drivers 351 and 352 are used to provide a plurality of bias voltages to a plurality of PWI regions; the drivers 361 and 362 respectively provide a plurality of bias voltages to a plurality of NWD regions.
For implementation details of the multiplex circuits 321 and 322, reference can be made according to
In
In detail, the memory blocks corresponding to the multiplex circuit 400 have a plurality of selected PWI regions SPWI and a plurality of un-selected PWI regions DSPWI. In the part corresponding to the selected PWI region SPWI, through a first path formed by the voltage selectors MX41, MX31, MX21 and MX11, the multiplex circuit 400 provides the positive boost voltage VPCP output by the voltage selector MX11 to word lines of selected memory cells in the selected PWI region SPWI. Corresponding to the embodiment of
Among them, the memory cells connected by the first path are the selected memory cells, and the memory cells connected by the second path to the fourth path are all the un-selected memory cells.
Further, in the part corresponding to the un-selected PWI region DSPWI, the reference ground voltage VSS is output through a fifth path formed by the voltage selectors MX34 and MX15; a sixth path formed by the voltage selectors MX34 and MX16; a seventh path formed by the voltage selectors MX34 and MX17; and an eighth path formed by the voltage selectors MX34 and MX18. Since the memory cells in the un-selected PWI region DSPWI are all the un-selected memory cells, the reference ground voltage VSS can be provided to the word lines of all the un-selected memory cells in the un-selected PWI region DSPWI through the seventh path and the eighth path described above.
On the other hand, the voltage selector MX51 selects the positive boost voltage VPCP as an output transmitted to the corresponding bit line select switch driver to turn on selected bit line select switches. The voltage selector MX52 selects the reference ground voltage VSS as an output to turn off un-selected bit line select switches. The voltage selector MX53 selects the power voltage VDD as an output to drive the selected NWD regions through the corresponding driver. The voltage selector MX54 selects the reference ground voltage VSS as an output to drive the selected PWI regions through the corresponding driver. The voltage selectors MX55 and MX56 respectively select the power voltage VDD and the reference ground voltage VSS as outputs. The outputs of the voltage selectors MX55 and MX56 are used to drive un-selected NWD regions and un-selected PWI regions, respectively.
Hereinafter, in
In detail, the memory blocks corresponding to the multiplex circuit 400 have a plurality of selected PWI regions SPWI and a plurality of un-selected PWI regions DSPWI. In the part corresponding to the selected PWI region SPWI, through a first path formed by the voltage selectors MX42, MX32 and MX11, the multiplex circuit 400 provides the negative boost voltage VNCP output by the voltage selector MX11 to word lines of selected memory cells in the selected PWI region SPWI. The negative boost voltage VNCP output by the voltage selector MX11 can be first provided to the word line driver to drive the word lines of the selected memory cells. Through a second path formed by the voltage selectors MX42, MX32 and MX12, the negative boost voltage VNCP can be provided by an output of the voltage selector MX12 to the word lines of the selected memory cells in the selected PWI region SPWI. In addition, the multiplex circuit 400 can provide the positive mask voltage VPCP_INH to word lines of un-selected memory cells in the selected PWI region SPWI respectively through a third path formed by the voltage selectors MX41, MX31, MX22 and MX13; and a fourth path formed by the voltage selectors MX41, MX31, MX22 and MX14. The four paths mentioned above can be corresponded by decoding a global word line flag GWL and a local word line flag LWL corresponding to the word lines of the memory cells, and a corresponding relationship for receiving the negative boost voltage VNCP or the positive mask voltage VPCP_INH through the corresponding paths is shown in the following table:
Among them, the memory cells connected by the first path and second path are the selected memory cells, and the memory cells connected by the third path and the fourth path are all the un-selected memory cells.
Further, in the part corresponding to the un-selected PWI region DSPWI, the reference ground voltage VSS is output through a fifth path formed by the voltage selectors MX34 and MX15; a sixth path formed by the voltage selectors MX34 and MX16; a seventh path formed by the voltage selectors MX34 and MX17; and an eighth path formed by the voltage selectors MX34 and MX18. Since the memory cells in the un-selected PWI region DSPWI are all the un-selected memory cells, the reference ground voltage VSS can be provided to the word lines of all the un-selected memory cells in the un-selected PWI region DSPWI through the seventh path and the eighth path described above.
On the other hand, the voltage selector MX51 selects the reference ground voltage VSS as an output transmitted to the corresponding bit line select switch driver to turn off the selected bit line select switches. The voltage selector MX52 selects the reference ground voltage VSS as an output to turn off un-selected bit line select switches. The voltage selector MX53 selects the positive boost voltage VPCP as an output to drive selected NWD regions through the corresponding driver. The voltage selector MX54 selects the positive boost voltage VPCP as an output to drive selected PWI through the corresponding driver. The voltage selectors MX55 and MX56 respectively select the power voltage VDD and the reference ground voltage VSS as outputs. The outputs of the voltage selectors MX55 and MX56 are used to drive un-selected NWD regions and un-selected PWI regions, respectively.
Referring to
Incidentally, in this embodiment, a positive boost voltage VPCP_BK1 output by the voltage selector MX41a is provided to the memory bank corresponding to the multiplex circuit 510; a positive boost voltage VPCP_BK2 output by the voltage selector MX41b is provided to the memory bank corresponding to the multiplex circuit 520; a negative boost voltage VNCP_BK1 output by the voltage selector MX42a is provided to the memory bank corresponding to the multiplex circuit 510; a negative boost voltage VNCP_BK2 output by the voltage selector MX42b is provided to the memory bank corresponding to the multiplex circuit 520.
In addition, in the embodiments of
In addition, control signals received by the voltage selectors MX11a to MX56a and MX11b to MX56b can be generated by a controller set corresponding to the flash memory. Regarding the implementation details of the voltage selectors MX11a to MX56a and MX11b to MX56b, any voltage selection circuit well known to those skilled in the art can be used for implementation without particular limitations.
Referring to
Specifically, in step S610, the erase operation for a first memory bank is started. In step S620, a pre-program operation is executed. Then, a step i=0 and a shot j=0 are configured in step S630. Here, it should be noted that the erase operation in this embodiment is executed by a multi-step and multi-shot method. Here, the so-called “shot” refers to an erase voltage pulse applied to the memory cell on which the erase operation is executed. The so-called “multi-stage and multi-shot method” is to configure one target voltage for each erase step, and apply one or more erase voltage pulses (shots) in each erase step so that a threshold voltage of the erased memory cell can be less than the configured target voltage. After multiple erase steps are executed, the threshold voltage of the memory cell can eventually become smaller than an erase target voltage configured.
Next, in step S640, a voltage value of an erase voltage is configured. Then, in step S650, the erase voltage pulse is applied to the memory cell according to the voltage value configured in step S640. Here, it should be noted that the erase voltage pulse can last for one time interval. With this time interval, the program operation of steps S601 to S605 may be executed for a second memory bank.
First, in step S601, whether to retry stating the program operation again can be determined according to whether the program operation has been executed previously. If the determination result is Yes, the step S603 can be directly performed to conduct a program flow. On the contrary, if the determination result is No, whether it is required to execute a new program operation is determined in step S602. Here, if the determination result of step S602 is Yes, step S603 is performed; otherwise, if the determination result of step S602 is No, step S670 is performed.
Here, it should be noted that, in step S603, a program voltage pulse can be applied to a programmed memory cell one or many times. Then, whether a threshold voltage Vt of the programmed memory cell is greater than a program target voltage is determined in step S604. If the threshold voltage Vt of the memory cell is greater than the program target voltage, it indicates that the program operation is done, and step S670 can be performed. Otherwise, if the threshold voltage Vt of the memory cell is not greater than the program target voltage in the time interval, it indicates that the program operation is undone, and a mark retry operation can be performed by using a flag in step S605.
Here, it should be noted that, in step S650, the time interval for applying the erase voltage pulse is limited. Therefore, if the time interval for applying the erase voltage pulse is not long enough to complete the program operation of the memory cell, the undone program operation of the memory cell can be completed in another time interval for applying the next erase voltage pulse by the mark retry operation of step S605.
What's more worth mentioning is that when the erase voltage pulse is stably supplied, the power consumed by the flash memory for the erase operation is relatively low. Therefore, the program operation simultaneously executed by another memory bank at this time will not cause the problem of excessive power consumption.
From the above description, it can be known that, in the embodiments of the invention, the program operation in the programming while erasing operation is executed by being embedded in the erase operation, and no additional time interval is required. Therefore, the program operation does not have to be completed very quickly, but can be executed through the degraded program operation to reduce the program current required in the program operation so that the program current can be less than the expected value to effectively reduce power consumption.
Step S670 is performed after step S650 is done, and is used to execute an erase verification. In step S680, whether the threshold voltage Vt of the erased memory cell is less than a target voltage V1 at this step is determined, or whether j is greater than a preset maximum value is determined. Step S6100 is performed if one of the two determination results above is Yes; and step S690 is performed if the two determination results are both No.
In step S690, j is incremented by 1 (j++), and then step S650 is performed to apply the next erase voltage pulse.
In step S6100, whether the threshold voltage Vt of the erased memory cell is less than the erase target voltage is determined, or whether j is greater than the maximum value is determined. The erase operation is done (step S6130) if one of the two determination results above is Yes. If the two determination results are both No, step S6120 is performed to: increment i by 1 (i++); return j to zero; and execute the next step of the erase operation.
Referring to
Please refer to
In the step S830, the host issues a block erase command with a targeted memory block address, and the flash memory starts to erase the target address in a step S840. Then, in a step S850, the host queries any program in progress in the flash memory. If a query result of the step S850 is yes, the another program operation is not allowed because there is already a program operation in place, and if the query result of the step S850 is no, a step S860 can be performed. The host issues a program command with the target address in a step S860, and the flash memory checks whether the program address is in erase or not in a step S870.
If a check result in the step S870 is yes, the PwE operation may be end, and if the check result in the step S870 is no, the flash memory starts to program the targeted address in a step S880.
In another implementation, the host can just start from S850 to performance PwE if it knows an erase operation already in place.
Please refer to
In summary, the invention provides the programming while erasing instruction for executing the program operation by one of the memory banks while executing the erase operation by another one of the memory banks. Under the condition of a large amount of data update, by inserting the program operation that can be completed relatively quick into the erase operation with a relatively slow speed, the time required for the write operation of the flash memory is effectively reduced. Furthermore, according to the embodiments of the invention, the programming while erasing operation can reduce required power consumption by providing the degraded program operation to further improve a working performance of the flash memory.