TWI698881B - Encoding method and memory storage apparatus using the same - Google Patents

Encoding method and memory storage apparatus using the same Download PDF

Info

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
Application number
TW108124718A
Other languages
Chinese (zh)
Other versions
TW202006735A (en
Inventor
存德 連
明輝 謝
紀舜 林
雅廸 張
Original Assignee
華邦電子股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US16/034,365 external-priority patent/US20190294497A1/en
Application filed by 華邦電子股份有限公司 filed Critical 華邦電子股份有限公司
Publication of TW202006735A publication Critical patent/TW202006735A/en
Application granted granted Critical
Publication of TWI698881B publication Critical patent/TWI698881B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding 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/1048Adding 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
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/04Detection or location of defective memory elements, e.g. cell constructio details, timing of test signals
    • G11C29/08Functional testing, e.g. testing during refresh, power-on self testing [POST] or distributed testing
    • G11C29/12Built-in arrangements for testing, e.g. built-in self testing [BIST] or interconnection details
    • G11C29/38Response verification devices
    • G11C29/42Response verification devices using error correcting codes [ECC] or parity check

Abstract

An encoding method for a memory storage apparatus adopting an ECC algorithm is provided. The encoding method includes: receiving a write command comprising a write address and a write data; reading an existing codeword; attaching a flip bit to the write data; encoding the write data and the flip bit to generate parity bits based on the ECC algorithm by an ECC encoder and attaching the write data and the flip bit to the plurality of parity bits to generate a new codeword; flipping the new codeword based on a number of bits among selected bits required to be changed from the existing codeword to the new codeword; and writing one of the new codeword and the flipped new codeword to the write address. In addition, a memory storage apparatus using the encoding method is provided.

Description

編碼方法及使用所述編碼方法的記憶體儲存裝置Coding method and memory storage device using said coding method

本發明是有關於一種記憶體儲存裝置,且特別是有關於一種編碼方法及使用所述編碼方法的記憶體儲存裝置。 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 memory storage device 100 includes a connection interface 110, a memory control circuit 130 and a memory array 150. In one embodiment, the memory storage device 100 is a rewritable nonvolatile memory, and the memory array 150 includes a plurality of rewritable nonvolatile memory cells.

在一個實施例中,連接介面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 connection interface 110 is configured to be coupled to a host system (not shown in the figure) through the Serial Advanced Technology Attachment (SATA) standard. In other embodiments, the connection interface 110 may comply with the Parallel Advanced Technology Attachment (PATA) standard, the Institute of Electrical and Electronic Engineers (IEEE) 1394 standard, or other suitable This standard is not limited in the present invention. In one embodiment, the connection interface 110 and the memory control circuit unit 130 may be packaged in a chip or placed outside the chip with the memory control circuit unit 130.

記憶體控制電路130耦接到連接介面110及記憶體陣列150,且被配置成執行多個邏輯閘或控制命令,所述邏輯閘或控制命令是以硬體形式或以韌體形式來實作並根據主機系統的命令而在記憶體陣列150中執行例如資料寫入、讀取或抹除等操作。 The memory control circuit 130 is coupled to the connection interface 110 and the memory array 150, and is configured to execute a plurality of logic gates or control commands. The logic gates or control commands are implemented in hardware or firmware. Operations such as data writing, reading, or erasing are performed in the memory array 150 according to commands from the host system.

在一個實施例中,記憶體儲存裝置100是採用ECC演算法的可重複寫入NVM,其中記憶體控制電路130進一步包括ECC編碼器131,ECC編碼器131使用所述ECC演算法來對通過連接介面110接收的資料進行編碼以產生碼字並將所述碼字寫入到記憶體陣列150中。應注意,在本發明中,通過所述ECC演算法產生的碼字的一的補數(one's complement)仍為另一碼字。所述ECC演算法例如是通過連氏碼、博斯-喬杜裡-霍昆格姆(BCH)碼、漢明碼、具有額外奇偶校驗的漢明碼(SECDED)、裡德-索羅門碼、或蕭氏碼等修改的ECC,這在本文並不受限。 In one embodiment, the memory storage device 100 is a rewritable NVM using an ECC algorithm, wherein the memory control circuit 130 further includes an ECC encoder 131, and the ECC encoder 131 uses the ECC algorithm to connect The data received by the interface 110 is encoded to generate codewords and write the codewords into the memory array 150. It should be noted that in the present invention, the one's complement of the codeword generated by the ECC algorithm is still another codeword. The ECC algorithm is, for example, using Lian codes, Bose-Chowdhury-Hokkungum (BCH) codes, Hamming codes, Hamming codes with additional parity (SECDED), Reed-Solomon codes, Or modified ECC such as Xiao's code, which is not limited in this article.

記憶體陣列150耦接到記憶體控制電路130,且包括多個記憶體胞元(例如,可重複寫入非易失性記憶體胞元)。在一個實施例中,主機系統向記憶體儲存裝置100傳送要將資料寫入到記憶體儲存裝置100的寫入命令,且接著,記憶體控制電路130回應於所述寫入命令而將寫入資料編碼成碼字並將所述碼字儲存在記憶體陣列150中。 The memory array 150 is coupled to the memory control circuit 130 and includes a plurality of memory cells (for example, rewriteable non-volatile memory cells). In one embodiment, the host system transmits a write command to the memory storage device 100 to write data to the memory storage device 100, and then, the memory control circuit 130 writes in response to the write command. The data is encoded into code words and the code words are stored in the memory array 150.

圖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 memory storage device 100 of the embodiment shown in FIG. 1. Therefore, in this embodiment, the encoding method will be explained by referring to the aforementioned memory storage device 100.

參照圖2,記憶體控制電路130通過連接介面110接收包含寫入位址及寫入資料的寫入命令(步驟S202)。回應於所接收的寫入命令,記憶體控制電路130的ECC編碼器131預先讀取現有碼字(步驟S204)。在一個實施例中,現有碼字是預先儲存在寫入位址中的碼字,且在另一實施例中,現有碼字是具有預定義資料模式(例如,000000…、或者FFFFFF…)的碼字,這在本文並不受限。 2, the memory control circuit 130 receives a write command including a write address and write data through the connection interface 110 (step S202). In response to the received write command, the ECC encoder 131 of the memory control circuit 130 reads the existing codeword in advance (step S204). In one embodiment, the existing codeword is a codeword pre-stored in the write address, and in another embodiment, the existing codeword has a predefined data pattern (for example, 000000... or FFFFFF...) Codewords, this is not limited in this article.

同時,ECC編碼器131基於以上所述的ECC演算法將寫入資料編碼成新碼字,並基於從現有碼字成為新碼字需要改變的位元數目來翻轉所述新碼字的多個位元(步驟S206)。具體來說,在步驟S206中,ECC編碼器131可將翻轉位元附加到寫入資料,基於ECC演算法來計算寫入資料及翻轉位元的奇偶校驗資料,並將奇偶校驗資料、寫入資料及翻轉位元組合以產生新碼字。接著,ECC編碼器131將新碼字的多個所選位元與現有碼字的多個所選位元進行比較以確定從現有碼字成為新碼字需要改變的位元數目,並判斷需要改變的所確定位元數目是否超過預定閾值。應注意,在本發明中,經編碼新碼字的一的補數也為碼字。 At the same time, the ECC encoder 131 encodes the written data into a new codeword based on the above-mentioned ECC algorithm, and flips the multiple of the new codeword based on the number of bits that need to be changed from the existing codeword to the new codeword. Bit (step S206). Specifically, in step S206, the ECC encoder 131 may add the flipped bit to the written data, calculate the written data and the parity data of the flipped bit based on the ECC algorithm, and combine the parity data, Write data and flip the bit combination to generate a new codeword. Next, the ECC encoder 131 compares the multiple selected bits of the new codeword with multiple selected bits of the existing codeword to determine the number of bits that need to be changed from the existing codeword to the new codeword, and determines the number of bits that need to be changed. Whether the determined number of bits exceeds a predetermined threshold. It should be noted that in the present invention, the one's complement of the encoded new codeword is also a codeword.

在一些實施例中,所述預定閾值是資料位元及奇偶校驗 位元的總數目的一半,這在本文並不受限。 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 encoder 131 flips the bits of the new codeword including data bits, parity bits, and flipped bits. On the other hand, if the determined number of bits is determined to be lower than the predetermined threshold, the ECC encoder 131 does not perform bit flipping on the bits of the new codeword. It should be noted that if the predetermined threshold is equal to half the number of codeword bits and the determined number of bits is determined to be equal to the predetermined threshold, that is, the number of bits to be changed is the same as the number of bits to be unchanged, then the ECC The encoder 131 also does not perform bit flipping on the bits of the encoded new codeword.

最終,ECC編碼器131將新碼字及經翻轉新碼字中的一者寫入到寫入位址(步驟S208)。 Finally, the ECC encoder 131 writes one of the new codeword and the inverted new codeword to the write address (step S208).

基於以上內容,由於通過選擇性地翻轉將寫入的碼字的位元而將從現有碼字成為新碼字而改變的位元數目減少至小於碼字位元數目的一半,因此寫入時間及功率可減少,且可靠性及耐久性可改善。 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 ECC encoder 131 encodes 33-bit data OD including 32-bit write data m1 to m32 and a flip bit f1 into 51 The bit code word CW, and the matrix Mp is the 18*33 matrix used when calculating the 18-bit parity data PD of the 33-bit data OD. Specifically, when the memory storage device 100 receives 32-bit write data At this time, the ECC encoder 131 first adds the flip bit f1 to the 32-bit write data. Then, the 33-bit data OD including the 32-bit write data and the flip bit f1 can be written into the single-row vector. Next, the 33-bit data OD is multiplied by the matrix Mp to obtain a single-row vector having 18 elements p1 to p18, each of the 18 elements p1 to p18 representing one bit of the 18-bit parity data PD. Then, the ECC encoder 131 appends the 33-bit data OD to the 18-bit parity data PD to generate a 51-bit new codeword CW.

在一些實施例中,翻轉位元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 ECC encoder 131 generates a new code word including flipped bits from the written data. It should be noted that in one embodiment, the number of bits changed from the existing codeword read from the self-write address becomes the new codeword is minimized, and in another embodiment, from the The number of bits changed when an existing codeword becomes a new codeword is minimized. Exemplary embodiments are given below for further description.

圖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 ECC encoder 131 encodes the written data into a 51-bit new code word NC1 by using the ECC algorithm described in the embodiment shown in FIG. 3. ECC code The device 131 also reads the 51-bit existing codeword EC1 from the write address. Then, the ECC encoder 131 compares the multiple bits of the new codeword NC1 with the multiple bits of the existing codeword EC1 to determine the number of bits that need to be changed from the existing codeword EC1 to the new codeword NC1. Finally, the ECC encoder 131 flips the bits of the new codeword NC1 including the written data, parity bits, and flipped bits based on the determined number, and converts the new codeword NC1 and the flipped new codeword NC1' One of them is written to the write address. Specifically, the ECC encoder 131 determines whether the determined number exceeds half of the number of codeword bits. If so, the ECC encoder 131 flips all the bits of the new code word NC1 and writes the flipped new code word NC1' including the flipped bits to the write address. If the judgment result is no, the ECC encoder 131 does not perform bit inversion on the new code word NC1, and writes the new code word NC1 to the write address.

另一方面,圖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 encoder 131 encodes the written data into a 51-bit new code word NC2 by using the ECC algorithm described in the embodiment shown in FIG. 3. The ECC encoder 131 also reads the 51-bit existing codeword EC2 with a predefined data pattern (such as 000000...). Then, the ECC encoder 131 compares the multiple bits of the new codeword NC2 with the multiple bits of the existing codeword EC2 to determine the number of bits that need to be changed from the existing codeword EC2 to the new codeword NC2. Finally, the ECC encoder 131 flips the bits of the new codeword NC2 including the written data, parity bits, and flipped bits based on the determined number, and converts the new codeword NC2 and the flipped new codeword NC2' One of them is written to the write address. Specifically, the ECC encoder 131 determines Whether the number exceeds half of the number of codeword bits. If so, the ECC encoder 131 flips all the bits of the new code word NC2 and writes the flipped new code word NC2' including the flipped bits to the write address. If the judgment result is negative, the ECC encoder 131 does not perform bit inversion on the new code word NC2, and writes the new code word NC2 to the write address.

應注意,由於通過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 ECC encoder 131 encodes the written data into a 51-bit new code word NC4 by using the ECC algorithm described in the embodiment shown in FIG. 3. The ECC encoder 131 also reads the 51-bit existing code word EC4 from the write address. Next, the ECC encoder 131 converts the multiple parity bits p1 of the new code word NC4 to p18 is compared with the multiple parity bits p1 to p18 of the existing codeword EC4 to determine the number of parity bits that need to be changed from the existing codeword EC4 to the new codeword NC4. Finally, the ECC encoder 131 flips the bits of the new codeword NC4 based on the determined number, and writes one of the new codeword NC4 and the flipped new codeword NC4' to the write address. Specifically, the ECC encoder 131 determines whether the determined number exceeds half of the number of parity bits. If it is, the ECC encoder 131 flips all the bits of the new code word NC4 and writes the flipped new code word NC4' including the flipped bits to the write address. If the judgment result is negative, the ECC encoder 131 does not perform bit inversion on the new code word NC4, and writes the new code word NC4 to the write address.

為進一步減少寫入時間及功率,在一些實施例中,採用多個翻轉位元以分別指示對碼字的不同部分的位元翻轉,且在一些實施例中,所述翻轉位元還包含在碼字的不同部位中,這在本文並不受限。在一個實施例中,翻轉位元包括:第一翻轉位元,包含在碼字的多個偶數位元中的一者中以用於指示對偶數位元的位元翻轉;以及第二翻轉位元,包含在碼字的多個奇數位元中的一者中以用於指示對奇數位元的位元翻轉。 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 memory storage device 100 of the embodiment shown in FIG. 1. Therefore, in this embodiment, the encoding method will be explained by referring to the aforementioned memory storage device 100.

參照圖7,記憶體控制電路130接收包含寫入位址及寫入資料的寫入命令(步驟S702)。回應於所接收的寫入命令,記憶體 控制電路130的ECC編碼器131預先讀取現有碼字(步驟S704)。在一個實施例中,現有碼字是預先儲存在寫入位址中的碼字,且在另一實施例中,現有碼字是具有預定義資料模式(例如,000000…、或者FFFFFF…)的碼字,這在本文並不受限。 Referring to FIG. 7, the memory control circuit 130 receives a write command including a write address and write data (step S702). In response to the received write command, the memory The ECC encoder 131 of the control circuit 130 reads the existing codeword in advance (step S704). In one embodiment, the existing codeword is a codeword pre-stored in the write address, and in another embodiment, the existing codeword has a predefined data pattern (for example, 000000... or FFFFFF...) Codewords, this is not limited in this article.

同時,ECC編碼器131基於ECC演算法將寫入資料編碼成新碼字而不翻轉新碼字的位元,並將新碼字載入到寫入緩衝器(步驟S706)。具體來說,在步驟S706中,ECC編碼器131可將兩個翻轉位元附加到寫入資料,基於ECC演算法來計算寫入資料及翻轉位元的奇偶校驗資料,將奇偶校驗資料、寫入資料及翻轉位元組合以產生新碼字,並將新碼字載入到寫入緩衝器。在此實施例中,所附加的翻轉位元包括用於指示對偶數位元的位元翻轉的第一翻轉位元、及用於指示對奇數位元的位元翻轉的第二翻轉位元。 At the same time, the ECC encoder 131 encodes the written data into a new codeword based on the ECC algorithm without flipping the bits of the new codeword, and loads the new codeword into the write buffer (step S706). Specifically, in step S706, the ECC encoder 131 may add two flipped bits to the written data, calculate the written data and the parity data of the flipped bits based on the ECC algorithm, and convert the parity data , Write data and flip the bit combination to generate a new codeword, and load the new codeword into the write buffer. In this embodiment, the additional flipping bit includes a first flipping bit for indicating bit flipping for even-numbered bits, and a second flipping bit for indicating bit flipping for odd-numbered bits.

接著,ECC編碼器131並行或連續地執行步驟S708及S714。應注意,在本發明中,經編碼新碼字的一的補數也為碼字。 Then, the ECC encoder 131 executes steps S708 and S714 in parallel or continuously. It should be noted that in the present invention, the one's complement of the encoded new codeword is also a codeword.

在步驟S708中,ECC編碼器131將新碼字的偶數位元與現有碼字的偶數位元進行比較以確定從現有碼字的所有偶數位元成為新碼字的所有偶數位元需要改變的位元數目,並接著判斷所確定數目是否超過碼字位元的數目的四分之一(步驟S710)。如果是,則ECC編碼器131翻轉碼字的所有偶數位元,並將經翻轉偶數位元載入到寫入緩衝器中(步驟S712)。 In step S708, the ECC encoder 131 compares the even-numbered bits of the new codeword with the even-numbered bits of the existing codeword to determine what needs to be changed from all even-numbered bits of the existing codeword to all even-numbered bits of the new codeword. The number of bits, and then it is judged whether the determined number exceeds a quarter of the number of codeword bits (step S710). If so, the ECC encoder 131 flips all the even-numbered bits of the codeword, and loads the flipped even-numbered bits into the write buffer (step S712).

相似地,在步驟S714中,ECC編碼器131將新碼字的奇 數位元與現有碼字的奇數位元進行比較以確定從現有碼字的所有奇數位元成為新碼字的所有奇數位元需要改變的位元數目,並接著判斷所確定數目是否超過碼字位元的數目的四分之一(步驟S716)。如果是,則ECC編碼器131翻轉碼字的所有奇數位元並將經翻轉奇數位元載入到寫入緩衝器中(步驟S718)。 Similarly, in step S714, the ECC encoder 131 converts the odd value of the new codeword The digital bits are compared with the odd bits of the existing codeword to determine the number of bits that need to be changed from all the odd bits of the existing codeword to all the odd bits of the new codeword, and then determine whether the determined number exceeds the codeword bits One quarter of the number of yuan (step S716). If so, the ECC encoder 131 flips all the odd-numbered bits of the codeword and loads the flipped odd-numbered bits into the write buffer (step S718).

應注意,在步驟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 encoder 131 does not perform bit flipping on the codeword (step S720), and therefore, there is no change in the write buffer. It should be noted that in each of the even-numbered bits and the odd-numbered bits, if the number of bits to be changed is the same as the number of bits to be unchanged, the ECC encoder 131 does not perform bit flipping.

最終,ECC編碼器131執行碼字寫入,以將寫入緩衝器中的碼字寫入到寫入位址(步驟S722)。 Finally, the ECC encoder 131 executes codeword writing to write the codeword written in the buffer to the write address (step S722).

基於以上內容,由於通過選擇性地且分別地翻轉將寫入的碼字的偶數位元及奇數位元而減少從現有碼字成為新碼字改變的位元數目,因此寫入時間及功率可進一步減少且可靠性可進一步改善。 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 encoder 131 encodes the written data into a new 52-bit code word NC3 by using an ECC algorithm similar to the ECC algorithm described in the embodiment shown in FIG. 3 . It should be noted that in this embodiment, the ECC encoder 131 first appends two flip bits to the written data, and encodes the data bits and flip bits. Code into a new 52-bit codeword. In some embodiments, the two inversion bits separately indicate bit inversion for all even data bits and all odd data bits in the codeword. In some embodiments, the two additional flipping bits are set with a first value (ie, logic 1), and the first value indicates that bit flipping is not performed on the codeword. When bit flipping is performed on the even-numbered or odd-numbered bits of the codeword, the corresponding flipped bit is also flipped to a second value (ie, logic 0), and the second value indicates that bit-biting is performed on the codeword Flip.

在一些實施例中,回應於接收到寫入命令,ECC編碼器131還讀出包括兩個翻轉位元的52位元現有碼字EC3。 In some embodiments, in response to receiving the write command, the ECC encoder 131 also reads the existing 52-bit codeword EC3 including two flipped bits.

接著,ECC編碼器131將新碼字NC3的多個偶數位元NC3a與現有碼字EC3的多個偶數位元EC3a進行比較,以確定所有偶數位元中從現有碼字EC3成為新碼字NC3需要改變的位元數目。同時,ECC編碼器131還將新碼字NC3的多個奇數位元NC3b與現有碼字EC3的多個奇數位元EC3b進行比較,以確定所有奇數位元中從現有碼字EC3成為新碼字NC3需要改變的位元數目。此外,應注意,在本發明中,經編碼新碼字的任一部分(即,偶數位元或奇數位元)的一的補數也為碼字。 Then, the ECC encoder 131 compares the even-numbered bits NC3a of the new codeword NC3 with the even-numbered bits EC3a of the existing codeword EC3 to determine that all even-numbered bits change from the existing codeword EC3 to the new codeword NC3 The number of bits that need to be changed. At the same time, the ECC encoder 131 also compares the odd numbered bits NC3b of the new codeword NC3 with the odd numbered bits EC3b of the existing codeword EC3 to determine that all the odd numbered bits change from the existing codeword EC3 to the new codeword. The number of bits that NC3 needs to change. In addition, it should be noted that in the present invention, the one's complement of any part of the encoded new codeword (ie, even-numbered bits or odd-numbered bits) is also a codeword.

最終,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 ECC encoder 131 flips the even bits NC3a of the new codeword NC3 based on the determined number of bits that need to be changed in the even bits, and flips the new codeword NC3 based on the determined number of bits that need to be changed in the odd bits. NC3b, and write the entire new codeword including the two flipped bits to the write address. Specifically, the ECC encoder 131 determines which of the even-numbered bits needs to be changed. Whether the number of location elements exceeds a quarter of the number of codeword bits. If so, the ECC encoder 131 flips all even-numbered bits NC3a of the new codeword NC3 and loads the flipped new codeword NC3a' including the flipped bits into the write buffer. If not, the ECC encoder 131 does not perform bit inversion on the even-numbered bits NC3a of the new code word NC3. Similarly, the ECC encoder 131 determines whether the determined number of bits that need to be changed in the odd-numbered bits exceeds one quarter of the number of codeword bits. If so, the ECC encoder 131 flips all odd bits NC3b of the new codeword NC3 and loads the flipped new codeword NC3b' including the flipped bits into the write buffer. If not, the ECC encoder 131 does not perform bit flipping on the odd bits NC3b of the new codeword NC3. Then, the entire code word including all the even-numbered bits and all the odd-numbered bits in the write buffer is written into the memory array 150.

在前述實施例中,基於本發明的編碼方法,從現有碼字成為經編碼碼字而改變的偶數位元及奇數位元被減至最少。然而,在一些實施例中,基於本發明中所提供的編碼方法,第一部分或第二部分中的奇偶校驗位元中改變的位元被減至最少,但本發明並非僅限於此。 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)

一種用於採用錯誤校正碼演算法的記憶體儲存裝置的編碼方法,包括:接收包含寫入地址及寫入資料的寫入命令;讀取現有碼字;將翻轉位元附加到所述寫入資料;由錯誤校正碼編碼器基於所述錯誤校正碼演算法對所述寫入資料及所述翻轉位元進行編碼以產生多個奇偶校驗位元,並將所述寫入資料及所述翻轉位元附加到所述多個奇偶校驗位元以產生新碼字;基於所選位元中從所述現有碼字成為所述新碼字需要改變的位元數目來翻轉所述新碼字;以及將所述新碼字及經翻轉的所述新碼字中的一者寫入到所述寫入地址。 An encoding method for a memory storage device using an error correction code algorithm includes: receiving a write command including a write address and write data; reading an existing codeword; and attaching a flip bit to the write Data; an error correction code encoder based on the error correction code algorithm encodes the written data and the flip bit to generate a plurality of parity bits, and the write data and the A flip bit is appended to the plurality of parity bits to generate a new codeword; the new code is flipped based on the number of bits that need to be changed from the existing codeword to the new codeword in the selected bits Word; and writing one of the new codeword and the flipped new codeword to the write address. 如申請專利範圍第1項所述的編碼方法,其中如果將改變的所述位元數目與將不改變的位元數目相同,則不執行位元翻轉。 The encoding method as described in item 1 of the scope of patent application, wherein if the number of bits to be changed is the same as the number of bits to be unchanged, bit flipping is not performed. 如申請專利範圍第1項所述的編碼方法,其中所述現有碼字及所述新碼字中的任一碼字的一的補數也為碼字。 The coding method as described in item 1 of the scope of patent application, wherein the one's complement of any one of the existing codeword and the new codeword is also a codeword. 如申請專利範圍第1項所述的編碼方法,其中所述現有碼字及所述新碼字中的每一碼字包括第一翻轉位元且更包括第二 翻轉位元,所述第一翻轉位元包含在所述碼字的第一部分中,所述第二翻轉位元包含在所述碼字的第二部分中。 The encoding method according to the first item of the scope of patent application, wherein each of the existing codeword and the new codeword includes a first inversion bit and further includes a second A flipped bit, the first flipped bit is included in a first part of the codeword, and the second flipped bit is included in a second part of the codeword. 如申請專利範圍第4項所述的編碼方法,其中所述新碼字及所述現有碼字中的任一碼字的所述第一部分或所述第二部分的一的補數也為碼字。 The coding method according to item 4 of the scope of patent application, wherein the one's complement of the first part or the second part of any one of the new codeword and the existing codeword is also a code word. 如申請專利範圍第4項所述的編碼方法,其中在所述第一部分及所述第二部分中的每一部分中,如果將改變的所述位元數目與將不改變的位元數目相同,則不執行位元翻轉。 The encoding method as described in item 4 of the scope of patent application, wherein in each of the first part and the second part, if the number of bits to be changed is the same as the number of bits to be unchanged, No bit flip is performed. 如申請專利範圍第1項所述的編碼方法,其中所述所選位元是所述奇偶校驗位元或所述奇偶校驗位元及資料位元。 The encoding method according to the first item of the scope of patent application, wherein the selected bit is the parity bit or the parity bit and the data bit. 一種採用錯誤校正碼演算法的記憶體儲存裝置,包括:連接介面,被配置成耦接到主機系統;記憶體陣列;以及記憶體控制電路,耦接到所述連接介面及所述記憶體陣列,且被配置成響應於接收到包含寫入地址及寫入資料的寫入命令而基於所述錯誤校正碼演算法來執行編碼操作,其中所述編碼操作包括:讀取現有碼字;將翻轉位元附加到所述寫入資料;由錯誤校正碼編碼器基於所述錯誤校正碼演算法來對所述寫入資料及所述翻轉位元進行編碼以產生多個奇偶校驗位元,並將所述 寫入資料及所述翻轉位元附加到所述多個奇偶校驗位元以產生新碼字;基於所選位元中從所述現有碼字成為所述新碼字需要改變的位元數目來翻轉所述新碼字;以及將所述新碼字及經翻轉的所述新碼字中的一者寫入到所述寫入地址。 A memory storage device using an error correction code algorithm includes: a connection interface configured to be coupled to a host system; a memory array; and a memory control circuit coupled to the connection interface and the memory array , And is configured to perform an encoding operation based on the error correction code algorithm in response to receiving a write command including a write address and write data, wherein the encoding operation includes: reading an existing codeword; Bits are appended to the written data; an error correction code encoder based on the error correction code algorithm encodes the written data and the flip bit to generate a plurality of parity bits, and Will be said The written data and the flip bit are appended to the plurality of parity bits to generate a new codeword; based on the number of bits that need to be changed from the existing codeword to the new codeword in the selected bits To flip the new codeword; and write one of the new codeword and the flipped new codeword to the write address. 如申請專利範圍第8項所述的記憶體儲存裝置,其中所述記憶體控制電路被配置成:如果將改變的所述位元數目與將不改變的位元數目相同,則不執行位元翻轉。 The memory storage device according to item 8 of the scope of patent application, wherein the memory control circuit is configured to: if the number of bits to be changed is the same as the number of bits to be unchanged, no bit is executed Flip. 如申請專利範圍第8項所述的記憶體儲存裝置,其中所述現有碼字及所述新碼字中的每一碼字包括第一翻轉位元且更包括第二翻轉位元,所述第一翻轉位元包含在所述碼字的第一部分中,所述第二翻轉位元包含在所述碼字的第二部分中。 The memory storage device according to claim 8, wherein each of the existing codeword and the new codeword includes a first flip bit and further includes a second flip bit, the The first flip bit is included in the first part of the codeword, and the second flip bit is included in the second part of the codeword. 如申請專利範圍第10項所述的記憶體儲存裝置,其中在所述第一部分及所述第二部分中的每一部分中,所述記憶體控制電路被配置成:如果將改變的所述位元數目與將不改變的位元數目相同,則不執行位元翻轉。 The memory storage device according to claim 10, wherein in each of the first part and the second part, the memory control circuit is configured to: if the bit is changed If the number of bits is the same as the number of bits that will not be changed, no bit flipping is performed. 如申請專利範圍第8項所述的記憶體儲存裝置,其中所述所選位元是所述奇偶校驗位元或所述奇偶校驗位元及資料位元。 The memory storage device according to claim 8, wherein the selected bit is the parity bit or the parity bit and data bit.
TW108124718A 2018-07-13 2019-07-12 Encoding method and memory storage apparatus using the same TWI698881B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
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