TWI698881B - Encoding method and memory storage apparatus using the same - Google Patents
Encoding method and memory storage apparatus using the same Download PDFInfo
- Publication number
- TWI698881B TWI698881B TW108124718A TW108124718A TWI698881B TW I698881 B TWI698881 B TW I698881B TW 108124718 A TW108124718 A TW 108124718A TW 108124718 A TW108124718 A TW 108124718A TW I698881 B TWI698881 B TW I698881B
- Authority
- TW
- Taiwan
- Prior art keywords
- codeword
- bits
- bit
- new
- flip
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1008—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
- G06F11/1048—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using arrangements adapted for a specific error detection or correction feature
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C29/00—Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
- G11C29/04—Detection or location of defective memory elements, e.g. cell constructio details, timing of test signals
- G11C29/08—Functional testing, e.g. testing during refresh, power-on self testing [POST] or distributed testing
- G11C29/12—Built-in arrangements for testing, e.g. built-in self testing [BIST] or interconnection details
- G11C29/38—Response verification devices
- G11C29/42—Response verification devices using error correcting codes [ECC] or parity check
Abstract
Description
本發明是有關於一種記憶體儲存裝置,且特別是有關於一種編碼方法及使用所述編碼方法的記憶體儲存裝置。 The present invention relates to a memory storage device, and particularly relates to an encoding method and a memory storage device using the encoding method.
一般來說,可根據錯誤校正碼(error correcting code,ECC)將待寫入到可重複寫入非易失性記憶體(non-volatile memory,NVM)的資料編碼成碼字。也可通過對應的解碼程序來處理從可重複寫入非易失性記憶體讀取的碼字以還原所述資料。碼字通常是資料本身與根據以下產生的奇偶校驗資料的組合:博斯-喬杜裡-霍昆格姆(Bose-Chaudhuri-Hocquenghem,BCH)碼、漢明碼(hamming code)、具有額外奇偶校驗的漢明碼(SECDED)、裡德-索羅門(Reed-Solomon)碼、蕭氏(Hsiao)碼、或連氏(Lien)碼等。 Generally speaking, the data to be written into the rewritable non-volatile memory (NVM) can be encoded into code words according to the error correcting code (ECC). The codeword read from the rewritable non-volatile memory can also be processed through the corresponding decoding program to restore the data. The codeword is usually a combination of the data itself and the parity data generated according to the following: Bose-Chaudhuri-Hocquenghem (BCH) code, hamming code, with extra parity Checked Hamming code (SECDED), Reed-Solomon (Reed-Solomon) code, Hsiao code, or Lien code, etc.
為改善NVM寫入功率、寫入時間及週期可靠性,需要一種方法及一種晶片上ECC演算法來實現低功率設計及頁面寫入時 間減少並改善裝置可靠性。 In order to improve the NVM write power, write time and cycle reliability, a method and an on-chip ECC algorithm are needed to achieve low power design and page write time Time reduction and improvement of device reliability.
因此,本發明提供一種編碼方法及一種使用所述編碼方法的記憶體儲存裝置,其中利用ECC演算法來實作NVM翻轉位元寫入功能,以減少寫入時間、寫入功率並改善可靠性。 Therefore, the present invention provides an encoding method and a memory storage device using the encoding method, in which the ECC algorithm is used to implement the NVM flip bit writing function, so as to reduce writing time, writing power and improve reliability .
本發明的示例性實施例提供一種用於採用錯誤校正碼(ECC)演算法的記憶體儲存裝置的編碼方法。所述編碼方法包括:接收包含寫入位址及寫入資料的寫入命令;讀取現有碼字;將翻轉位元附加到寫入資料;由ECC編碼器基於預設ECC對寫入資料及翻轉位元進行編碼以產生多個奇偶校驗位元,並將寫入資料及翻轉位元附加到所述奇偶校驗位元以產生新碼字;基於所選位元中從現有碼字成為新碼字需要改變的位元數目來翻轉新碼字;以及將新碼字及經翻轉的新碼字中的一者寫入到寫入位址。 An exemplary embodiment of the present invention provides an encoding method for a memory storage device using an error correction code (ECC) algorithm. The encoding method includes: receiving a write command including a write address and write data; reading an existing codeword; appending a flip bit to the written data; writing data and writing data by an ECC encoder based on a preset ECC Flip bits for encoding to generate multiple parity bits, and append the written data and flip bits to the parity bits to generate a new codeword; based on the selected bits, the existing codeword becomes The new codeword needs to change the number of bits to flip the new codeword; and write one of the new codeword and the flipped new codeword to the write address.
本發明的另一示例性實施例提供一種採用ECC演算法的記憶體儲存裝置。所述記憶體儲存裝置包括連接介面、記憶體陣列及記憶體控制電路。所述連接介面被配置成耦接到主機系統。所述記憶體控制電路耦接到連接介面及記憶體陣列且被配置成回應於接收到包含寫入位址及寫入資料的寫入命令而基於ECC演算法來執行編碼操作。所述編碼操作包括:讀取現有碼字;將翻轉位元附加到寫入資料;由ECC編碼器基於ECC演算法來對寫入資料及翻轉位元進行編碼以產生多個奇偶校驗位元,並將寫入資料 及翻轉位元附加到所述奇偶校驗位元以產生新碼字;基於所選位元中從現有碼字成為新碼字需要改變的位元數目來翻轉新碼字;以及將新碼字及經翻轉的新碼字中的一者寫入到寫入位址。 Another exemplary embodiment of the present invention provides a memory storage device using an ECC algorithm. The memory storage device includes a connection interface, a memory array and a memory control circuit. The connection interface is configured to be coupled to the host system. The memory control circuit is coupled to the connection interface and the memory array and is configured to perform an encoding operation based on an ECC algorithm in response to receiving a write command including a write address and write data. The encoding operation includes: reading the existing codeword; appending the flip bit to the written data; the ECC encoder encodes the written data and the flip bit based on the ECC algorithm to generate a plurality of parity bits And will write data And a flip bit is appended to the parity bit to generate a new codeword; the new codeword is flipped based on the number of bits that need to be changed from an existing codeword to a new codeword in the selected bits; and the new codeword And one of the flipped new codewords is written to the write address.
基於以上內容,通過採用本發明中所提供的編碼方法及記憶體儲存裝置,回應於接收到寫入命令,對寫入資料進行編碼並與寫入位址中的或具有預定義模式的現有碼字進行比較以確定寫入時需要改變的位元數目。基於所確定數目來選擇性地翻轉經編碼碼字的位元,並將指示位元翻轉的至少一個翻轉位元添加到碼字。因此,寫入時的位元改變數目可減少,且寫入時間及功率可減少。 Based on the above content, by adopting the encoding method and memory storage device provided in the present invention, in response to receiving a write command, the written data is encoded and compared with the existing code in the written address or with a predefined pattern. Words are compared to determine the number of bits that need to be changed when writing. The bits of the encoded codeword are selectively flipped based on the determined number, and at least one flipped bit indicating bit flipping is added to the codeword. Therefore, the number of bit changes during writing can be reduced, and the writing time and power can be reduced.
100:記憶體儲存裝置 100: Memory storage device
110:連接介面 110: Connection interface
130:記憶體控制電路/記憶體控制電路單元 130: Memory control circuit / memory control circuit unit
131:錯誤校正碼(ECC)編碼器 131: Error Correction Code (ECC) encoder
150:記憶體陣列 150: memory array
CW:51位元碼字/51位元新碼字 CW: 51-bit codeword/51-bit new codeword
EC1、EC2、EC4:51位元現有碼字/現有碼字 EC1, EC2, EC4: 51-bit existing codeword/existing codeword
EC3:現有碼字 EC3: Existing codeword
EC3a:現有碼字的偶數位元 EC3a: Even bits of the existing codeword
EC3b:現有碼字的奇數位元 EC3b: Odd bits of the existing codeword
f1、f3、f4:翻轉位元 f1, f3, f4: flip bit
m1~m32:寫入資料 m1~m32: write data
Mp:矩陣 Mp: matrix
NC1、NC2、NC4:51位元新碼字/新碼字 NC1, NC2, NC4: 51-bit new codeword/new codeword
NC1’、NC2’、NC3a’、NC3b’、NC4’:經翻轉新碼字 NC1’, NC2’, NC3a’, NC3b’, NC4’: New code words after flipping
NC3:52位元新碼字/新碼字 NC3: 52-bit new codeword/new codeword
NC3a:新碼字的偶數位元 NC3a: Even bits of the new codeword
NC3b:新碼字的奇數位元 NC3b: Odd bits of the new codeword
OD:33位元資料 OD: 33-bit data
p1~p18:元素 p1~p18: element
PD:18位元奇偶校驗資料 PD: 18-bit parity data
S202、S204、S206、S208、S702、S704、S706、S708、S710、S712、S714、S716、S718、S720、S722:步驟 S202, S204, S206, S208, S702, S704, S706, S708, S710, S712, S714, S716, S718, S720, S722: steps
圖1是示出根據本發明實施例的記憶體儲存裝置的示意性方塊圖。 FIG. 1 is a schematic block diagram showing a memory storage device according to an embodiment of the present invention.
圖2是示出根據本發明實施例用於記憶體儲存裝置的編碼方法的流程圖。 FIG. 2 is a flowchart showing an encoding method used in a memory storage device according to an embodiment of the present invention.
圖3是示出根據本發明另一實施例採用通過BCH(51,33,7)修改的ECC演算法的編碼方法的示意圖。 Fig. 3 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (51, 33, 7) according to another embodiment of the present invention.
圖4是示出根據本發明另一實施例採用通過BCH(51,33,7)修改的ECC演算法的編碼方法的示意圖。 Fig. 4 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (51, 33, 7) according to another embodiment of the present invention.
圖5是示出根據本發明另一實施例採用通過BCH(51,33,7) 修改的ECC演算法的編碼方法的示意圖。 FIG. 5 shows the use of BCH (51, 33, 7) according to another embodiment of the present invention Schematic diagram of the encoding method of the modified ECC algorithm.
圖6是示出根據本發明另一實施例採用通過BCH(51,33,7)修改的ECC演算法的編碼方法的示意圖。 Fig. 6 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (51, 33, 7) according to another embodiment of the present invention.
圖7是示出根據本發明實施例用於記憶體儲存裝置的編碼方法的流程圖。 FIG. 7 is a flowchart showing an encoding method used in a memory storage device according to an embodiment of the present invention.
圖8是示出根據本發明另一實施例採用通過BCH(52,34,7)修改的ECC演算法的編碼方法的示意圖。 FIG. 8 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (52, 34, 7) according to another embodiment of the present invention.
現在將詳細參照本發明的較佳實施例,在圖式中示出所述較佳實施例的實例。在圖式及說明中,盡可能地使用相同參考編號來指代相同或類似的元件。 Reference will now be made in detail to the preferred embodiment of the present invention, and examples of the preferred embodiment are shown in the drawings. In the drawings and descriptions, the same reference numbers are used as much as possible to refer to the same or similar elements.
參照圖1,記憶體儲存裝置100包括連接介面110、記憶體控制電路130及記憶體陣列150。在一個實施例中,記憶體儲存裝置100是可重複寫入非易失性記憶體,且記憶體陣列150包括多個可重複寫入非易失性記憶體胞元。
1, the
在一個實施例中,連接介面110被配置成通過序列先進技術附接(Serial Advanced Technology Attachment,SATA)標準耦接到主機系統(圖中未示出)。在其他實施例中,連接介面110可符合並行先進技術附接(Parallel Advanced Technology Attachment,PATA)標準、電機電子工程師學會(Institute of Electrical and Electronic Engineers,IEEE)1394標準、或其他適
合的標準,這在本發明並不受限。在一個實施例中,連接介面110可與記憶體控制電路單元130封裝在一個晶片中,或者被放置在具有記憶體控制電路單元130的晶片之外。
In one embodiment, the
記憶體控制電路130耦接到連接介面110及記憶體陣列150,且被配置成執行多個邏輯閘或控制命令,所述邏輯閘或控制命令是以硬體形式或以韌體形式來實作並根據主機系統的命令而在記憶體陣列150中執行例如資料寫入、讀取或抹除等操作。
The
在一個實施例中,記憶體儲存裝置100是採用ECC演算法的可重複寫入NVM,其中記憶體控制電路130進一步包括ECC編碼器131,ECC編碼器131使用所述ECC演算法來對通過連接介面110接收的資料進行編碼以產生碼字並將所述碼字寫入到記憶體陣列150中。應注意,在本發明中,通過所述ECC演算法產生的碼字的一的補數(one's complement)仍為另一碼字。所述ECC演算法例如是通過連氏碼、博斯-喬杜裡-霍昆格姆(BCH)碼、漢明碼、具有額外奇偶校驗的漢明碼(SECDED)、裡德-索羅門碼、或蕭氏碼等修改的ECC,這在本文並不受限。
In one embodiment, the
記憶體陣列150耦接到記憶體控制電路130,且包括多個記憶體胞元(例如,可重複寫入非易失性記憶體胞元)。在一個實施例中,主機系統向記憶體儲存裝置100傳送要將資料寫入到記憶體儲存裝置100的寫入命令,且接著,記憶體控制電路130回應於所述寫入命令而將寫入資料編碼成碼字並將所述碼字儲存在記憶體陣列150中。
The
圖2是示出根據本發明實施例用於記憶體儲存裝置的編碼方法的流程圖。所述編碼方法可由圖1所示實施例的記憶體儲存裝置100執行。因此,在本實施例中,將通過參照前述記憶體儲存裝置100來說明所述編碼方法。
FIG. 2 is a flowchart showing an encoding method used in a memory storage device according to an embodiment of the present invention. The encoding method can be executed by the
參照圖2,記憶體控制電路130通過連接介面110接收包含寫入位址及寫入資料的寫入命令(步驟S202)。回應於所接收的寫入命令,記憶體控制電路130的ECC編碼器131預先讀取現有碼字(步驟S204)。在一個實施例中,現有碼字是預先儲存在寫入位址中的碼字,且在另一實施例中,現有碼字是具有預定義資料模式(例如,000000…、或者FFFFFF…)的碼字,這在本文並不受限。
2, the
同時,ECC編碼器131基於以上所述的ECC演算法將寫入資料編碼成新碼字,並基於從現有碼字成為新碼字需要改變的位元數目來翻轉所述新碼字的多個位元(步驟S206)。具體來說,在步驟S206中,ECC編碼器131可將翻轉位元附加到寫入資料,基於ECC演算法來計算寫入資料及翻轉位元的奇偶校驗資料,並將奇偶校驗資料、寫入資料及翻轉位元組合以產生新碼字。接著,ECC編碼器131將新碼字的多個所選位元與現有碼字的多個所選位元進行比較以確定從現有碼字成為新碼字需要改變的位元數目,並判斷需要改變的所確定位元數目是否超過預定閾值。應注意,在本發明中,經編碼新碼字的一的補數也為碼字。
At the same time, the
在一些實施例中,所述預定閾值是資料位元及奇偶校驗 位元的總數目的一半,這在本文並不受限。 In some embodiments, the predetermined threshold is data bits and parity The total number of bits is half, which is not limited in this article.
如果所確定位元數目被確定為超過預定閾值,則ECC編碼器131翻轉包括資料位元、奇偶校驗位元及翻轉位元的新碼字的位元。另一方面,如果所確定位元數目被確定為低於預定閾值,則ECC編碼器131不對新碼字的位元執行位元翻轉。應注意,如果預定閾值等於碼字位元的數目的一半且所確定位元數目被確定為等於預定閾值,也就是說,將改變的位元數目與將不改變的位元數目相同,則ECC編碼器131也不對經編碼新碼字的位元執行位元翻轉。
If the determined number of bits is determined to exceed a predetermined threshold, the
最終,ECC編碼器131將新碼字及經翻轉新碼字中的一者寫入到寫入位址(步驟S208)。
Finally, the
基於以上內容,由於通過選擇性地翻轉將寫入的碼字的位元而將從現有碼字成為新碼字而改變的位元數目減少至小於碼字位元數目的一半,因此寫入時間及功率可減少,且可靠性及耐久性可改善。 Based on the above, since the number of bits changed from the existing codeword to the new codeword is reduced to less than half of the number of codeword bits by selectively flipping the bits of the codeword to be written, the writing time And power can be reduced, and reliability and durability can be improved.
舉例來說,圖3是示出根據本發明另一實施例採用通過BCH(51,33,7)修改的ECC演算法的編碼方法的示意圖。 For example, FIG. 3 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (51, 33, 7) according to another embodiment of the present invention.
參照圖3,基於通過BCH(51,33,7)修改的ECC演算法,ECC編碼器131將包括32位元寫入資料m1至m32及一個翻轉位元f1的33位元資料OD編碼成51位元碼字CW,且矩陣Mp是計算33位元資料OD的18位元奇偶校驗資料PD時所使用的18*33矩陣。具體來說,當記憶體儲存裝置100接收到32位元寫入資料
時,ECC編碼器131首先將翻轉位元f1附加到所述32位元寫入資料。接著,可將包括所述32位元寫入資料及翻轉位元f1的33位元資料OD寫入單行向量中。接著,將33位元資料OD乘以矩陣Mp,以便獲得具有18個元素p1至p18的單行向量,所述18個元素p1至p18各自表示18位元奇偶校驗資料PD的一個位元。接著,ECC編碼器131將33位元資料OD附加到18位元奇偶校驗資料PD,以產生51位元新碼字CW。
3, based on the ECC algorithm modified by BCH (51, 33, 7), the
在一些實施例中,翻轉位元f1指示對碼字的位元翻轉。在一些實施例中,以第一值(即,邏輯1)來設定所附加的翻轉位元f1,所述第一值指示未對碼字進行位元翻轉。當對碼字執行位元翻轉時,翻轉位元f1也被翻轉成第二值(即,邏輯0),所述第二值指示對碼字進行了位元翻轉。 In some embodiments, the flipped bit f1 indicates bit flipping of the codeword. In some embodiments, the additional flipping bit f1 is set with a first value (ie, logic 1), which indicates that bit flipping is not performed on the codeword. When bit flipping is performed on the codeword, the flipping bit f1 is also flipped to a second value (ie, logic 0), which indicates that bit flipping is performed on the codeword.
基於以上所述的編碼方法,由ECC編碼器131從寫入資料產生包括翻轉位元的新碼字。應注意,在一個實施例中,從自寫入位址讀取的現有碼字成為新碼字而改變的位元被減至最少,且在另一實施例中,從具有預定義資料模式的現有碼字成為新碼字而改變的位元被減至最少。以下給出示例性實施例來進行進一步說明。
Based on the encoding method described above, the
圖4是示出根據本發明另一實施例採用通過BCH(51,33,7)修改的ECC演算法的編碼方法的示意圖。參照圖4,當接收到寫入資料時,ECC編碼器131通過使用在圖3所示實施例中所述的ECC演算法將寫入資料編碼成51位元新碼字NC1。ECC編碼
器131還從寫入位址讀出51位元現有碼字EC1。接著,ECC編碼器131將新碼字NC1的多個位元與現有碼字EC1的多個位元進行比較,以確定從現有碼字EC1成為新碼字NC1需要改變的位元數目。最終,ECC編碼器131基於所確定數目來翻轉包括寫入資料、奇偶校驗位元及翻轉位元的新碼字NC1的位元,並將新碼字NC1及經翻轉新碼字NC1’中的一者寫入到寫入位址。具體來說,ECC編碼器131判斷所確定數目是否超過碼字位元的數目的一半。如果是,則ECC編碼器131翻轉新碼字NC1的所有位元並將包括翻轉位元的經翻轉新碼字NC1’寫入到寫入位址。如果判斷結果為否,則ECC編碼器131不對新碼字NC1執行位元翻轉,並將新碼字NC1寫入到寫入位址。
Fig. 4 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (51, 33, 7) according to another embodiment of the present invention. Referring to FIG. 4, when receiving the written data, the
另一方面,圖5是示出根據本發明另一實施例採用通過BCH(51,33,7)修改的ECC演算法的編碼方法的示意圖。參照圖5,當接收到寫入資料時,ECC編碼器131通過使用圖3所示實施例中所述的ECC演算法將寫入資料編碼成51位元新碼字NC2。ECC編碼器131還讀出具有預定義資料模式(例如000000…)的51位元現有碼字EC2。接著,ECC編碼器131將新碼字NC2的多個位元與現有碼字EC2的多個位元進行比較,以確定從現有碼字EC2成為新碼字NC2需要改變的位元數目。最終,ECC編碼器131基於所確定數目來翻轉包括寫入資料、奇偶校驗位元及翻轉位元的新碼字NC2的位元,並將新碼字NC2及經翻轉新碼字NC2’中的一者寫入到寫入位址。具體來說,ECC編碼器131判斷所確定
數目是否超過碼字位元的數目的一半。如果是,則ECC編碼器131翻轉新碼字NC2的所有位元並將包括翻轉位元的經翻轉新碼字NC2’寫入到寫入位址。如果判斷結果為否,則ECC編碼器131不對新碼字NC2執行位元翻轉,並將新碼字NC2寫入到寫入位址。
On the other hand, FIG. 5 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (51, 33, 7) according to another embodiment of the present invention. 5, when receiving the written data, the
應注意,由於通過ECC演算法產生的奇偶校驗位元(例如,圖3中的奇偶校驗位元p1至p18)始終隨著寫入資料的改變(甚至單位元(one-bit)改變)而改變,因此預期會頻繁地寫入那些奇偶校驗位元、接著寫入所述寫入資料(例如,圖3中的寫入資料)。在此種情形中,即使奇偶校驗位元中需要改變的位元數目是大的,因寫入資料中需要改變的位元較少(即,需要改變的總位元數目小於碼字位元的數目的一半),碼字可能不被翻轉。因此,如果通過資料位元與奇偶校驗位元的總數目來確定位元翻轉,則無法有效地減少奇偶校驗位元的週期次數。因此,在以下實施例中,編碼方法可僅基於從現有碼字成為新碼字需要改變的奇偶校驗位元來確定位元翻轉,以進一步改善位元寫入耐久性,但本發明並非僅限於此。 It should be noted that the parity bits generated by the ECC algorithm (for example, the parity bits p1 to p18 in FIG. 3) always change with the written data (even the one-bit changes) However, it is expected that those parity bits will be frequently written, and then the written data (for example, the written data in FIG. 3) will be written frequently. In this case, even if the number of bits that need to be changed in the parity bit is large, there are fewer bits that need to be changed in the written data (that is, the total number of bits that need to be changed is less than the number of codeword bits. Half of the number), the codeword may not be flipped. Therefore, if the total number of data bits and parity bits is used to determine bit flip, the number of cycles of parity bits cannot be effectively reduced. Therefore, in the following embodiments, the encoding method can determine bit flipping only based on the parity bits that need to be changed from the existing codeword to the new codeword to further improve the bit write durability, but the present invention is not only Limited to this.
舉例來說,圖6是示出根據本發明另一實施例採用通過BCH(51,33,7)修改的ECC演算法的編碼方法的示意圖。參照圖6,當接收到寫入資料時,ECC編碼器131通過使用在圖3所示實施例中所述的ECC演算法將寫入資料編碼成51位元新碼字NC4。ECC編碼器131還從寫入位址讀出51位元現有碼字EC4。接著,ECC編碼器131將新碼字NC4的多個奇偶校驗位元p1至
p18與現有碼字EC4的多個奇偶校驗位元p1至p18進行比較,以確定奇偶校驗位元中從現有碼字EC4成為新碼字NC4需要改變的位元數目。最終,ECC編碼器131基於所確定數目來翻轉新碼字NC4的位元,並將新碼字NC4及經翻轉新碼字NC4’中的一者寫入到寫入位址。具體來說,ECC編碼器131判斷所確定數目是否超過奇偶校驗位元的數目的一半。如果是,則ECC編碼器131翻轉新碼字NC4的所有位元並將包括翻轉位元的經翻轉新碼字NC4’寫入到寫入位址。如果判斷結果為否,則ECC編碼器131不對新碼字NC4執行位元翻轉,並將新碼字NC4寫入到寫入位址。
For example, FIG. 6 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (51, 33, 7) according to another embodiment of the present invention. 6, when the written data is received, the
為進一步減少寫入時間及功率,在一些實施例中,採用多個翻轉位元以分別指示對碼字的不同部分的位元翻轉,且在一些實施例中,所述翻轉位元還包含在碼字的不同部位中,這在本文並不受限。在一個實施例中,翻轉位元包括:第一翻轉位元,包含在碼字的多個偶數位元中的一者中以用於指示對偶數位元的位元翻轉;以及第二翻轉位元,包含在碼字的多個奇數位元中的一者中以用於指示對奇數位元的位元翻轉。 In order to further reduce the writing time and power, in some embodiments, multiple flip bits are used to indicate bit flips of different parts of the codeword, and in some embodiments, the flip bits are also included in In the different parts of the codeword, this is not limited in this article. In one embodiment, the flipping bit includes: a first flipping bit included in one of a plurality of even-numbered bits of the codeword for indicating bit flipping of even-numbered bits; and a second flipping bit , Included in one of the odd-numbered bits of the codeword to indicate bit flipping of the odd-numbered bits.
圖7是示出根據本發明實施例用於記憶體儲存裝置的編碼方法的流程圖。所述編碼方法可由圖1所示實施例的記憶體儲存裝置100執行。因此,在本實施例中,將通過參照前述記憶體儲存裝置100來說明所述編碼方法。
FIG. 7 is a flowchart showing an encoding method used in a memory storage device according to an embodiment of the present invention. The encoding method can be executed by the
參照圖7,記憶體控制電路130接收包含寫入位址及寫入資料的寫入命令(步驟S702)。回應於所接收的寫入命令,記憶體
控制電路130的ECC編碼器131預先讀取現有碼字(步驟S704)。在一個實施例中,現有碼字是預先儲存在寫入位址中的碼字,且在另一實施例中,現有碼字是具有預定義資料模式(例如,000000…、或者FFFFFF…)的碼字,這在本文並不受限。
Referring to FIG. 7, the
同時,ECC編碼器131基於ECC演算法將寫入資料編碼成新碼字而不翻轉新碼字的位元,並將新碼字載入到寫入緩衝器(步驟S706)。具體來說,在步驟S706中,ECC編碼器131可將兩個翻轉位元附加到寫入資料,基於ECC演算法來計算寫入資料及翻轉位元的奇偶校驗資料,將奇偶校驗資料、寫入資料及翻轉位元組合以產生新碼字,並將新碼字載入到寫入緩衝器。在此實施例中,所附加的翻轉位元包括用於指示對偶數位元的位元翻轉的第一翻轉位元、及用於指示對奇數位元的位元翻轉的第二翻轉位元。
At the same time, the
接著,ECC編碼器131並行或連續地執行步驟S708及S714。應注意,在本發明中,經編碼新碼字的一的補數也為碼字。
Then, the
在步驟S708中,ECC編碼器131將新碼字的偶數位元與現有碼字的偶數位元進行比較以確定從現有碼字的所有偶數位元成為新碼字的所有偶數位元需要改變的位元數目,並接著判斷所確定數目是否超過碼字位元的數目的四分之一(步驟S710)。如果是,則ECC編碼器131翻轉碼字的所有偶數位元,並將經翻轉偶數位元載入到寫入緩衝器中(步驟S712)。
In step S708, the
相似地,在步驟S714中,ECC編碼器131將新碼字的奇
數位元與現有碼字的奇數位元進行比較以確定從現有碼字的所有奇數位元成為新碼字的所有奇數位元需要改變的位元數目,並接著判斷所確定數目是否超過碼字位元的數目的四分之一(步驟S716)。如果是,則ECC編碼器131翻轉碼字的所有奇數位元並將經翻轉奇數位元載入到寫入緩衝器中(步驟S718)。
Similarly, in step S714, the
應注意,在步驟S710及S716中,如果判斷結果為否,則ECC編碼器131不對碼字執行位元翻轉(步驟S720),且因此,寫入緩衝器中不存在改變。應注意,在偶數位元及奇數位元中的每一部分中,如果將改變的位元數目與將不改變的位元數目相同,則ECC編碼器131不執行位元翻轉。
It should be noted that in steps S710 and S716, if the judgment result is no, the
最終,ECC編碼器131執行碼字寫入,以將寫入緩衝器中的碼字寫入到寫入位址(步驟S722)。
Finally, the
基於以上內容,由於通過選擇性地且分別地翻轉將寫入的碼字的偶數位元及奇數位元而減少從現有碼字成為新碼字改變的位元數目,因此寫入時間及功率可進一步減少且可靠性可進一步改善。 Based on the above content, since the number of bits changed from the existing codeword to the new codeword is reduced by selectively and separately inverting the even and odd bits of the codeword to be written, the writing time and power can be reduced. Further reduction and reliability can be further improved.
舉例來說,圖8是示出根據本發明另一實施例採用通過BCH(52,34,7)修改的ECC演算法的編碼方法的示意圖。參照圖8,當接收到寫入資料時,ECC編碼器131通過使用與圖3所示實施例中所述的ECC演算法相似的ECC演算法將寫入資料編碼成52位元新碼字NC3。應注意,在此實施例中,ECC編碼器131首先將兩個翻轉位元附加到寫入資料,並將資料位元及翻轉位元編
碼成52位元新碼字。在一些實施例中,所述兩個翻轉位元單獨地指示對碼字中所有偶數資料位元及所有奇數資料位元的位元翻轉。在一些實施例中,以第一值(即,邏輯1)來設定所附加的所述兩個翻轉位元,所述第一值指示未對碼字進行位元翻轉。當對碼字的偶數位元或奇數位元執行位元翻轉時,對應的翻轉位元也被翻轉成第二值(即,邏輯0),所述第二值指示對碼字進行了位元翻轉。
For example, FIG. 8 is a schematic diagram showing an encoding method using an ECC algorithm modified by BCH (52, 34, 7) according to another embodiment of the present invention. Referring to FIG. 8, when the written data is received, the
在一些實施例中,回應於接收到寫入命令,ECC編碼器131還讀出包括兩個翻轉位元的52位元現有碼字EC3。
In some embodiments, in response to receiving the write command, the
接著,ECC編碼器131將新碼字NC3的多個偶數位元NC3a與現有碼字EC3的多個偶數位元EC3a進行比較,以確定所有偶數位元中從現有碼字EC3成為新碼字NC3需要改變的位元數目。同時,ECC編碼器131還將新碼字NC3的多個奇數位元NC3b與現有碼字EC3的多個奇數位元EC3b進行比較,以確定所有奇數位元中從現有碼字EC3成為新碼字NC3需要改變的位元數目。此外,應注意,在本發明中,經編碼新碼字的任一部分(即,偶數位元或奇數位元)的一的補數也為碼字。
Then, the
最終,ECC編碼器131基於偶數位元中需要改變的所確定位元數目來翻轉新碼字NC3的偶數位元NC3a,基於奇數位元中需要改變的所確定位元數目來翻轉新碼字NC3的奇數位元NC3b,並將包括所述兩個翻轉位元的整個新碼字寫入到寫入位址。具體來說,ECC編碼器131判斷偶數位元中需要改變的所確
定位元數目是否超過碼字位元的數目的四分之一。如果是,則ECC編碼器131翻轉新碼字NC3的所有偶數位元NC3a並將包括翻轉位元的經翻轉新碼字NC3a’載入到寫入緩衝器。如果否,則ECC編碼器131不對新碼字NC3的偶數位元NC3a執行位元翻轉。相似地,ECC編碼器131判斷奇數位元中需要改變的所確定位元數目是否超過碼字位元的數目的四分之一。如果是,則ECC編碼器131翻轉新碼字NC3的所有奇數位元NC3b並將包括翻轉位元的經翻轉新碼字NC3b’載入到寫入緩衝器。如果否,則ECC編碼器131不對新碼字NC3的奇數位元NC3b執行位元翻轉。接著,將寫入緩衝器中包括所有偶數位元及所有奇數位元的整個碼字寫入到記憶體陣列150中。
Finally, the
在前述實施例中,基於本發明的編碼方法,從現有碼字成為經編碼碼字而改變的偶數位元及奇數位元被減至最少。然而,在一些實施例中,基於本發明中所提供的編碼方法,第一部分或第二部分中的奇偶校驗位元中改變的位元被減至最少,但本發明並非僅限於此。 In the foregoing embodiment, based on the encoding method of the present invention, the even-numbered bits and odd-numbered bits changed from the existing codeword to the encoded codeword are minimized. However, in some embodiments, based on the encoding method provided in the present invention, the changed bits in the parity bits in the first part or the second part are minimized, but the present invention is not limited to this.
綜上所述,在本發明中所提供的編碼方法及記憶體儲存裝置中,引入一種利用BCH ECC演算法來實作NVM翻轉位元寫入功能的ECC演算法,其中採用一個或多個翻轉位元來指示碼字位元的不同部分上的碼字位元翻轉。因此,寫入時的位元改變數目可減少,且寫入時間及功率可減少。此外,記憶體裝置的耐久性得以改善。 In summary, in the encoding method and memory storage device provided in the present invention, an ECC algorithm that uses the BCH ECC algorithm to implement the NVM flip bit write function is introduced, in which one or more flips are used. Bits to indicate the inversion of the codeword bits on different parts of the codeword bits. Therefore, the number of bit changes during writing can be reduced, and the writing time and power can be reduced. In addition, the durability of the memory device is improved.
雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the technical field can make slight changes and modifications without departing from the spirit and scope of the present invention. The scope of protection of the present invention shall be subject to those defined by the attached patent scope.
S202~S208‧‧‧步驟 S202~S208‧‧‧Step
Claims (12)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/034,365 | 2018-07-13 | ||
US16/034,365 US20190294497A1 (en) | 2018-03-22 | 2018-07-13 | Method of implementing error correction code used by memory storage apparatus and memory storage apparatus using the same |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202006735A TW202006735A (en) | 2020-02-01 |
TWI698881B true TWI698881B (en) | 2020-07-11 |
Family
ID=69210128
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW108124718A TWI698881B (en) | 2018-07-13 | 2019-07-12 | Encoding method and memory storage apparatus using the same |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110716824B (en) |
TW (1) | TWI698881B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20220148866A (en) * | 2020-03-03 | 2022-11-07 | 마이크론 테크놀로지, 인크 | Counter-Based Sense Amplifier Method for Memory Cells |
CN111679932B (en) * | 2020-06-01 | 2021-03-09 | 北京和德宇航技术有限公司 | Error code data generation method and device, computer equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7069494B2 (en) * | 2003-04-17 | 2006-06-27 | International Business Machines Corporation | Application of special ECC matrix for solving stuck bit faults in an ECC protected mechanism |
US20100174954A1 (en) * | 2008-12-31 | 2010-07-08 | Stmicroelectronics, Inc. | Non-polynomial processing unit for soft-decision error correction coding |
US8880983B2 (en) * | 2009-03-17 | 2014-11-04 | Broadcom Corporation | Communication device employing binary product coding with selective additional cyclic redundancy check (CRC) therein |
US9614547B2 (en) * | 2014-06-30 | 2017-04-04 | Sandisk Technologies Llc | Multi-stage decoder |
US20170199784A1 (en) * | 2015-07-12 | 2017-07-13 | Fangxiao FU | Method of data recovery when errors failing to be corrected through ecc occur to nand flash |
US20170286197A1 (en) * | 2016-04-01 | 2017-10-05 | Intel Corporation | Validation of memory on-die error correction code |
US9811418B2 (en) * | 2015-10-26 | 2017-11-07 | Sandisk Technologies Llc | Syndrome-based codeword decoding |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7904793B2 (en) * | 2007-03-29 | 2011-03-08 | Sandisk Corporation | Method for decoding data in non-volatile storage using reliability metrics based on multiple reads |
US20140344643A1 (en) * | 2013-05-14 | 2014-11-20 | John H. Hughes, Jr. | Hybrid memory protection method and apparatus |
US9384144B1 (en) * | 2014-03-25 | 2016-07-05 | SK Hynix Inc. | Error detection using a logical address key |
TWI543178B (en) * | 2014-06-10 | 2016-07-21 | 群聯電子股份有限公司 | Decoding method, memory storage device and memory controlling circuit unit |
US9785502B2 (en) * | 2015-10-27 | 2017-10-10 | Sandisk Technologies Llc | Pipelined decoder with syndrome feedback path |
US10198313B2 (en) * | 2016-03-11 | 2019-02-05 | Western Digital Technologies, Inc. | Redundancy of error correction encoded data in a storage system |
US10514980B2 (en) * | 2018-03-22 | 2019-12-24 | Winbond Electronics Corp. | Encoding method and memory storage apparatus using the same |
-
2019
- 2019-07-12 CN CN201910630198.4A patent/CN110716824B/en active Active
- 2019-07-12 TW TW108124718A patent/TWI698881B/en active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7069494B2 (en) * | 2003-04-17 | 2006-06-27 | International Business Machines Corporation | Application of special ECC matrix for solving stuck bit faults in an ECC protected mechanism |
TWI269155B (en) * | 2003-04-17 | 2006-12-21 | Ibm | Method and checker of checking for errors in an error correction code (ECC) protected mechanism and a computer system including the checker |
US20100174954A1 (en) * | 2008-12-31 | 2010-07-08 | Stmicroelectronics, Inc. | Non-polynomial processing unit for soft-decision error correction coding |
US8880983B2 (en) * | 2009-03-17 | 2014-11-04 | Broadcom Corporation | Communication device employing binary product coding with selective additional cyclic redundancy check (CRC) therein |
US9614547B2 (en) * | 2014-06-30 | 2017-04-04 | Sandisk Technologies Llc | Multi-stage decoder |
US20170199784A1 (en) * | 2015-07-12 | 2017-07-13 | Fangxiao FU | Method of data recovery when errors failing to be corrected through ecc occur to nand flash |
US9811418B2 (en) * | 2015-10-26 | 2017-11-07 | Sandisk Technologies Llc | Syndrome-based codeword decoding |
US20170286197A1 (en) * | 2016-04-01 | 2017-10-05 | Intel Corporation | Validation of memory on-die error correction code |
Also Published As
Publication number | Publication date |
---|---|
CN110716824B (en) | 2023-08-15 |
CN110716824A (en) | 2020-01-21 |
TW202006735A (en) | 2020-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8091010B2 (en) | Error correction circuit and method for reducing miscorrection probability and semiconductor memory device including the circuit | |
JP5017407B2 (en) | Semiconductor memory device | |
KR101645906B1 (en) | Stopping criteria for layered iterative error correction | |
US11003529B2 (en) | Encoding method and memory storage apparatus using the same | |
US8713407B2 (en) | Semiconductor memory system having ECC circuit and controlling method thereof | |
US9471421B2 (en) | Data accessing method, memory storage device and memory controlling circuit unit | |
US20090241008A1 (en) | Memory devices and encoding and/or decoding methods | |
JP6540703B2 (en) | Memory controller and control method of memory controller | |
US20180278273A1 (en) | Decoding device and decoding method | |
TWI691834B (en) | Memory storage apparatus adopting lien ecc scheme and encoding method thereof | |
CN102024501A (en) | Memory system and control method for the same | |
JP2008165805A (en) | Ecc (error correction code) controller for flash memory device and memory system including same | |
TW201722090A (en) | Turbo product codes for NAND flash | |
KR20180089104A (en) | Memory module, memory system including the same and error correcting method thereof | |
US10243588B2 (en) | Error correction code (ECC) decoders sharing logic operations, memory controllers including the error correction code decoders, and methods of decoding error correction codes | |
TWI698881B (en) | Encoding method and memory storage apparatus using the same | |
JP2019057752A (en) | Memory system | |
US10191801B2 (en) | Error correction code management of write-once memory codes | |
US9960788B2 (en) | Memory controller, semiconductor memory device, and control method for semiconductor memory device | |
TWI664637B (en) | Encoding method and a memory storage apparatus using the same | |
KR20190132238A (en) | Memory system and operation method of memory system | |
JP2012003569A (en) | Memory controller, flash memory system including memory controller, and method of controlling flash memory | |
US20190294497A1 (en) | Method of implementing error correction code used by memory storage apparatus and memory storage apparatus using the same | |
JPH1173797A (en) | Storage device | |
TWI701674B (en) | Memory apparatus and data reading method thereof |