TWI718060B - Memory controller and method of accessing flash memory - Google Patents

Memory controller and method of accessing flash memory Download PDF

Info

Publication number
TWI718060B
TWI718060B TW109116126A TW109116126A TWI718060B TW I718060 B TWI718060 B TW I718060B TW 109116126 A TW109116126 A TW 109116126A TW 109116126 A TW109116126 A TW 109116126A TW I718060 B TWI718060 B TW I718060B
Authority
TW
Taiwan
Prior art keywords
codeword
flip
flipping
strategy
iteration
Prior art date
Application number
TW109116126A
Other languages
Chinese (zh)
Other versions
TW202123241A (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
Application filed by 慧榮科技股份有限公司 filed Critical 慧榮科技股份有限公司
Priority to TW109116126A priority Critical patent/TWI718060B/en
Application granted granted Critical
Publication of TWI718060B publication Critical patent/TWI718060B/en
Publication of TW202123241A publication Critical patent/TW202123241A/en

Links

Images

Abstract

A method of accessing a flash memory, for use in a memory controller of a data storage device, is provided. The method includes the steps of: storing data to a flash memory of the data storage device via a storage procedure; obtaining a channel value read from a flash memory of the data storage device; obtaining a codeword difference and calculating a syndrome according to the codeword difference; and in each LDPC decoding iteration, performing the following steps: determining a syndrome weight according to the channel value and the syndrome; obtaining a previous codeword generated by a previous LDPC decoding iteration; obtaining a first flipping-strategy lookup table from a plurality of flipping-strategy lookup tables according to a decoding target of the memory controller; determining a flipping strategy in the bit-flipping algorithm for each codeword bit in the previous codeword according to the syndrome weight, a predetermined threshold, and the first flip-strategy lookup table and flipping one or more codeword bits in the previous codeword according to the determined flipping strategy for each codeword bit to generate an updated codeword; and subtracting the previous codeword from the updated codeword to generate the codeword difference.

Description

記憶體控制器及快閃記憶體的存取方法Memory controller and flash memory access method

本發明係有關於資料存取,特別是有關於一種記憶體控制器及快閃記憶體的存取方法。The present invention relates to data access, and particularly relates to a memory controller and flash memory access method.

隨著半導體技術的進步,低密度同位元檢查(low-density parity check,LDPC)碼在近年來已可用超大型積體(very-large-scale integration,VLSI)電路所實現,且廣泛應用於數位通訊領域(例如包括無線通訊及光纖通訊)以及資料傳輸領域(例如用於資料儲存裝置,如固態硬碟)以做為錯誤更正碼(error correction code,ECC)。With the advancement of semiconductor technology, low-density parity check (LDPC) codes have been implemented with very-large-scale integration (VLSI) circuits in recent years and are widely used in digital The field of communication (for example, including wireless communication and optical fiber communication) and the field of data transmission (for example, for data storage devices, such as solid state drives) are used as error correction codes (ECC).

低密度同位元檢查解碼器係使用具有同位元(parity bit)的線性錯誤校正碼來進行解碼,其中同位元會提供用以驗證接收到的碼字(codeword)的同位元方程式給LDPC解碼器。舉例來說,低密度同位元查核碼可為一具有固定長度的二進位碼,其中所有的符元(symbol)相加會等於零。The low-density parity checking decoder uses a linear error correction code with parity bits for decoding, where the parity bit provides a parity equation for verifying the received codeword to the LDPC decoder. For example, the low-density parity check code can be a binary code with a fixed length, in which all symbols add up to zero.

在資料的編碼過程中,所有的資料位元會被重複執行並且被傳送至對應的編碼器,其中每個編碼器會產生一同位符元(parity symbol)。碼字係由k個訊息位元(information digit)以及r個檢查位元(check digit)所組成。若碼字總共有n位元,則表示k=n-r。上述碼字可用一同位元檢查矩陣來表示,其中該同位元檢查矩陣具有r列(表示方程式的數量)以及n行(表示位元數),如第1圖所示。這些碼之所以被稱為「低密度」是因為相較於同位元檢查矩陣中位元0的數量而言,位元1的數量相對的少。在解碼過程中,每次的同位元檢查皆可視為一同位元查核碼,並隨後與其他同位元查核碼一起進行交互檢查(cross-check),其中解碼會在檢查節點(check node)進行,而交互檢查會在變數節點(variable node)進行。In the process of data encoding, all data bits are repeatedly executed and sent to the corresponding encoder, where each encoder generates a parity symbol. The codeword is composed of k information digits and r check digits. If the code word has n bits in total, it means k=n-r. The above codeword can be represented by a parity check matrix, where the parity check matrix has r columns (representing the number of equations) and n rows (representing the number of bits), as shown in FIG. 1. These codes are called "low density" because the number of bit 1 is relatively small compared to the number of bit 0 in the parity check matrix. During the decoding process, each parity check can be regarded as a parity check code, and then cross-check with other parity check codes. The decoding will be performed at the check node. The interactive inspection will be carried out at the variable node.

低密度同位元檢查解碼器支持三種模式:硬判定硬解碼(hard decision hard decoding)、軟判定硬解碼(soft decision soft decoding),以及軟判定軟解碼(soft decision hard decoding)。第1A圖係為同位元檢查矩陣H的示意圖。第1B圖係為坦納圖(Tanner Graph)的示意圖。如第1A圖所示,在同位元檢查矩陣H的每一列可形成一檢查節點,例如分別為檢查節點C1、C2、C3及C4。在同位元檢查矩陣H的每一行可形成一變數節點,例如分別為變數節點V1、V2、V3、V4、V5、V6及V7。The low-density parity check decoder supports three modes: hard decision hard decoding, soft decision soft decoding, and soft decision hard decoding. Figure 1A is a schematic diagram of the parity check matrix H. Figure 1B is a schematic diagram of the Tanner Graph. As shown in FIG. 1A, each column of the parity check matrix H can form a check node, for example, check nodes C1, C2, C3, and C4, respectively. Each row of the parity check matrix H can form a variable node, such as variable nodes V1, V2, V3, V4, V5, V6, and V7.

坦納圖為另一種表示碼字的方式,並且可用於解釋當使用一位元翻轉(bit flipping)演算法時,低密度同位元檢查解碼器的一些關於硬判定軟解碼的操作。The Tanner diagram is another way of representing codewords, and it can be used to explain some of the hard decision soft decoding operations of the low-density parity check decoder when a bit flipping algorithm is used.

如第1B圖所示,在坦納圖中,方形節點C1~C4所表示的檢查節點代表同位元(parity bit)的數量,且圓形節點V1~V7所表示的變數節點(variable node)係為一碼字中位元的數量。如果一特定方程式與碼符元(code symbol)有關,則對應的檢查節點與變數節點之間會以連線來表示。被估測的資訊會沿著這些連線來傳遞,並且於節點上以不同的方式組合。As shown in Figure 1B, in the Tanner diagram, the check nodes represented by square nodes C1~C4 represent the number of parity bits, and the variable nodes represented by circular nodes V1~V7 are Is the number of bits in a codeword. If a specific equation is related to a code symbol, the corresponding check node and variable node will be represented by a line. The estimated information will be passed along these connections and combined in different ways on the nodes.

當開始進行LDPC解碼時,變數節點將發送一估測資訊(estimate)至所有連線上的檢查節點,其中這些連線包含被認為是正確的位元。接著,每個檢查節點會依據對所有其他的連接的估測(connected estimate)來針對每一變數節點進行新的估測,並且將新的估測資訊傳回至變數節點。新的估測係基於:同位元檢查方程式迫使所有的變數節點連接至一特定檢查節點,以使總和為零。When the LDPC decoding is started, the variable node will send an estimate to the check nodes on all connections, where these connections contain bits that are considered correct. Then, each check node will perform a new estimate for each variable node based on the connected estimate of all other connections, and send the new estimate information back to the variable node. The new estimation system is based on: the parity check equation forces all variable nodes to be connected to a specific check node so that the sum is zero.

這些變數節點會接收新的估測資訊以及使用一多數規則(majority rule)(亦即硬判定),來判斷所傳送的原始位元之數值是否正確。若判斷原始位元之數值不正確,該原始位元會被翻轉(flipped)。該翻轉後的位元接著會被傳回至該些檢查節點,且上述步驟會被疊代地執行一預定次數,直到符合這些檢查節點的同位元檢查方程式。若有符合這些同位元檢查方程式(亦即檢查節點所計算之數值符合接收自變數節點之數值),則可啟用提前終止(early termination),這會使得系統在最大疊代次數達到之前就結束解碼程序。These variable nodes will receive new estimation information and use a majority rule (ie, hard decision) to determine whether the value of the original bit transmitted is correct. If it is judged that the value of the original bit is incorrect, the original bit will be flipped. The flipped bits are then transmitted back to the check nodes, and the above steps are performed iteratively for a predetermined number of times until the parity check equations of these check nodes are met. If these parity check equations are met (that is, the value calculated by the check node matches the value received from the variable node), early termination can be enabled, which will cause the system to end the decoding process before the maximum number of iterations is reached .

該些同位元檢查限制係由進行一徵狀檢查(syndrome check)來實施。一個有效的碼字將會符合方程式:H.C T=S=0,其中H係為同位元檢查矩陣、C係為硬判定碼字(hard decision codeword),且S係為徵狀(syndrome)。當S等於零時,表示解碼程序已完成,且不需要更進一步的資訊。一般來說,硬判定以及徵狀檢查會在疊代期間執行,其中一非零(non-zero)徵狀表示有奇性(odd parity)存在,並且需要再執行新的解碼疊代。 These parity check restrictions are implemented by performing a syndrome check. A valid codeword will conform to the equation: H. C T =S=0, where H is a parity check matrix, C is a hard decision codeword, and S is a syndrome. When S is equal to zero, it means that the decoding process has been completed and no further information is needed. Generally speaking, the hard decision and symptom check will be performed during the iteration, where a non-zero symptom indicates the existence of odd parity, and a new decoding iteration is required.

傳統的位元翻轉LDPC解碼器為了效能及低功耗的考量,常常限制每個碼字位元的資料傳遞以一位元為限。意即,在每次疊代的過程中,每個碼字位元僅交換符號位元(sign bit)的資訊。在此限制下,若要增加解碼器的解碼效能,例如是吞吐量(throughput)或是校正率(correction rate)相當困難。Traditional bit-flipping LDPC decoders often limit the data transfer of each codeword bit to one bit for performance and low power consumption considerations. That is, in each iteration process, each codeword bit only exchanges sign bit information. Under this limitation, it is very difficult to increase the decoding performance of the decoder, such as throughput or correction rate.

因此,本發明係提出一種記憶體控制器及快閃記憶體的存取方法,其可讓低密度同位元檢查解碼器中之變數節點單元可執行可設定(configurable)解碼策略,並可增加解碼效能、提高校正率、及/或降低功耗。Therefore, the present invention proposes a memory controller and a flash memory access method, which enables variable node units in a low-density parity check decoder to execute configurable decoding strategies and increase decoding Performance, increase the correction rate, and/or reduce power consumption.

本發明係提供一種記憶體控制器,用於一資料儲存裝置,記憶體控制器包括:一變數節點單元及一檢查節點單元。變數節點單元係用以取得從該資料儲存裝置之一快閃記憶體所讀取的一通道值。檢查節點單元係用以由該變數節點單元取得一碼字差值,並依據該碼字差值計算一徵狀值(syndrome)。在每次LDPC解碼疊代之期間,變數節點單元係執行:依據該通道值及來自該檢查節點單元之該徵狀值以決定一徵狀權重(syndrome weight);取得一先前LDPC解碼疊代所產生的一先前碼字;依據該記憶體控制器之一解碼目標從複數個翻轉策略查找表中取得一第一翻轉策略查找表;依據該徵狀權重、一預定閾值及該第一翻轉策略查找表以決定該先前碼字之各碼字位元的一位元翻轉(bit-flipping)演算法之一翻轉策略,並依據該翻轉策略以翻動該先前碼字中之一或多個碼字位元以產生一更新碼字;以及將該更新碼字減去該先前碼字以產生該碼字差值。The present invention provides a memory controller used in a data storage device. The memory controller includes a variable node unit and a check node unit. The variable node unit is used to obtain a channel value read from a flash memory of the data storage device. The check node unit is used to obtain a codeword difference from the variable node unit, and calculate a syndrome according to the codeword difference. During each iteration of LDPC decoding, the variable node unit executes: Determine a syndrome weight based on the channel value and the symptom value from the check node unit; obtain a previous LDPC decoding iteration A previous codeword generated; obtain a first flip strategy lookup table from a plurality of flip strategy lookup tables according to a decoding target of the memory controller; look up based on the symptom weight, a predetermined threshold and the first flip strategy The table is used to determine a flip strategy of the bit-flipping algorithm of each codeword bit of the previous codeword, and flip one or more codeword bits in the previous codeword according to the flipping strategy Yuan to generate an updated codeword; and subtract the updated codeword from the previous codeword to generate the codeword difference.

在一些實施例中,該等翻轉策略查找表所使用的翻轉階數包含第一翻轉階數、第二翻轉階數及第三翻轉階數,且該等翻轉策略查找表所使用的LDPC疊代次數包含第一疊代次數、第二疊代次數及第三疊代次數,其中該第一翻轉階數大於該第二翻轉階數,且該第二翻轉階數大於該第三翻轉階數,其中該第一疊代次數大於該第二疊代次數,且該第二疊代次數大於該第三疊代次數。In some embodiments, the flip order used in the flip strategy lookup tables includes a first flip order, a second flip order, and a third flip order, and the LDPC iterations used in the flip strategy lookup tables The number of times includes a first number of iterations, a second number of iterations, and a third number of iterations, wherein the first flip order is greater than the second flip order, and the second flip order is greater than the third flip order, Wherein the first iteration number is greater than the second iteration number, and the second iteration number is greater than the third iteration number.

在一些實施例中,當該解碼目標為提高吞吐量,該第一翻轉策略查找表係使用該第一翻轉階數以及該第三疊代次數。在另一些實施例中,當該解碼目標為提高校正率,該第一翻轉策略查找表係使用該第二翻轉階數以及該第一疊代次數。在又一些實施例中,當該解碼目標為降低功耗,該第一翻轉策略查找表係使用該第三翻轉階數以及該第三疊代次數。In some embodiments, when the decoding goal is to improve throughput, the first flipping strategy look-up table uses the first flipping order and the third iteration number. In other embodiments, when the decoding goal is to increase the correction rate, the first flipping strategy look-up table uses the second flipping order and the first iteration number. In still other embodiments, when the decoding goal is to reduce power consumption, the first flip strategy look-up table uses the third flip order and the third iteration number.

本發明更提供一種快閃記憶體的存取方法,應用於一資料儲存裝置中的一記憶體控制器,該方法包括下列步驟:經由一儲存程序將資料儲存至該資料儲存裝置之一快閃記憶體;取得從該資料儲存裝置之一快閃記憶體所讀取的一通道值;由該變數節點單元取得一碼字差值,並依據該碼字差值計算一徵狀值(syndrome);以及在每次LDPC解碼疊代之期間,執行下列步驟:依據該通道值及來自該檢查節點單元之該徵狀值以決定一徵狀權重(syndrome weight);取得一先前LDPC解碼疊代所產生的一先前碼字;依據該記憶體控制器之一解碼目標從複數個翻轉策略查找表中取得一第一翻轉策略查找表;依據該徵狀權重、一預定閾值及該第一翻轉策略查找表以決定該先前碼字之各碼字位元的一位元翻轉(bit-flipping)演算法之一翻轉策略,並依據該翻轉策略以翻動該先前碼字中之一或多個碼字位元以產生一更新碼字;以及將該更新碼字減去該先前碼字以產生該碼字差值。The present invention further provides a flash memory access method, which is applied to a memory controller in a data storage device. The method includes the following steps: storing data to a flash memory of the data storage device through a storage program Memory; obtain a channel value read from a flash memory of the data storage device; obtain a codeword difference value from the variable node unit, and calculate a syndrome value (syndrome) based on the codeword difference value ; And during each iteration of LDPC decoding, perform the following steps: determine a symptom weight (syndrome weight) according to the channel value and the symptom value from the check node unit; obtain a previous LDPC decoding iteration A previous codeword generated; obtain a first flip strategy lookup table from a plurality of flip strategy lookup tables according to a decoding target of the memory controller; look up based on the symptom weight, a predetermined threshold and the first flip strategy The table is used to determine a flip strategy of the bit-flipping algorithm of each codeword bit of the previous codeword, and flip one or more codeword bits in the previous codeword according to the flipping strategy Yuan to generate an updated codeword; and subtract the updated codeword from the previous codeword to generate the codeword difference.

本發明更提供一種記憶體控制器,用於一資料儲存裝置中,記憶體控制器包括:一變數節點單元及一檢查節點單元。變數節點單元係用以取得從該資料儲存裝置之一快閃記憶體所讀取的一通道值。檢查節點單元係用以由該變數節點單元取得一碼字差值,並依據該碼字差值計算一徵狀值(syndrome)。在每次LDPC解碼疊代之期間,該變數節點單元係執行:依據來自該檢查節點單元之該徵狀值以決定一徵狀權重(syndrome weight);取得一先前LDPC解碼疊代所產生的一先前碼字;依據該通道值及該先前碼字以決定在該先前碼字中之各碼字位元是否已被翻轉過;對於該先前碼字中已被翻轉過各碼字位元及未被翻轉過各碼字位元,分別選擇一第一翻轉策略查找表及一第二翻轉策略查找表,其中該第一翻轉策略查找表不同於該第二翻轉策略查找表;依據該徵狀權重、一預定閾值及所選擇的該第一翻轉策略查找表或該第二翻轉策略查找表以決定該先前碼字之各碼字位元的一位元翻轉(bit-flipping)演算法之一翻轉策略,並依據該翻轉策略以翻動該先前碼字中之一或多個碼字位元以產生一更新碼字;以及將該更新碼字減去該先前碼字以產生該碼字差值。The present invention further provides a memory controller used in a data storage device. The memory controller includes: a variable node unit and a check node unit. The variable node unit is used to obtain a channel value read from a flash memory of the data storage device. The check node unit is used to obtain a codeword difference from the variable node unit, and calculate a syndrome according to the codeword difference. During each iteration of LDPC decoding, the variable node unit executes: Determine a syndrome weight based on the symptom value from the check node unit; obtain a syndrome weight generated by a previous LDPC decoding iteration The previous codeword; according to the channel value and the previous codeword to determine whether each codeword bit in the previous codeword has been flipped; for the previous codeword, each codeword bit has been flipped and not After each codeword bit has been flipped, a first flip strategy lookup table and a second flip strategy lookup table are respectively selected, wherein the first flip strategy lookup table is different from the second flip strategy lookup table; according to the symptom weight , A predetermined threshold and the selected first flipping strategy lookup table or the second flipping strategy lookup table to determine one of the bit-flipping algorithms of each codeword bit of the previous codeword Strategy, and flip one or more codeword bits in the previous codeword according to the flipping strategy to generate an updated codeword; and subtract the previous codeword from the updated codeword to generate the codeword difference.

以下說明係為完成發明的較佳實現方式,其目的在於描述本發明的基本精神,但並不用以限定本發明。實際的發明內容必須參考之後的權利要求範圍。The following description is a preferred implementation of the invention, and its purpose is to describe the basic spirit of the invention, but not to limit the invention. The actual content of the invention must refer to the scope of the claims that follow.

必須了解的是,使用於本說明書中的"包含"、"包括"等詞,係用以表示存在特定的技術特徵、數值、方法步驟、作業處理、元件以及/或組件,但並不排除可加上更多的技術特徵、數值、方法步驟、作業處理、元件、組件,或以上的任意組合。It must be understood that the words "include", "include" and other words used in this specification are used to indicate the existence of specific technical features, values, method steps, operations, elements, and/or components, but they do not exclude Add more technical features, values, method steps, job processing, components, components, or any combination of the above.

於權利要求中使用如"第一"、"第二"、"第三"等詞係用來修飾權利要求中的元件,並非用來表示之間具有優先權順序,先行關係,或者是一個元件先於另一個元件,或者是執行方法步驟時的時間先後順序,僅用來區別具有相同名字的元件。Words such as "first", "second", and "third" used in the claims are used to modify the elements in the claims, and are not used to indicate that there is an order of priority, an antecedent relationship, or an element Prior to another element, or the chronological order of execution of method steps, is only used to distinguish elements with the same name.

第2圖為依據本發明一實施例的資料儲存裝置的方塊圖。FIG. 2 is a block diagram of a data storage device according to an embodiment of the invention.

在一實施例中,資料儲存裝置200可以是可攜式記憶裝置(例如:符合SD/MMC、CF、MS、XD標準之記憶卡)或是固態硬碟(solid-state drive,SSD),且主機230為一可與資料儲存裝置200連接的電子裝置,例如手機、筆記型電腦、桌上型電腦…等等。在另一實施例中,資料儲存裝置200可以設置在一電子裝置中,例如設置在手機、筆記型電腦、桌上型電腦之中,而此時主裝置130可以是該電子裝置的一處理器。In one embodiment, the data storage device 200 may be a portable memory device (for example, a memory card compliant with SD/MMC, CF, MS, and XD standards) or a solid-state drive (SSD), and The host 230 is an electronic device that can be connected to the data storage device 200, such as a mobile phone, a notebook computer, a desktop computer, etc. In another embodiment, the data storage device 200 may be installed in an electronic device, such as a mobile phone, a notebook computer, or a desktop computer, and the main device 130 may be a processor of the electronic device. .

如第2圖所示,資料儲存裝置200包括一記憶體控制器210及一快閃記憶體220,其中記憶體控制器210係用以存取快閃記憶體220。在一實施例中,記憶體控制器210包括一處理單元211、一儲存單元212、一控制邏輯216、一緩衝記憶體218及存取介面250及252。處理單元211可由專用硬體電路或通用硬體所實現,具有多個處理核心的處理器或是具平行處理能力的多處理器,且上述實現方式例如可為通用處理器(General-Purpose Processor)、或微控制器(Microcontroller),但本發明並不限於此。As shown in FIG. 2, the data storage device 200 includes a memory controller 210 and a flash memory 220. The memory controller 210 is used to access the flash memory 220. In one embodiment, the memory controller 210 includes a processing unit 211, a storage unit 212, a control logic 216, a buffer memory 218, and access interfaces 250 and 252. The processing unit 211 may be implemented by a dedicated hardware circuit or a general-purpose hardware, a processor with multiple processing cores or a multiprocessor with parallel processing capabilities, and the foregoing implementation manner may be, for example, a General-Purpose Processor. , Or Microcontroller, but the present invention is not limited to this.

儲存單元212可為非揮發性記憶體,例如為唯讀記憶體(read-only memory,ROM)、可擦除式可程式化唯讀記憶體(erasable programmable read-only memory,EPROM)、電子可擦除式可程式化唯讀記憶體(electrically erasable programmable read-only memory,EEPROM)或電子熔絲(E-Fuse)。儲存單元212係儲存啟動程式213,其包括啟動碼(Boot Code)或啟動程式(Bootloader),且可由處理單元211執行,記憶體控制器210基於啟動程式213而完成開機,並開始控制該快閃記憶體220的運作,例如,讀取線上燒錄(In System Programming,ISP)碼。The storage unit 212 may be a non-volatile memory, such as read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read-only memory, EPROM), electronic memory Erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM) or electronic fuse (E-Fuse). The storage unit 212 stores a startup program 213, which includes a startup code (Boot Code) or a startup program (Bootloader), and can be executed by the processing unit 211. The memory controller 210 completes the boot based on the startup program 213 and starts to control the flash The operation of the memory 220, for example, reads In System Programming (ISP) codes.

快閃記憶體220例如為NAND快閃記憶體,且快閃記憶體220包括複數個實體區塊(physical block)240,且各實體區塊包括複數個實體頁面(physical page)241。The flash memory 220 is, for example, a NAND flash memory, and the flash memory 220 includes a plurality of physical blocks 240 and each physical block includes a plurality of physical pages 241.

處理單元211與快閃記憶體220間的資料與操作命令傳遞係透過數個電子信號進行協調,上述電子信號包括資料線(data line)、時脈訊號(clock signal)與控制訊號(control signal)。資料線可用以傳遞命令、位址、讀出及寫入的資料;控制訊號線可用以傳遞晶片致能(chip enable,CE)、位址提取致能(address latch enable,ALE)、命令提取致能(command latch enable,CLE)、寫入致能(write enable,WE)等控制訊號。The transmission of data and operation commands between the processing unit 211 and the flash memory 220 is coordinated through a number of electronic signals. The electronic signals include a data line, a clock signal, and a control signal. . The data line can be used to transfer commands, addresses, read and write data; the control signal line can be used to transfer chip enable (CE), address latch enable (ALE), command extraction Control signals such as command latch enable (CLE) and write enable (WE).

存取介面250可採用雙倍資料率(double data rate, DDR)通訊協定與快閃記憶體220溝通,例如,開放NAND快閃(open NAND flash interface,ONFI)、雙倍資料率開關(DDR Toggle)或其他介面。處理單元211另可使用存取介面252透過指定通訊協定與主機230進行溝通,例如,通用序列匯流排(universal serial bus,USB)、先進技術附著(advanced technology attachment,ATA)、序列先進技術附著(serial advanced technology attachment,SATA)、快速周邊元件互聯(peripheral component interconnect express, PCI-E)、非揮發性記憶體的傳輸規範(Non-Volatile Memory Express,NVMe)或其他介面。The access interface 250 can communicate with the flash memory 220 using a double data rate (DDR) communication protocol, for example, open NAND flash interface (ONFI), double data rate switch (DDR Toggle) ) Or other interfaces. The processing unit 211 can also use the access interface 252 to communicate with the host 230 through a designated communication protocol, such as universal serial bus (USB), advanced technology attachment (ATA), serial advanced technology attachment ( Serial advanced technology attachment, SATA), peripheral component interconnect express (PCI-E), non-volatile memory transfer specification (Non-Volatile Memory Express, NVMe) or other interfaces.

緩衝記憶體218可為一揮發性記憶體,例如包括一動態隨機存取記憶體(dynamic random access memory,DRAM)及/或一靜態隨機存取記憶體(static random access memory,SRAM)。在此實施例,緩衝記憶體218包括一通道值記憶體(channel value memory,CHVMem)2181及變數節點記憶體(variable node memory,VNMem)2182。通道值記憶體2181係用以暫存來自存取介面250所讀取的快閃記憶體220的原始頁面資料(或稱為碼字)、或是用以暫存來自主機230的主機指令。變數節點記憶體2182係用以暫存在進行低密度同位元檢查之解碼過程中在各變數節點之變數節點資料。此外,通道值記憶體2181所儲存的碼字例如可為硬判定或軟判定之方式由快閃記憶體220所讀取的資訊,其中硬判定(hard decision)是採用單一讀取電壓閾值,故所得到的碼字只有符號(sign)資訊。軟判定(soft decision)則是利用多個讀取電壓閾值,故所得到的碼字除了符號資訊之外,還帶有可靠度資訊,例如每個碼字位元可使用至少一位元的可靠度資訊來表示。若可靠度資訊用一位元表示,則可用0及1分別表示強(strong)及弱(weak)兩種不同的可靠度,則碼字位元搭配可靠度則可分為強”1”、弱”1”、弱”0”及強”0”。The buffer memory 218 may be a volatile memory, for example, including a dynamic random access memory (DRAM) and/or a static random access memory (SRAM). In this embodiment, the buffer memory 218 includes a channel value memory (CHVMem) 2181 and a variable node memory (VNMem) 2182. The channel value memory 2181 is used to temporarily store original page data (or codewords) from the flash memory 220 read by the access interface 250 or to temporarily store host commands from the host 230. The variable node memory 2182 is used to temporarily store the variable node data of each variable node during the decoding process of the low-density parity check. In addition, the code words stored in the channel value memory 2181 can be, for example, information read by the flash memory 220 in a hard decision or a soft decision. The hard decision uses a single read voltage threshold, so The obtained codeword has only sign information. Soft decision (soft decision) uses multiple read voltage thresholds, so in addition to symbol information, the obtained codeword also contains reliability information. For example, each codeword bit can use at least one bit of reliability. Degree information. If the reliability information is represented by one bit, 0 and 1 can be used to represent two different reliability levels, namely strong and weak respectively. The code word bit collocation reliability can be divided into strong "1", Weak "1", weak "0" and strong "0".

控制邏輯216包括一編碼器214及解碼器215。在一些實施例中,編碼器214、解碼器215及控制邏輯216例如可由應用導向積體電路(application-specific integrated circuit,ASIC)、現場可程式化邏輯閘陣列(field-programmable gate array,FPGA)、複雜可程式化邏輯裝置(complex programmable logic device,CPLD)、或具有相同功能的邏輯電路所實現,但本發明並不限於此。The control logic 216 includes an encoder 214 and a decoder 215. In some embodiments, the encoder 214, the decoder 215, and the control logic 216 can be, for example, an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA). , A complex programmable logic device (CPLD), or a logic circuit with the same function, but the invention is not limited to this.

在此實施例中,編碼器214例如為一低密度同位元查核碼(LDPC)編碼器,且可以根據來自主機230的資料來產生對應的查核碼,且所產生的查核碼符合一查核碼檢查矩陣。具體來說,參考第3圖,假設該查核碼檢查矩陣為一大小為c*t的矩陣(例如,列數c=5,行數t=48),而該查核碼檢查矩陣可以分為左側的矩陣M(大小為c*(t-c))以及右側的矩陣K(大小為c*c),為了找出與該查核碼檢查矩陣所對應的查核碼產生矩陣,可以先找出矩陣K的反矩陣K -1(inverse matrix),之後再將反矩陣(K -1)與矩陣M相乘以得到矩陣P,而矩陣P的轉置矩陣(transpose matrix)便可以作為查核碼產生矩陣。換句話說,在找到矩陣P的轉置矩陣之後,編碼器214可以將來自主機230的資料乘以矩陣P的轉置矩陣來得到對應於該些資料的查核碼,而編碼器214之後再將資料與查核碼一起乘上該查核碼檢查矩陣以判斷查核碼是否正確。舉例來說,若是相乘結果等於“0”則判斷編碼正確;而若是相乘結果不等於“0”則判斷編碼錯誤。在判斷編碼正確之後,資料與對應的查核碼便會被寫入至快閃記憶體220的其中一個實體頁面中。 In this embodiment, the encoder 214 is, for example, a low-density parity check code (LDPC) encoder, and can generate a corresponding check code based on the data from the host 230, and the generated check code conforms to a check code check matrix. Specifically, referring to Figure 3, suppose the check code check matrix is a matrix of size c*t (for example, the number of columns c=5, the number of rows t=48), and the check code check matrix can be divided into the left The matrix M (size c*(tc)) and the right matrix K (size c*c), in order to find the check code generation matrix corresponding to the check code check matrix, you can first find the inverse of the matrix K Matrix K -1 (inverse matrix), and then multiply the inverse matrix (K -1 ) with matrix M to obtain matrix P, and the transpose matrix of matrix P can be used as a check code to generate a matrix. In other words, after finding the transposed matrix of matrix P, the encoder 214 can multiply the data from the host 230 by the transposed matrix of matrix P to obtain the check code corresponding to the data, and the encoder 214 can then The data and the check code are multiplied by the check matrix to determine whether the check code is correct. For example, if the multiplication result is equal to "0", it is judged that the encoding is correct; if the multiplication result is not equal to "0", it is judged that the encoding is wrong. After the code is judged to be correct, the data and the corresponding check code will be written into one of the physical pages of the flash memory 220.

解碼器215例如為低密度同位元查核碼(LDPC)解碼器。當主機230發送一讀取指令至資料儲存裝置230,記憶體控制器210係由快閃記憶體220取得初始頁面資料,例如又稱為通道值。初始頁面資料例如包括初始資料及錯誤校正碼資料。因為初始資料及錯誤校正碼資料在經過通道傳輸時可能產生錯誤,故解碼器215可利用錯誤校正碼資料以對初始資料及/或錯誤校正碼資料本身進行錯誤校正,例如可採用一位元翻轉(bit flipping)演算法進行LDPC解碼。解碼器215之細節將於下列實施例中詳述。The decoder 215 is, for example, a low-density parity check code (LDPC) decoder. When the host 230 sends a read command to the data storage device 230, the memory controller 210 obtains the initial page data from the flash memory 220, which is also called channel value, for example. The initial page data includes, for example, initial data and error correction code data. Because the initial data and the error correction code data may generate errors when transmitted through the channel, the decoder 215 can use the error correction code data to perform error correction on the initial data and/or the error correction code data itself, for example, a bit reversal can be used. (bit flipping) algorithm for LDPC decoding. The details of the decoder 215 will be detailed in the following embodiments.

第4圖為依據本發明一實施例中之解碼器215的方塊圖。如第4圖所示,解碼器215包括一變數節點單元(variable node unit,VNU)410及一檢查節點單元(check node unit,CNU)420。在進行LDPC解碼時,資料會在變數節點單元410及檢查節點單元420之間進行疊代(iteration),直到解出正確的碼字或是達到疊代次數上限為止。舉例來說,當解碼器215開始進行解碼時,變數節點記憶體2182中所暫存的先前碼字的數值以及初始的徵狀值均被重置為0。變數節點單元410會由通道值記憶體2181取得通道值或碼字(例如可稱為先前碼字VN_prev),並進行第一次疊代的運算。變數節點單元410係將疊代運算所產生的位元翻轉後的更新碼字(VN_new)儲存至變數節點記憶體2182,並將上述更新碼字與先前碼字(VN_prev)的差值傳送至檢查節點單元420以進行徵狀(syndrome)值的相關運算。Figure 4 is a block diagram of the decoder 215 in an embodiment according to the present invention. As shown in FIG. 4, the decoder 215 includes a variable node unit (VNU) 410 and a check node unit (CNU) 420. During LDPC decoding, the data will be iterated between the variable node unit 410 and the check node unit 420 until the correct codeword is solved or the number of iterations is reached. For example, when the decoder 215 starts decoding, the value of the previous codeword and the initial symptom value temporarily stored in the variable node memory 2182 are reset to zero. The variable node unit 410 obtains the channel value or code word (for example, it may be called the previous code word VN_prev) from the channel value memory 2181, and performs the first iteration operation. The variable node unit 410 stores the updated codeword (VN_new) generated by the iterative operation to the variable node memory 2182, and transmits the difference between the updated codeword and the previous codeword (VN_prev) to the inspection The node unit 420 is used to perform correlation calculations on syndrome values.

若來自檢查節點單元420的徵狀值不為0,則變數節點單元410會繼續進行第二次或後續的疊代運算。舉例來說,變數節點單元410會從變數節點記憶體2182、檢查節點單元420及通道值記憶體2181分別取得先前碼字VN_prev、徵狀值、以及通道值,並據以計算出在先前碼字中的那些碼字位元需要翻轉。若來自檢查節點單元420的徵狀值等於0,則變數節點單元410則會輸出目前疊代過程所產生的更新碼字以輸出正確頁面資料。因此,記憶體控制器210中的處理單元211可將正確頁面資料回報至主機230。If the symptom value from the check node unit 420 is not 0, the variable node unit 410 will continue to perform the second or subsequent iteration operations. For example, the variable node unit 410 obtains the previous code word VN_prev, the symptom value, and the channel value from the variable node memory 2182, the check node unit 420, and the channel value memory 2181, respectively, and calculates the previous code word Those codeword bits in need to be reversed. If the symptom value from the check node unit 420 is equal to 0, the variable node unit 410 will output the updated code word generated by the current iteration process to output the correct page data. Therefore, the processing unit 211 in the memory controller 210 can report the correct page data to the host 230.

第5圖為依據本發明之第一實施例中的變數節點單元的方塊圖。請同時參考第4圖及第5圖,在第一實施例中,變數節點單元410例如包括一徵狀權重加總(syndrome weight sum)單元511、一閾值計算單元(threshold calculator)512及一翻轉單元(flipping unit)513。Figure 5 is a block diagram of the variable node unit in the first embodiment of the present invention. Please refer to FIG. 4 and FIG. 5 at the same time. In the first embodiment, the variable node unit 410 includes, for example, a syndrome weight sum unit 511, a threshold calculator 512, and a flip Unit (flipping unit) 513.

徵狀權重加總單元511係用以依據來自檢查節點單元420所產生之徵狀值syndrome以及來自通道值記憶體2181的通道值CH_sgn以產生每個碼字位元相應的徵狀權重ws。The symptom weight summation unit 511 is used to generate the symptom weight ws corresponding to each codeword bit according to the symptom value syndrome generated by the check node unit 420 and the channel value CH_sgn from the channel value memory 2181.

閾值計算單元512係用以計算當前解碼過程所使用的一閾值(threshold)。在此實施例中,閾值計算單元512所產生用於解碼過程的閾值例如可視實際解碼的情況而改變。The threshold calculation unit 512 is used to calculate a threshold used in the current decoding process. In this embodiment, the threshold value generated by the threshold value calculation unit 512 for the decoding process may be changed depending on the actual decoding situation, for example.

翻轉單元513係包括一比較器5131及一位元翻轉電路5132。比較器5131係用以將每個碼字位元之徵狀權重ws與上述閾值進行比較。位元翻轉電路5132係依據上述比較結果決定相應的碼字位元是否需要翻轉,並將進行位元翻轉後之更新碼字VN_new儲存至變數節點記憶體2182。舉例來說,若其中一個碼字位元的徵狀權重ws大於或等於上述閾值th,則位元翻轉電路5132會將上述碼字位元進行翻轉,例如從0翻轉為1或是從1翻轉為0。位元翻轉電路5132並計算在此次疊代運算所取得的先前碼字與上述更新碼字的碼字差值(codeword difference)Diff,並將上述碼字差值Diff傳送至檢查節點單元420。The flip unit 513 includes a comparator 5131 and a bit flip circuit 5132. The comparator 5131 is used to compare the symptom weight ws of each codeword bit with the aforementioned threshold. The bit flip circuit 5132 determines whether the corresponding code word bit needs to be flipped according to the above comparison result, and stores the updated code word VN_new after bit flipping to the variable node memory 2182. For example, if the symptom weight ws of one of the codeword bits is greater than or equal to the above threshold th, the bit flip circuit 5132 will flip the above codeword bits, such as flipping from 0 to 1 or from 1 Is 0. The bit flip circuit 5132 calculates the codeword difference Diff between the previous codeword obtained in this iterative operation and the updated codeword, and transmits the codeword difference Diff to the check node unit 420.

其中,上述碼字差值Diff的計算方式例如為VN_next-VN_prev。更新碼字及先前碼字均為二進位的數字表示,若更新碼字VN_next為0111且先前碼字VN_prev為0101,則碼字差值Diff為0010。Wherein, the calculation method of the codeword difference Diff is, for example, VN_next-VN_prev. The updated codeword and the previous codeword are both binary digital representations. If the updated codeword VN_next is 0111 and the previous codeword VN_prev is 0101, the codeword difference Diff is 0010.

第6A圖為依據本發明之第二實施例中的變數節點單元的方塊圖。請同時參考第4圖及第6A圖,在第二實施例中,變數節點單元410例如包括一徵狀權重加總(syndrome weight sum)單元611、一閾值計算單元(threshold calculator)612及一翻轉單元(flip unit)613。徵狀權重加總單元611係用以依據來自檢查節點單元420所產生之徵狀值syndrome以及來自通道值記憶體2181的通道值CH_sgn以產生每個碼字位元相應的徵狀權重ws。閾值計算單元612係用以計算當前解碼過程所使用的一閾值(threshold)。在此實施例中,閾值計算單元612所產生用於解碼過程的閾值例如為一固定值。FIG. 6A is a block diagram of the variable node unit in the second embodiment of the present invention. Please refer to FIG. 4 and FIG. 6A at the same time. In the second embodiment, the variable node unit 410 includes, for example, a syndrome weight sum unit 611, a threshold calculator 612, and a flip Unit (flip unit) 613. The symptom weight summation unit 611 is used to generate the symptom weight ws corresponding to each codeword bit according to the symptom value syndrome generated by the check node unit 420 and the channel value CH_sgn from the channel value memory 2181. The threshold calculation unit 612 is used to calculate a threshold used in the current decoding process. In this embodiment, the threshold value generated by the threshold value calculation unit 612 for the decoding process is, for example, a fixed value.

翻轉單元613係包括一翻轉決定單元6131及一位元翻轉電路6132。翻轉決定單元6131係用以依據當前每個碼字位元之徵狀權重ws及上述閾值以決定翻轉策略(flipping strategy)。為了便於說明,翻轉決定單元6131例如可由一翻轉策略查找表601所實現,其中翻轉策略查找表601可預先儲存於儲存單元212,且在資料儲存裝置200開機時,處理單元211可將翻轉策略查找表601載入至緩衝記憶體218或是一暫存器組(register file)。The flip unit 613 includes a flip determination unit 6131 and a bit flip circuit 6132. The flipping determination unit 6131 is used for determining a flipping strategy according to the current symptom weight ws of each codeword bit and the above threshold. For ease of description, the rollover determination unit 6131 can be implemented by, for example, a rollover strategy lookup table 601. The rollover strategy lookup table 601 can be pre-stored in the storage unit 212, and when the data storage device 200 is turned on, the processing unit 211 can search for the rollover strategy. The table 601 is loaded into the buffer memory 218 or a register file.

在一實施例中,翻轉策略查找表601可使用硬資訊搭配碼字、或是軟資訊搭配碼字的方式進行查找。舉例來說,對於一般正常的快閃記憶體來說,其錯誤率約在1%以下,意即資料的正確率很高,故適合採用硬決定(hard decision)以讀取頁面資料。若在讀取快閃記憶體220之頁面資料係使用硬決定時,則表示儲存於通道值記憶體2181中的通道值/碼字不帶有可靠度資訊。此時,翻轉單元613例如在開始進行LDPC解碼時,可將來自通道值記憶體2181的各碼字位元相應的可靠度資訊(例如可用1或多個位元表示)重置為1。隨著解碼過程中進行疊代運算,若可靠度資訊為1位元,則各碼字位元之數值及相應的可靠度資訊可能會被切換為不同的數值,例如為強”1”、弱”1”、弱”0”及強”0”,其中強/弱表示可靠度資訊,且上述四種組合對應的(可靠度, 碼字位元)可分別表示為(1, 1)、(0, 1)、(0, 0)及(1, 0)、或是可分別表示為S1、W1、W0及S0。In one embodiment, the flip strategy look-up table 601 can be searched using hard information and codewords or soft information and codewords. For example, for normal flash memory, the error rate is about 1% or less, which means that the accuracy of the data is very high, so it is suitable to use a hard decision to read the page data. If hard decision is used when reading the page data of the flash memory 220, it means that the channel value/codeword stored in the channel value memory 2181 does not carry reliability information. At this time, the inversion unit 613 can reset the reliability information (for example, it can be represented by 1 or more bits) corresponding to each codeword bit from the channel value memory 2181 to 1 when starting LDPC decoding, for example. With the iterative calculations in the decoding process, if the reliability information is 1 bit, the value of each codeword bit and the corresponding reliability information may be switched to different values, such as strong "1" and weak "1", weak "0" and strong "0", where strong/weak means reliability information, and the corresponding (reliability, codeword bits) of the above four combinations can be expressed as (1, 1), ( 0, 1), (0, 0) and (1, 0), or can be represented as S1, W1, W0, and S0, respectively.

在另一實施例中,第6圖之變數節點單元亦可接收利用軟決定(soft decision,例如使用多個讀取電壓閾值以讀取快閃記憶體)所讀取的頁面資料,且來自通道值記憶體2181的碼字會帶有軟資訊,例如可為一或多個位元的可靠度資訊。此時,翻轉單元613例如在開始進行LDPC解碼時,可直接使用來自通道值記憶體2181的各碼字位元及相應的可靠度資訊。In another embodiment, the variable node unit in Figure 6 can also receive page data read by using soft decision (soft decision, for example, using multiple read voltage thresholds to read flash memory), and it can also receive data from the channel. The codeword of the value memory 2181 will carry soft information, for example, one or more bits of reliability information. At this time, the reversing unit 613 may directly use the respective codeword bits and the corresponding reliability information from the channel value memory 2181 when starting LDPC decoding, for example.

在此實施例中,翻轉策略查找表601利用徵狀權重ws及閾值th的查表結果可分為多種不同的位元翻轉方式,例如為強翻轉(strong flip)、弱翻轉(weak flip)及不動作(do nothing),其中徵狀權重ws及閾值th例如均為自然數。但本發明並不限於此。In this embodiment, the look-up result of the flip strategy look-up table 601 using the symptom weight ws and the threshold th can be divided into a variety of different bit flip methods, such as strong flip, weak flip and Do nothing, where the symptom weight ws and the threshold th are, for example, natural numbers. However, the present invention is not limited to this.

舉例來說,強翻轉(strong flip)、弱翻轉(weak flip)及未動作可分別用S、W及X表示。若查表結果表示為強翻轉S時,則強”0”會被翻轉為弱”1”,弱”0”會被翻轉為強”1”,弱”1”會被翻轉為強”0”,強”1”會被翻轉為弱”0”。若查表結果表示為弱翻轉S時,則強”0”會被翻轉為弱”0”,弱”0”會被翻轉為弱”1”,弱”1”會被翻轉為弱”0”,強”1”會被翻轉為弱”1”。若查表結果表示為未動作時,則強”1”、弱”1”、弱”0”及強”0”均會維持原本的數值。For example, strong flip, weak flip and no action can be represented by S, W, and X, respectively. If the result of the look-up table is expressed as a strong flip S, the strong "0" will be flipped to a weak "1", a weak "0" will be flipped to a strong "1", and a weak "1" will be flipped to a strong "0" , Strong "1" will be flipped to weak "0". If the result of the look-up table is expressed as a weak flip S, the strong "0" will be flipped to a weak "0", a weak "0" will be flipped to a weak "1", and a weak "1" will be flipped to a weak "0" , The strong "1" will be flipped to the weak "1". If the result of the look-up table is indicated as inactive, the strong "1", weak "1", weak "0" and strong "0" will all maintain their original values.

強翻轉、弱翻轉及未動作之翻轉方式整理如表1所示: 強翻轉 弱翻轉 不動作 S0 → W1 S0 → W0 S0 → S0 W0 → S1 W0 → W1 W0 → W0 W1 → S0 W1 → W0 W1 → W1 S1 → W0 S1 → W1 S1 → S1 表1 The reversal methods of strong flip, weak flip and no action are organized as shown in Table 1: Strong flip Weak flip No action S0 → W1 S0 → W0 S0 → S0 W0 → S1 W0 → W1 W0 → W0 W1 → S0 W1 → W0 W1 → W1 S1 → W0 S1 → W1 S1 → S1 Table 1

需注意的是,本發明並不限定於表1中的翻轉方式及數量,且本發明領域中具有通常知識者可視實際情況而設計適合的翻轉方式及數量。值得說明的是,若將S1、W1、W0及S0視為依序排列的4個邏輯狀態,且相鄰的邏輯狀態可視為階數差1,如第6B圖所示。強翻轉之方式表示上述狀態進行翻轉時會被翻轉至距離兩個階數(step)或以上的狀態,例如狀態S1被翻轉至狀態W0、狀態S0被翻轉至狀態W1,依此類推。弱翻轉之方式表示上述狀態進行翻轉時會被翻轉距離一個間隔的狀態,例如狀態S1被翻轉至狀態W1、狀態S0被翻轉至狀態W0,依此類推。然而,無論是強翻轉或弱翻轉,狀態S1、W1、W0及S0在進行翻轉時會具有對稱性,如表1所示。It should be noted that the present invention is not limited to the turning methods and numbers in Table 1, and those with ordinary knowledge in the field of the present invention can design suitable turning methods and numbers according to actual conditions. It is worth noting that if S1, W1, W0, and S0 are regarded as 4 logic states arranged in sequence, and the adjacent logic states can be regarded as the order difference 1, as shown in Fig. 6B. The method of strong flip means that the above state will be flipped to a state two steps or more away when flipped, for example, state S1 is flipped to state W0, state S0 is flipped to state W1, and so on. The method of weak flip refers to the state where the above state will be flipped at an interval when flipped, for example, state S1 is flipped to state W1, state S0 is flipped to state W0, and so on. However, regardless of whether it is a strong or weak reversal, the states S1, W1, W0, and S0 will have symmetry during reversal, as shown in Table 1.

在一實施例中,若徵狀權重ws及閾值th均為介於0~4的整數,翻轉策略查找表601例如可用表2表示對應於不同徵狀權重ws及閾值th之翻轉策略:      th ws 0 1 2 3 4 0 X X W W W 1 X X X W W 2 X X X W W 3 X X X W S 4 X X X X S 表2 In one embodiment, if the symptom weight ws and the threshold th are both integers ranging from 0 to 4, the rollover strategy look-up table 601 may, for example, use Table 2 to indicate the rollover strategies corresponding to different symptom weights ws and threshold th: th ws 0 1 2 3 4 0 X X W W W 1 X X X W W 2 X X X W W 3 X X X W S 4 X X X X S Table 2

舉例來說,在翻轉策略查找表601中,例如可針對提高吞吐量進行設計。當徵狀權重ws及閾值th的數值愈大時,表示在碼字位元之錯誤機率較高,故會使用強翻轉之方式。For example, in the rollover strategy look-up table 601, for example, it can be designed to improve throughput. When the value of the symptom weight ws and the threshold th is larger, it means that the error probability in the code word bit is higher, so the strong flip method is used.

在一些實施例中,翻轉決定單元6131可包括多個翻轉策略查找表,且不同的翻轉策略查找表係對應至不同的解碼目標並可進行最佳化設計,例如提高吞吐量(throughput)、提高校正率(correction rate)、或是降低功耗等等。當解碼器215被設定為其中一個解碼目標時,翻轉決定單元6131即可從上述多個翻轉策略查找表中選擇相應於解碼目標的翻轉策略查找表。In some embodiments, the flip decision unit 6131 may include a plurality of flip strategy lookup tables, and different flip strategy lookup tables correspond to different decoding targets and can be optimized for design, such as increasing throughput and improving Correction rate, or reduce power consumption, etc. When the decoder 215 is set as one of the decoding targets, the flip decision unit 6131 can select the flip strategy lookup table corresponding to the decoding target from the above multiple flip strategy lookup tables.

舉例來說,針對提高吞吐量之翻轉策略查找表可以使用整體較積極的翻轉策略並搭配較少的疊代次數。當解碼器215在同樣的硬體平行度之下,選擇提高吞吐量之翻轉策略查找表例如可增加一倍的硬解碼(hard decoding)吞吐量。提高校正率之翻轉策略查找表可以使用中性的翻轉策略並搭配較高的疊代次數以期可對具有較多錯誤的碼字進行錯誤校正,例如可在同樣的校正率之下額外更正0.05%的原始位元錯誤率(raw bit error rate,RBER)。降低功耗之翻轉策略查找表可以使用較保守的翻轉策略並搭配較少的疊代次數,故可在相同的硬體平行度之下降低解碼器215的功耗。在一些實施例中,翻轉決定單元6131中的部分翻轉策略查找表可針對兩個或以上的解碼目標設計,例如可同時提高吞吐量及提高校正率,但本發明並不限於此。此外,相較於第5圖,使用第6圖中之變數節點單元之解碼器可具有更佳的解碼效能。For example, a look-up table for a flip strategy for improving throughput can use an overall more aggressive flip strategy with a smaller number of iterations. When the decoder 215 is under the same hardware parallelism, selecting a look-up table of the flip strategy to improve throughput can, for example, double the throughput of hard decoding. The look-up table of the flip strategy to improve the correction rate can use a neutral flip strategy with a higher number of iterations in order to perform error correction on codewords with more errors, such as an additional correction of 0.05% under the same correction rate The raw bit error rate (raw bit error rate, RBER). The flip strategy lookup table for reducing power consumption can use a more conservative flip strategy with fewer iterations, so the power consumption of the decoder 215 can be reduced under the same hardware parallelism. In some embodiments, the partial flip strategy lookup table in the flip decision unit 6131 can be designed for two or more decoding targets, for example, the throughput and the correction rate can be improved at the same time, but the present invention is not limited to this. In addition, compared to Fig. 5, the decoder using the variable node unit in Fig. 6 can have better decoding performance.

位元翻轉電路6132係依據各碼字位元的查表結果DR以決定相應的碼字位元及其可靠度資訊R是否需要翻轉,並將進行位元翻轉後之更新碼字VN_new及更新可靠度資訊R_new儲存至變數節點記憶體2182。位元翻轉電路6132並計算在此次疊代運算所取得的先前碼字與上述更新碼字的碼字差值(codeword difference)Diff,例如為VN_next-VN_prev,並將上述碼字差值Diff傳送至檢查節點單元420。需注意的是,位元翻轉電路6132係將碼字差值傳送至檢查節點單元420,但位元翻轉電路6132並未將更新可靠度資訊R_new傳送至檢查節點單元420,而是將更新可靠度資訊R_new儲存至變數節點記憶體2182以供下一次疊代運算使用。The bit flip circuit 6132 determines whether the corresponding code word bit and its reliability information R need to be flipped according to the table lookup result DR of each code word bit, and updates the code word VN_new after bit flipping and the update reliability The degree information R_new is stored in the variable node memory 2182. The bit flip circuit 6132 calculates the codeword difference Diff between the previous codeword obtained in this iterative operation and the updated codeword, for example, VN_next-VN_prev, and transmits the codeword difference Diff To check node unit 420. It should be noted that the bit flip circuit 6132 transmits the codeword difference to the check node unit 420, but the bit flip circuit 6132 does not transmit the update reliability information R_new to the check node unit 420, but updates the reliability. The information R_new is stored in the variable node memory 2182 for use in the next iteration operation.

第7圖為依據本發明之第三實施例中的變數節點單元的方塊圖。請同時參考第4圖及第7圖,在第三實施例中,變數節點單元410例如包括一徵狀權重加總(syndrome weight sum)單元711、一閾值計算單元(threshold calculator)712及一翻轉單元(flip unit)613。在第7圖中的徵狀權重加總單元711與第6A圖中的徵狀權重加總單元611之計算方式不同,其中徵狀權重加總單元711係用以依據來自檢查節點單元420所產生之徵狀值syndrome以產生每個碼字位元相應的徵狀權重ws。閾值計算單元612係用以計算當前解碼過程所使用的一閾值(threshold)。在此實施例中,閾值計算單元712所產生用於目前解碼疊代過程的閾值例如為一固定值,但每次解碼疊代過程的閾值並不一定相同。Fig. 7 is a block diagram of the variable node unit in the third embodiment of the present invention. Please refer to FIG. 4 and FIG. 7 at the same time. In the third embodiment, the variable node unit 410 includes, for example, a syndrome weight sum unit 711, a threshold calculator 712, and a flip Unit (flip unit) 613. The calculation method of the symptom weight summation unit 711 in Fig. 7 is different from that of the symptom weight summation unit 611 in Fig. 6A. The symptom weight summation unit 711 is used to generate data from the check node unit 420. The symptom value syndrome is used to generate the symptom weight ws corresponding to each code word bit. The threshold calculation unit 612 is used to calculate a threshold used in the current decoding process. In this embodiment, the threshold value generated by the threshold value calculation unit 712 for the current decoding iteration process is, for example, a fixed value, but the threshold value of each decoding iteration process is not necessarily the same.

翻轉單元713係包括一翻轉決定單元7131及一位元翻轉電路7132。翻轉決定單元7131係包括翻轉策略查找表701及702,其中翻轉策略查找表701及702分別具有不同的翻轉策略。翻轉策略查找表701及702可預先儲存於儲存單元212,且在資料儲存裝置200開機時,處理單元211可將翻轉策略查找表701及702載入至緩衝記憶體218或是一暫存器組(register file)。The flip unit 713 includes a flip decision unit 7131 and a bit flip circuit 7132. The flip decision unit 7131 includes flip strategy lookup tables 701 and 702, wherein the flip strategy lookup tables 701 and 702 respectively have different flip strategies. The rollover strategy lookup tables 701 and 702 can be pre-stored in the storage unit 212, and when the data storage device 200 is turned on, the processing unit 211 can load the rollover strategy lookup tables 701 and 702 into the buffer memory 218 or a register set (register file).

翻轉決定單元7131係依據來自通道值記憶體2181的通道值CH_sgn以及來自變數節點記憶體2182之先前碼字VN_prev以決定要選擇翻轉策略查找表701及702的其中一者。當選定翻轉策略查找表701及702的其中一者後,翻轉決定單元7131即可依據當前每個碼字位元之徵狀權重ws及上述閾值th以決定相應的翻轉策略。The rollover determination unit 7131 determines which one of the rollover strategy look-up tables 701 and 702 should be selected according to the channel value CH_sgn from the channel value memory 2181 and the previous code word VN_prev from the variable node memory 2182. When one of the flipping strategy look-up tables 701 and 702 is selected, the flipping determining unit 7131 can determine the corresponding flipping strategy based on the current symptom weight ws of each codeword bit and the above-mentioned threshold th.

詳細而言,通道值CH_sgn及先前碼字VN_prev的長度相同,且均包括複數個位元,其中通道值CH_sgn例如可視為原始碼字。因為在目前疊代過程(例如疊代次數為N)的先前碼字VN_prev是變數節點單元410在前次疊代(例如疊代次數為N-1)之運算中將前次疊代的先前碼字VN_prev進行位元翻轉後所產生的更新碼字VN_new。因此,在目前疊代過程所取得的通道值CH_sgn及先前碼字VN_prev可用於判斷在原始碼字中有那些碼字位元是已經被翻轉過的。In detail, the channel value CH_sgn and the previous codeword VN_prev have the same length, and both include a plurality of bits. The channel value CH_sgn can be regarded as the original codeword, for example. Because in the current iteration process (for example, the number of iterations is N), the previous code word VN_prev is the variable node unit 410 in the operation of the previous iteration (for example, the number of iterations is N-1). The word VN_prev is the updated code word VN_new generated after bit flipping. Therefore, the channel value CH_sgn and the previous codeword VN_prev obtained in the current iteration process can be used to determine which codeword bits in the original codeword have been inverted.

需注意的是,對於正常的快閃記憶體220來說,其資料錯誤率約在1%以下,故在通道值CH_sgn的各個碼字位元是正確位元的機率相對較高。因此,針對先前碼字VN_prev中未被翻轉過的碼字位元,翻轉決定單元7131會使用翻轉策略查找表701並依據當前每個碼字位元之徵狀權重ws及上述閾值th以決定相應的翻轉策略,其中翻轉策略查找表701如表3所示。針對先前碼字VN_prev中已被翻轉過的碼字位元,翻轉決定單元7131會使用翻轉策略查找表702並依據當前每個碼字位元之徵狀權重ws及上述閾值th以決定相應的翻轉策略,其中翻轉策略查找表702如表4所示。      th ws 0 1 2 3 4 0 X W W W W 1 X W W W W 2 X X W W W 3 X X X W S 4 X X X W S 表3      th ws 0 1 2 3 4 0 X X W W W 1 X X X W W 2 X X X X W 3 X X X X W 4 X X X X S 表4 It should be noted that for the normal flash memory 220, the data error rate is about 1% or less, so the probability that each code word bit in the channel value CH_sgn is the correct bit is relatively high. Therefore, for the codeword bits that have not been flipped in the previous codeword VN_prev, the flipping determination unit 7131 will use the flipping strategy look-up table 701 and determine the corresponding value according to the current symptom weight ws of each codeword bit and the above threshold th. The rollover strategy in which the rollover strategy look-up table 701 is shown in Table 3. For the codeword bits that have been flipped in the previous codeword VN_prev, the flip determination unit 7131 will use the flip strategy lookup table 702 and determine the corresponding flip based on the current symptom weight ws of each codeword bit and the above threshold th Strategy, in which the rollover strategy look-up table 702 is shown in Table 4. th ws 0 1 2 3 4 0 X W W W W 1 X W W W W 2 X X W W W 3 X X X W S 4 X X X W S table 3 th ws 0 1 2 3 4 0 X X W W W 1 X X X W W 2 X X X X W 3 X X X X W 4 X X X X S Table 4

在此實施例中,相較於翻轉策略查找表701中所使用的翻轉策略,在翻轉策略查找表702中所使用的翻轉策略更為保守,意即翻轉策略查找表702中所使用的翻轉策略整體的翻轉階數會比翻轉策略查找表701整體的翻轉階數低。舉例來說,對於資料錯誤率很低的正常快閃記憶體220而言,若從快閃記憶體220所讀出的原始碼字(即通道值)中的碼字位元有錯誤的比例也很低。既然在此情況下,有部分碼字位元仍然被變數節點單元410進行位元翻轉,表示這些碼字位元相應的徵狀權重ws可能偏高,且若再進行較積極(aggressive)的翻轉策略,例如前述的強翻轉方式,則會有較大的機率會將碼字位元翻轉為實際上為錯誤的碼字位元。此時,翻轉錯誤的碼字位元仍然需要經過更多疊代次數才能進行更正,意即翻轉錯誤受到的懲罰(penalty)也較高,故會對已翻轉過的碼字位元採取較保守的翻轉策略,例如前述的弱翻轉或未動作方式。In this embodiment, compared to the flip strategy used in the flip strategy lookup table 701, the flip strategy used in the flip strategy lookup table 702 is more conservative, which means the flip strategy used in the flip strategy lookup table 702 The overall flip order will be lower than the overall flip order lookup table 701. For example, for a normal flash memory 220 with a very low data error rate, if the original codeword (ie, channel value) read from the flash memory 220 has an error ratio, Very low. Since in this case, some codeword bits are still bit flipped by the variable node unit 410, it means that the symptom weight ws corresponding to these codeword bits may be too high, and if more aggressive flipping is performed Strategies, such as the aforementioned strong reversal method, have a greater probability of reversing the codeword bits into codeword bits that are actually wrong. At this time, the codeword bits of the flipped error still need more iterations to be corrected, which means that the penalty for flipping errors is also higher, so the codeword bits that have been flipped will be more conservative The flip strategy, such as the aforementioned weak flip or no action mode.

位元翻轉電路7132係依據各碼字位元的查表結果DR以決定相應的碼字位元及其可靠度資訊R是否需要翻轉,並將進行位元翻轉後之更新碼字VN_new及更新可靠度資訊R_new儲存至變數節點記憶體2182。位元翻轉電路7132並計算在此次疊代運算所取得的先前碼字與上述更新碼字的碼字差值(codeword difference)Diff,例如為VN_next-VN_prev,並將上述碼字差值Diff傳送至檢查節點單元420。需注意的是,位元翻轉電路7132係將碼字差值傳送至檢查節點單元420,但位元翻轉電路7132並未將更新可靠度資訊R_new傳送至檢查節點單元420,而是將更新可靠度資訊R_new儲存至變數節點記憶體2182以供下一次疊代運算使用。The bit flip circuit 7132 determines whether the corresponding code bit and its reliability information R need to be flipped according to the table lookup result DR of each code word bit, and updates the code word VN_new after bit flipping and the update reliability The degree information R_new is stored in the variable node memory 2182. The bit flip circuit 7132 calculates the codeword difference Diff between the previous codeword obtained in this iterative operation and the updated codeword, for example, VN_next-VN_prev, and transmits the codeword difference Diff To check node unit 420. It should be noted that the bit flip circuit 7132 transmits the codeword difference to the check node unit 420, but the bit flip circuit 7132 does not transmit the update reliability information R_new to the check node unit 420, but updates the reliability. The information R_new is stored in the variable node memory 2182 for use in the next iteration operation.

在一些實施例中,第7圖中的徵狀權重加總單元711之功能係類似於第6圖中的徵狀權重加總單元611,其可依據來自檢查節點單元420所產生之徵狀值syndrome以及來自通道值記憶體2181的通道值CH_sgn以產生每個碼字位元相應的徵狀權重ws。In some embodiments, the function of the syndrome weight adding unit 711 in Figure 7 is similar to the syndrome weight adding unit 611 in Figure 6, which can be based on the syndrome value generated from the check node unit 420 syndrome and the channel value CH_sgn from the channel value memory 2181 to generate the syndrome weight ws corresponding to each code word bit.

此外,本發明第6圖及第7圖之實施例亦可以合併實施。舉例來說,在第6圖中可針對解碼器之不同的解碼目標而選擇不同的翻轉策略查找表,例如提高吞吐量(throughput)、提高校正率(correction rate)、或是降低功耗等等。加入第7圖之實施例的設計後,在第6圖中的不同的翻轉策略查找表均可再細分為針對未翻轉過的碼字位元的第一翻轉策略查找表以及針對已翻轉過的碼字位元的第二翻轉策略查找表。因此,上述實施方式可進一步增加解碼器215之效能。In addition, the embodiments of Fig. 6 and Fig. 7 of the present invention can also be implemented in combination. For example, in Figure 6, different flipping strategy lookup tables can be selected for different decoding goals of the decoder, such as increasing throughput, increasing correction rate, or reducing power consumption, etc. . After adding the design of the embodiment in Figure 7, the different flipping strategy lookup tables in Figure 6 can be subdivided into the first flipping strategy lookup table for the codeword bits that have not been flipped and the lookup table for the flipped codeword bits. The second flipping strategy lookup table for codeword bits. Therefore, the above implementation can further increase the performance of the decoder 215.

第8圖為依據本發明一實施例中之快閃記憶體的存取方法的流程圖。請同時參考第2圖及第8圖,快閃記憶體的存取方法的流程如下所述。第8圖中的快閃記憶體的存取方法例如在從快閃記憶體讀取資料時是使用策略基礎式(strategy-based)位元翻轉之LDPC解碼方法。FIG. 8 is a flowchart of a method for accessing a flash memory according to an embodiment of the present invention. Please refer to Fig. 2 and Fig. 8 at the same time. The procedure of the flash memory access method is as follows. The access method of the flash memory in Figure 8, for example, uses a strategy-based bit-reversal LDPC decoding method when reading data from the flash memory.

在步驟S805,經由一儲存程序將資料儲存至資料儲存裝置200之快閃記憶體220。舉例來說,上述儲存程序例如可將主機欲儲存至資料儲存裝置200的資料經過編碼流程(例如為LDPC編碼),並將編碼後的資料寫入至快閃記憶體220。In step S805, the data is stored in the flash memory 220 of the data storage device 200 through a storage procedure. For example, the above-mentioned storage process may pass the data that the host wants to store to the data storage device 200 through an encoding process (for example, LDPC encoding), and write the encoded data to the flash memory 220.

在步驟S810,變數節點單元410取得從資料儲存裝置200之一快閃記憶體220所讀取的一通道值。舉例來說,從步驟S810開始為記憶體控制器210從快閃記憶體220讀取資料所進行的解碼流程,且解碼流程係相對於上述編碼流程。In step S810, the variable node unit 410 obtains a channel value read from a flash memory 220 of the data storage device 200. For example, starting from step S810 is the decoding process performed by the memory controller 210 reading data from the flash memory 220, and the decoding process is relative to the encoding process described above.

在步驟S820,檢查節點單元420由變數節點單元410取得一碼字差值,並依據碼字差值計算一徵狀值(syndrome)。In step S820, the check node unit 420 obtains a codeword difference from the variable node unit 410, and calculates a syndrome according to the codeword difference.

在步驟S830,在每一次LDPC解碼疊代期間,變數節點單元410係執行步驟S832~S840。In step S830, during each iteration of LDPC decoding, the variable node unit 410 executes steps S832 to S840.

在步驟S832,判斷檢查節點單元420所產生的徵狀值是否為0。若徵狀值為0,則結束此次解碼流程。若徵狀值不為0,則繼續執行步驟S834。In step S832, it is determined whether the symptom value generated by the check node unit 420 is zero. If the symptom value is 0, the decoding process is ended. If the symptom value is not 0, continue to perform step S834.

在步驟S834,依據通道值及來自檢查節點單元420之徵狀值以決定一徵狀權重(syndrome weight)。其中,先前碼字中的各碼字位元均有相應的徵狀權重。In step S834, a syndrome weight is determined according to the channel value and the syndrome value from the check node unit 420. Among them, each codeword bit in the previous codeword has a corresponding symptom weight.

在步驟S836,取得一先前LDPC解碼疊代所產生的一先前碼字。舉例來說,在前次疊代所產生的更新碼字即為用於目前疊代中的先前碼字。In step S836, a previous codeword generated by a previous LDPC decoding iteration is obtained. For example, the updated codeword generated in the previous iteration is the previous codeword used in the current iteration.

在步驟S838,依據徵狀權重及一預定閾值以決定先前碼字之各碼字位元的一位元翻轉演算法之一翻轉策略,並依據翻轉策略以翻動先前碼字中之一或多個碼字位元以產生一更新碼字。舉例來說,翻轉決定單元6131包括一翻轉策略查找表601用以記錄不同數值的徵狀權重及預定閾值所對應的翻轉策略,其中翻轉策略包括強翻轉(strong flip)策略、弱翻轉(weak flip)策略及未動作策略,但本發明並不限於此。In step S838, a flip strategy of one bit flip algorithm of each codeword bit of the previous codeword is determined according to the symptom weight and a predetermined threshold, and one or more of the previous codewords are flipped according to the flip strategy The codeword bits are used to generate an updated codeword. For example, the flip decision unit 6131 includes a flip strategy look-up table 601 for recording different values of symptom weights and flip strategies corresponding to predetermined thresholds. The flip strategies include strong flip strategies and weak flip strategies. ) Strategy and non-action strategy, but the present invention is not limited to this.

在步驟S840,將更新碼字減去先前碼字以產生碼字差值。需注意的是,在進行上述位元翻轉的過程中,會連各碼字位元的可靠度資訊一併考慮並依據翻轉策略以進行位元翻轉,但是位元翻轉電路6132在將更新碼字減去先前碼字以產生碼字差值後,只將碼字差值傳送至檢查節點單元420,且更新碼字中之各碼字位元相應的可靠度資訊則會儲存至變數節點記憶體2182中。In step S840, the updated codeword is subtracted from the previous codeword to generate a codeword difference. It should be noted that in the above-mentioned bit flipping process, the reliability information of each codeword bit will be considered together and the bit flipping will be performed according to the flipping strategy, but the bit flipping circuit 6132 will update the codeword. After subtracting the previous codeword to generate the codeword difference, only the codeword difference is sent to the check node unit 420, and the reliability information corresponding to each codeword bit in the updated codeword is stored in the variable node memory 2182.

綜上所述,本發明係提供一種記憶體控制器及快閃記憶體的存取方法,其可讓使用位元翻轉(bit-flipper)之LDPC解碼器中的變數節點單元可執行可設定的解碼策略,例如可針對解碼器之不同的解碼目標進行設定,包括:提高吞吐量(throughput)、提高校正率(correction rate)、或是降低功耗等等。此外,本發明中之解碼器的變數節點單元可針對已翻轉過的碼字位元及未翻轉過的碼字位元分別選擇適合的翻轉策略查找表,進而提高解碼效能。In summary, the present invention provides a memory controller and flash memory access method, which allows the variable node unit in an LDPC decoder using bit-flipper to execute configurable The decoding strategy, for example, can be set for different decoding goals of the decoder, including: increasing throughput, increasing correction rate, or reducing power consumption, etc. In addition, the variable node unit of the decoder in the present invention can select appropriate flipping strategy lookup tables for the codeword bits that have been flipped and the codeword bits that have not been flipped, thereby improving decoding performance.

本發明雖以較佳實施例揭露如上,然其並非用以限定本發明的範圍,任何所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可做些許的更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention is disclosed as above in a preferred embodiment, it is not intended to limit the scope of the present invention. Anyone with ordinary knowledge in the relevant technical field can make slight changes and modifications without departing from the spirit and scope of the present invention. Retouching, therefore, the scope of protection of the present invention shall be subject to the scope of the attached patent application.

200:資料儲存裝置 210:記憶體控制器 211:處理單元 212:儲存單元 213:啟動程式 214:編碼器 215:解碼器 216:控制邏輯 218:緩衝記憶體 2181:通道值記憶體 2182:變數節點記憶體 220:快閃記憶體 230:主機 240:實體區塊 241:實體頁面 250、252:存取介面 410:變數節點單元 420:檢查節點單元 511、611、711:徵狀權重加總單元 512、612、712:閾值計算單元 513、613、713:翻轉單元 5131:比較器 6131、7131:翻轉決定單元 5132、6132、7132:位元翻轉電路 601、701、702:翻轉策略查找表 S805-S840:步驟 H:同位元檢查矩陣 c:列數 t:行數 M、K、P:矩陣 K -1:反矩陣 syndrome:徵狀值 CH_sgn:通道值 ws:權重 th:閾值 Diff:碼字差值 VN_prev:先前碼字 VN_new:更新碼字 C1-C4:檢查節點 V1-V7:變數節點 S1、S0、W1、W0:狀態200: data storage device 210: memory controller 211: processing unit 212: storage unit 213: startup program 214: encoder 215: decoder 216: control logic 218: buffer memory 2181: channel value memory 2182: variable node Memory 220: Flash memory 230: Host 240: Physical block 241: Physical page 250, 252: Access interface 410: Variable node unit 420: Check node unit 511, 611, 711: Symptom weight summing unit 512 , 612, 712: threshold calculation unit 513, 613, 713: flip unit 5131: comparator 6131, 7131: flip decision unit 5132, 6132, 7132: bit flip circuit 601, 701, 702: flip strategy lookup table S805-S840 : Step H: Parity check matrix c: Number of columns t: Number of rows M, K, P: Matrix K -1 : Inverse matrix syndrome: Symptom value CH_sgn: Channel value ws: Weight th: Threshold Diff: Code word difference VN_prev: previous code word VN_new: update code word C1-C4: check node V1-V7: variable node S1, S0, W1, W0: status

第1A圖係為同位元檢查矩陣的示意圖。 第1B圖係為坦納圖(Tanner Graph)的示意圖。 第2圖為依據本發明一實施例的資料儲存裝置的方塊圖。 第3圖為查核碼檢查矩陣及查核碼產生矩陣的示意圖。 第4圖為依據本發明一實施例中之解碼器215的方塊圖。 第5圖為依據本發明之第一實施例中的變數節點單元的方塊圖。 第6A圖為依據本發明之第二實施例中的變數節點單元的方塊圖。 第6B圖為依據本發明之第二實施例中翻轉策略的邏輯狀態的示意圖。 第7圖為依據本發明之第三實施例中的變數節點單元的方塊圖。 第8圖為依據本發明一實施例中之快閃記憶體的存取方法的流程圖。 Figure 1A is a schematic diagram of the parity check matrix. Figure 1B is a schematic diagram of the Tanner Graph. FIG. 2 is a block diagram of a data storage device according to an embodiment of the invention. Figure 3 is a schematic diagram of a check code check matrix and a check code generation matrix. Figure 4 is a block diagram of the decoder 215 in an embodiment according to the present invention. Figure 5 is a block diagram of the variable node unit in the first embodiment of the present invention. FIG. 6A is a block diagram of the variable node unit in the second embodiment of the present invention. FIG. 6B is a schematic diagram of the logic state of the flip strategy according to the second embodiment of the present invention. Fig. 7 is a block diagram of the variable node unit in the third embodiment of the present invention. FIG. 8 is a flowchart of a method for accessing a flash memory according to an embodiment of the present invention.

200:資料儲存裝置 200: Data storage device

210:記憶體控制器 210: Memory Controller

211:處理單元 211: Processing Unit

212:儲存單元 212: storage unit

213:啟動程式 213: Start the program

214:編碼器 214: encoder

215:解碼器 215: decoder

216:控制邏輯 216: control logic

218:緩衝記憶體 218: buffer memory

2181:通道值記憶體 2181: Channel value memory

2182:變數節點記憶體 2182: Variable node memory

220:快閃記憶體 220: flash memory

230:主機 230: host

240:實體區塊 240: physical block

241:實體頁面 241: Entity page

250、252:存取介面 250, 252: Access interface

Claims (12)

一種記憶體控制器,用於一資料儲存裝置,該記憶體控制器包括: 一變數節點單元,用以取得從該資料儲存裝置之一快閃記憶體所讀取的一通道值;以及 一檢查節點單元,用以由該變數節點單元取得一碼字差值,並依據該碼字差值計算一徵狀值(syndrome); 其中,在每次低密度同位元查核碼(LDPC)解碼疊代之期間,該變數節點單元係執行: 依據該通道值及來自該檢查節點單元之該徵狀值以決定一徵狀權重(syndrome weight); 取得一先前LDPC解碼疊代所產生的一先前碼字; 依據該記憶體控制器之一解碼目標從複數個翻轉策略查找表中取得一第一翻轉策略查找表; 依據該徵狀權重、一預定閾值及該第一翻轉策略查找表以決定該先前碼字之各碼字位元的一位元翻轉(bit-flipping)演算法之一翻轉策略,並依據該翻轉策略以翻動該先前碼字中之一或多個碼字位元以產生一更新碼字;以及 將該更新碼字減去該先前碼字以產生該碼字差值。 A memory controller for a data storage device, the memory controller includes: A variable node unit for obtaining a channel value read from a flash memory of the data storage device; and A check node unit for obtaining a codeword difference from the variable node unit, and calculating a syndrome according to the codeword difference; Among them, during each iteration of low-density parity check code (LDPC) decoding, the variable node unit executes: Determine a syndrome weight based on the channel value and the syndrome value from the check node unit; Obtain a previous codeword generated by a previous LDPC decoding iteration; Obtaining a first flipping strategy lookup table from a plurality of flipping strategy lookup tables according to a decoding target of the memory controller; According to the symptom weight, a predetermined threshold, and the first flipping strategy look-up table to determine a bit-flipping algorithm for each bit-flipping algorithm of the previous codeword, and according to the flipping Strategy to flip one or more codeword bits in the previous codeword to generate an updated codeword; and The updated codeword is subtracted from the previous codeword to generate the codeword difference. 如申請專利範圍第1項所述的記憶體控制器,其中該等翻轉策略查找表所使用的翻轉階數包含第一翻轉階數、第二翻轉階數及第三翻轉階數,且該等翻轉策略查找表所使用的LDPC疊代次數包含第一疊代次數、第二疊代次數及第三疊代次數, 其中該第一翻轉階數大於該第二翻轉階數,且該第二翻轉階數大於該第三翻轉階數, 其中該第一疊代次數大於該第二疊代次數,且該第二疊代次數大於該第三疊代次數。 For the memory controller described in item 1 of the scope of patent application, wherein the flipping order used in the flipping strategy look-up tables includes a first flipping order, a second flipping order, and a third flipping order, and these The number of LDPC iterations used in the flip strategy lookup table includes the first iteration, the second iteration, and the third iteration. Wherein the first flip order is greater than the second flip order, and the second flip order is greater than the third flip order, Wherein the first iteration number is greater than the second iteration number, and the second iteration number is greater than the third iteration number. 如申請專利範圍第2項所述的記憶體控制器,其中當該解碼目標為提高吞吐量,該第一翻轉策略查找表係使用該第一翻轉階數以及該第三疊代次數。The memory controller according to the second item of the scope of patent application, wherein when the decoding goal is to improve throughput, the first flipping strategy look-up table uses the first flipping order and the third iteration number. 如申請專利範圍第2項所述的記憶體控制器,其中當該解碼目標為提高校正率,該第一翻轉策略查找表係使用該第二翻轉階數以及該第一疊代次數。The memory controller described in item 2 of the scope of patent application, wherein when the decoding goal is to increase the correction rate, the first flip strategy look-up table uses the second flip order and the first iteration number. 如申請專利範圍第2項所述的記憶體控制器,其中當該解碼目標為降低功耗,該第一翻轉策略查找表係使用該第三翻轉階數以及該第三疊代次數。For the memory controller described in item 2 of the scope of patent application, when the decoding goal is to reduce power consumption, the first flip strategy look-up table uses the third flip order and the third iteration number. 如申請專利範圍第1項所述的記憶體控制器,其中該變數節點單元更依據該翻轉策略以翻動該先前碼字中之一或多個碼字位元以及各碼字位元相應的可靠度資訊以產生該更新碼字及該更新碼字中之各碼字位元相應的該可靠度資訊,並將該更新碼字及該更新碼字中之各碼字位元相應的該可靠度資訊儲存至一變數節點記憶體以用於下一次LDPC解碼疊代。For example, the memory controller described in item 1 of the scope of patent application, wherein the variable node unit further flips one or more codeword bits in the previous codeword according to the flipping strategy and the corresponding reliability of each codeword bit Degree information to generate the update codeword and the reliability information corresponding to each codeword bit in the update codeword, and the reliability information corresponding to the update codeword and each codeword bit in the update codeword The information is stored in a variable node memory for the next iteration of LDPC decoding. 一種快閃記憶體的存取方法,應用於一資料儲存裝置中的一記憶體控制器,該方法包括: 經由一儲存程序將資料儲存至該資料儲存裝置之一快閃記憶體; 取得從該快閃記憶體所讀取的一通道值; 取得一碼字差值,並依據該碼字差值計算一徵狀值(syndrome);以及 在每次低密度同位元查核碼(LDPC)解碼疊代之期間,執行下列步驟: 依據該通道值及該徵狀值以決定一徵狀權重(syndrome weight); 取得一先前LDPC解碼疊代所產生的一先前碼字; 依據該記憶體控制器之一解碼目標從複數個翻轉策略查找表中取得一第一翻轉策略查找表; 依據該徵狀權重、一預定閾值及該第一翻轉策略查找表以決定該先前碼字之各碼字位元的一位元翻轉(bit-flipping)演算法之一翻轉策略,並依據該翻轉策略以翻動該先前碼字中之一或多個碼字位元以產生一更新碼字;以及 將該更新碼字減去該先前碼字以產生該碼字差值。 A method for accessing flash memory is applied to a memory controller in a data storage device. The method includes: Store data to a flash memory of the data storage device through a storage procedure; Obtain a channel value read from the flash memory; Obtain a codeword difference, and calculate a syndrome according to the codeword difference; and During each iteration of low-density parity check code (LDPC) decoding, perform the following steps: Determine a syndrome weight based on the channel value and the symptom value; Obtain a previous codeword generated by a previous LDPC decoding iteration; Obtaining a first flipping strategy lookup table from a plurality of flipping strategy lookup tables according to a decoding target of the memory controller; According to the symptom weight, a predetermined threshold, and the first flipping strategy look-up table to determine a bit-flipping algorithm for each bit-flipping algorithm of the previous codeword, and according to the flipping Strategy to flip one or more codeword bits in the previous codeword to generate an updated codeword; and The updated codeword is subtracted from the previous codeword to generate the codeword difference. 如申請專利範圍第7項所述之快閃記憶體的存取方法,其中該等翻轉策略查找表所使用的翻轉階數包含第一翻轉階數、第二翻轉階數及第三翻轉階數,且該等翻轉策略查找表所使用的LDPC疊代次數包含第一疊代次數、第二疊代次數及第三疊代次數, 其中該第一翻轉階數大於該第二翻轉階數,且該第二翻轉階數大於該第三翻轉階數, 其中該第一疊代次數大於該第二疊代次數,且該第二疊代次數大於該第三疊代次數。 For the flash memory access method described in item 7 of the scope of patent application, wherein the flip order used in the flip strategy look-up tables includes the first flip order, the second flip order, and the third flip order , And the number of LDPC iterations used in these flipping strategy lookup tables includes the first iteration, the second iteration and the third iteration Wherein the first flip order is greater than the second flip order, and the second flip order is greater than the third flip order, Wherein the first iteration number is greater than the second iteration number, and the second iteration number is greater than the third iteration number. 如申請專利範圍第8項所述之快閃記憶體的存取方法,其中當該解碼目標為提高吞吐量,該第一翻轉策略查找表係使用該第一翻轉階數以及該第三疊代次數。The method for accessing flash memory as described in item 8 of the scope of patent application, wherein when the decoding goal is to improve throughput, the first flipping strategy look-up table uses the first flipping order and the third iteration frequency. 如申請專利範圍第8項所述之快閃記憶體的存取方法,其中當該解碼目標為提高校正率,該第一翻轉策略查找表係使用該第二翻轉階數以及該第一疊代次數。The flash memory access method described in item 8 of the scope of patent application, wherein when the decoding goal is to improve the correction rate, the first flip strategy look-up table uses the second flip order and the first iteration frequency. 如申請專利範圍第8項所述之快閃記憶體的存取方法,其中當該解碼目標為降低功耗,該第一翻轉策略查找表係使用該第三翻轉階數以及該第三疊代次數。The method for accessing flash memory as described in item 8 of the scope of patent application, wherein when the decoding goal is to reduce power consumption, the first flip strategy look-up table uses the third flip order and the third iteration frequency. 如申請專利範圍第7項所述之快閃記憶體的存取方法,更包括: 依據該翻轉策略以翻動該先前碼字中之一或多個碼字位元以及各碼字位元相應的可靠度資訊以產生該更新碼字及該更新碼字中之各碼字位元相應的該可靠度資訊;以及 將該更新碼字及該更新碼字中之各碼字位元相應的該可靠度資訊儲存至一變數節點記憶體以用於下一次LDPC解碼疊代。 The flash memory access method described in item 7 of the scope of patent application further includes: According to the flipping strategy, one or more codeword bits in the previous codeword and the reliability information corresponding to each codeword bit are flipped to generate the updated codeword and the corresponding codeword bits in the updated codeword The reliability information of; and The updated codeword and the reliability information corresponding to each codeword bit in the updated codeword are stored in a variable node memory for the next LDPC decoding iteration.
TW109116126A 2019-12-09 2019-12-09 Memory controller and method of accessing flash memory TWI718060B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109116126A TWI718060B (en) 2019-12-09 2019-12-09 Memory controller and method of accessing flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109116126A TWI718060B (en) 2019-12-09 2019-12-09 Memory controller and method of accessing flash memory

Publications (2)

Publication Number Publication Date
TWI718060B true TWI718060B (en) 2021-02-01
TW202123241A TW202123241A (en) 2021-06-16

Family

ID=75745678

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109116126A TWI718060B (en) 2019-12-09 2019-12-09 Memory controller and method of accessing flash memory

Country Status (1)

Country Link
TW (1) TWI718060B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI812411B (en) * 2022-08-18 2023-08-11 慧榮科技股份有限公司 Memory controller and method for bit flipping in low density parity codes

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117631962A (en) 2022-08-18 2024-03-01 慧荣科技股份有限公司 Memory controller and access method of flash memory

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090282319A1 (en) * 2008-05-09 2009-11-12 Samsung Electronics Co., Ltd. Hierarchical decoding apparatus
US8627188B2 (en) * 2007-12-05 2014-01-07 Densbits Technologies Ltd. Flash memory apparatus and methods using a plurality of decoding stages including optional use of concatenated BCH codes and/or designation of “first below” cells
US8677225B1 (en) * 2011-02-11 2014-03-18 Marvell International Ltd. Low-density parity-check decoder
TWI652677B (en) * 2017-11-29 2019-03-01 群聯電子股份有限公司 Decoding method, memory storage device and memory control circuit unit

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8627188B2 (en) * 2007-12-05 2014-01-07 Densbits Technologies Ltd. Flash memory apparatus and methods using a plurality of decoding stages including optional use of concatenated BCH codes and/or designation of “first below” cells
US20090282319A1 (en) * 2008-05-09 2009-11-12 Samsung Electronics Co., Ltd. Hierarchical decoding apparatus
US8677225B1 (en) * 2011-02-11 2014-03-18 Marvell International Ltd. Low-density parity-check decoder
US8996972B1 (en) * 2011-02-11 2015-03-31 Marvell International Ltd. Low-density parity-check decoder
TWI652677B (en) * 2017-11-29 2019-03-01 群聯電子股份有限公司 Decoding method, memory storage device and memory control circuit unit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI812411B (en) * 2022-08-18 2023-08-11 慧榮科技股份有限公司 Memory controller and method for bit flipping in low density parity codes

Also Published As

Publication number Publication date
TW202123241A (en) 2021-06-16

Similar Documents

Publication Publication Date Title
TWI697000B (en) Memory controller and method of accessing flash memory
TWI697907B (en) Memory controller and method of accessing flash memory
US9471421B2 (en) Data accessing method, memory storage device and memory controlling circuit unit
US20150169406A1 (en) Decoding techniques for a data storage device
US10103748B2 (en) Decoding method, memory control circuit unit and memory storage device
US20150293811A1 (en) Decoding method, memory storage device and memory controlling circuit unit
US9274891B2 (en) Decoding method, memory storage device, and memory controlling circuit unit
US9553608B2 (en) Data storage device decoder and method of operation
US20170134049A1 (en) Decoding method, memory storage device and memory control circuit unit
CN111726121B (en) Error correction decoder and memory system having the same
TWI718060B (en) Memory controller and method of accessing flash memory
US10193569B2 (en) Decoding method, memory storage device and memory control circuit unit
CN110535476B (en) Method, device, computer equipment and storage medium for optimizing soft information storage of LDPC soft decoder
US9236886B1 (en) Universal and reconfigurable QC-LDPC encoder
US10700708B2 (en) Permutation network designing method, and permutation circuit of QC-LDPC decoder
CN108665940B (en) ECC encoding circuit, decoding circuit and memory controller
TWI831333B (en) Memory controller and method for accessing flash memory
TWI812411B (en) Memory controller and method for bit flipping in low density parity codes
TWI836558B (en) Memory controller and method for controlling data in decoding pipeline
US11876535B1 (en) Memory controller and method for controlling data in decoding pipeline
US11901912B1 (en) Memory controller and method of accessing flash memory
TW202013192A (en) Decoder design method and storage controller
TW202409837A (en) Memory controller and method for accessing flash memory
TW202410053A (en) Memory controller and method for controlling data in decoding pipeline
TW202410043A (en) Memory controller and method for bit flipping in low density parity codes