A method for constructing optimal probability distribution constrained codes for ReRAM memories
By constructing a coding matrix using the optimal probability distribution constraint code method, the coding matrix is constructed using the principle of maximizing information entropy and the Lagrange multiplier method. The distribution of 0 and 1 in the ReRAM memory is adjusted to solve the hidden path problem and improve the accuracy of data reading and the efficiency of signal transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2026-03-27
AI Technical Summary
ReRAM memory suffers from the problem of through-path in high-density integration, which leads to current leakage and reduced data reliability during the reading process. Existing polar code encoding schemes have failed to effectively solve the optimization problem of the 0.1 distribution of the encoded matrix.
The optimal probability distribution constraint code construction method is adopted. The coding matrix is constructed by maximizing information entropy and Lagrange multiplier method, the 0 and 1 distribution is adjusted, and the coding matrix is optimized by bit flipping scheme to ensure that the density of 1 after coding is less than that of the original array, thereby reducing the occurrence of hidden paths.
It effectively reduces the occurrence of through paths, improves signal transmission efficiency and quality, reduces the probability of recovery errors, and enhances the detection accuracy and hardware implementation efficiency of ReRAM memory.
Smart Images

Figure CN120808844B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of optimization of new memory, and particularly relates to a method for constructing an optimal probability distribution constraint code suitable for a ReRAM memory. BACKGROUND
[0002] ReRAM combines the advantages of traditional random memory and flash memory, and has the characteristics of simple and fast read-write operation, low power consumption and high storage density. The core structure is a cross array composed of memristors, and each memristor unit at the intersection of each row and column can store data, thereby realizing higher storage density on the same chip area. This feature makes ReRAM have great application potential in the fields of non-volatile memory, artificial neural network, chaotic circuit, programmable logic device, and information processing and pattern recognition circuit. However, the high-density integration of ReRAM also brings serious data interference problems, of which the most prominent is the sneak path problem. The sneak path refers to a closed path formed by traversing the logic 1 unit through alternating vertical and horizontal steps in the ReRAM cross array. This path will cause current leakage during the reading process, thereby interfering with the reading result of the target unit and reducing the reliability of the data. In order to solve this problem, a memristor string selector is often used to avoid current interference between different units. However, during the manufacturing and maintenance of the memory, the non-deterministic failure of the selector will bring new problems of mutual interference between array resistances, and therefore, a more perfect solution is needed to solve the storage non-deterministic problem in the entire array.
[0003] The storage process of ReRAM is realized by changing the resistance value of the memristor in the cross array: in the writing process, logic 0 is programmed as a high resistance value (R0), and logic 1 is programmed as a low resistance value (R1); in the reading process, the resistance state is detected by applying a specific voltage and measuring the current, so as to judge the stored data bit. The existence of the sneak path will significantly affect the accuracy of the reading process, and in practice, the sneak path more affects the units stored as 0 in the array. In short, adjusting the proportion of actual data 0,1 stored in the array can affect the occurrence of the sneak path to a certain extent.
[0004] The use of polar code can correct the errors that have occurred in the entire array transmission, and adjusting the proportion of 0.1 in the entire coding array actual storage can greatly reduce the occurrence of potential paths in the array, thereby reducing errors in the decoding process from the source. In the polar code encoding process, the information bits and frozen bits are combined and then linearly transformed. The frozen bits are usually fixed 0, and the information bits can be any data. If the selection of information bits is uniformly distributed, such as equal probability of 0 and 1, the entire coded codeword will have a certain balance. In fact, the proportion of 0.1 in the coding output of the polar code encoding scheme used at present is generally balanced, that is, fluctuates around 0.5. Constrained coding is an effective method to avoid or reduce potential path interference and other errors in data transmission and storage process by carefully designing coding rules. The constrained coding scheme can ensure fast exchange of data under a certain accuracy. For ReRAM, as a high-speed storage medium, it is necessary to ensure fast exchange of data under a certain accuracy. However, due to the particularity of its structure, the correctness of the readout of the stored data is closely related to the pattern of the stored data caused by the potential path problem, and the switching time of ReRAM obeys the logarithmic normal distribution, and frequent switching may cause more errors. The application of polar code to ReRAM array lacks an effective scheme that considers the distribution of 0.1 in the matrix after coding. SUMMARY
[0005] To solve the above technical problems, the present application provides a method for constructing an optimal probability distribution constrained code suitable for ReRAM memory, which can reduce the occurrence of potential paths and also adapt to the polar code which can still correct errors in the entire channel after the occurrence of potential paths.
[0006] To achieve the above purpose, the present application provides a method for constructing an optimal probability distribution constrained code suitable for ReRAM memory, comprising:
[0007] According to the matrix construction scheme of the maximum information entropy principle, an initial coding matrix is constructed, the distribution of 0 and 1 in the entire transmission array is adjusted, and a coding matrix is obtained;
[0008] According to the coding matrix, the original binary data matrix is multiplied with the coding matrix in the GF(2) domain to generate a latest coding matrix;
[0009] According to the latest coding matrix, the weight of each row of data is counted, and the row with a weight greater than a threshold is flipped to 0.1, and a flag bit is added to record the condition of each row to generate a codeword;
[0010] The codeword is detected, and the detected codeword is decoded to obtain the original input array.
[0011] Optionally, the initial encoding matrix is constructed according to a matrix construction scheme based on the principle of maximizing information entropy, and the distribution of 0 and 1 in the entire transmission array is adjusted to obtain the encoding matrix, including:
[0012] S1, by optimizing the Lagrange multiplier, modeling the probability distribution, so that the expected value of row and column meets the constraint condition;
[0013] S2, input parameters row number m, column number n, row density ratio p, column density ratio q, learning rate α,β, and initialize the Lagrange multiplier, row multiplier λ=0, column multiplier μ=0;
[0014] S3, define the probability of the element as a normalized exponential distribution;
[0015] S4, adjust by gradient ascent, so that the probability sum of each row approaches k=p : ; adjust by gradient ascent, so that the probability sum of each column approaches : ; stop when the multiplier change is less than the threshold or the maximum iteration number is reached;
[0016] S5, based on the optimized probability distribution, generate the matrix row by row, and ensure that the column density constraint is not violated;
[0017] S6, initialize the column weight counter to have ; for the ith row, filter the columns that meet , calculate the non-normalized probability of available columns based on and , and normalize it to the probability distribution;
[0018] S7, select k=p columns from according to the probability distribution, and avoid repeated selection; after selecting one column each time, update the probability distribution of the remaining columns; update the matrix and column weight;
[0019] S8, after all rows are processed, output the matrix X.
[0020] Optionally, for rows with weights greater than the threshold, 0.1 flipping includes:
[0021] S1, traverse the latest encoding matrix row by row;
[0022] S2, extract the current row data, and for each current processing row, store all elements of the current row in a temporary variable;
[0023] S3, extract the data in the temporary variable, count the sum of all elements in the current row, if the sum exceeds m / 2, execute the element flipping, take the complement of all elements in the row, and convert to double precision type;
[0024] S4, the row data record flag bit is 1 for the 0, 1 flipped row, and the data flag bit is recorded as 0 without experiencing flipping;
[0025] S5, store the processed row data into the corresponding row of the new matrix;
[0026] S6, the output result includes two parts, the first part is the processed matrix, used for storing the processed results of all rows, and the second part is the flipping mark array, used for recording which row is flipped in the whole row because the number of 1 in the actual data to be stored in the row exceeds half of the total number of data in the row.
[0027] The technical effect of the present application is that the present application discloses a kind of optimal probability distribution constraint code construction method suitable for ReRAM memory, based on the constraint code construction system of ReRAM channel, the basic original of construction is maximum entropy principle, coding matrix is constructed using Lagrange multiplier method, and coding scheme that can adjust 0.1 distribution in array as a whole is obtained. After that, for the problem of excessive weight in part of row in array, bit flipping scheme is adopted, to ensure that the density of 1 in the array after experiencing coding is less than the density of 1 in the original array. Through iteration, the optimal coding scheme is selected, which more accurately adapts to the specific characteristics of ReRAM channel, maximally reduces the possibility of potential path occurrence in array, while ensuring less redundancy, as far as possible, reduces the probability of error recovery in the whole array, improves the efficiency and quality of signal transmission. BRIEF DESCRIPTION OF DRAWINGS
[0028] The drawings constituting a part of the present application are used to provide further understanding of the present application, the illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute improper limitation on the present application. In the drawings:
[0029] Figure 1 It is a flowchart of the optimal probability distribution constraint code construction method suitable for ReRAM memory of the embodiment of the present application;
[0030] Figure 2 It is a simulation result schematic diagram of the constraint code construction method suitable for ReRAM of the embodiment of the present application, n is 64;
[0031] Figure 3 It is a simulation result schematic diagram of the constraint code construction method suitable for ReRAM of the embodiment of the present application, n is 256. DETAILED DESCRIPTION
[0032] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other in the case of no conflict. The present application will be described in detail below with reference to the drawings and in combination with the embodiments.
[0033] It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0034] As Figure 1 shown, the embodiment provides a method for constructing an optimal probability distribution constraint code suitable for ReRAM memory, which includes:
[0035] S1, using the matrix construction scheme of the maximum information entropy principle to construct the encoding matrix, adjusting the distribution of 0 and 1 in the entire transmission array;
[0036] S2, using the obtained encoding matrix, performing matrix multiplication on the original binary data matrix X and the encoding matrix M in the GF(2) domain to generate the encoding matrix .
[0037] S3, according to the obtained matrix, the weight of the data of each row is counted, and the row whose weight is greater than the threshold is flipped by 0.1, and then a mark bit is added to record the condition of each row.
[0038] Considering the influence of the transmission array structure on the entire detection decoding result, the mark bit is transmitted separately in this example. The encoded data is sent to the channel for transmission.
[0039] S4, the receiving end of the channel detects the received code word, and then decodes to obtain the original input array.
[0040] In the specific implementation process, the Lagrange multiplier method is used to construct the encoding matrix, which can reduce the proportion of 1 in the original array as much as possible. While keeping a low calculation complexity, the scheme can reduce the occurrence of potential paths and improve the accuracy of the entire array detection. A simple hard decision scheme is used in decoding, which can reduce the decoding delay and is more suitable for hardware implementation. At the same time, a dynamic column density balancing algorithm is used to select column allocation through weight probability sampling to avoid local over-dense or over-sparse; row and column constraint tolerances are introduced to allow small fluctuations to improve generation efficiency.
[0041] More specifically, as Figure 2 shown, step S1 specifically includes the following steps:
[0042] Iterative optimization phase: by optimizing the Lagrange multipliers (λ, μ), the probability distribution is modeled to make the expected value of the row and column meet the constraint condition.
[0043] Parameter initialization: input parameters: m (number of rows), n (number of columns), p (row density ratio), q (column density ratio), learning rates a, b. And initialize Lagrange multipliers l = 0 (row multiplier), m = 0 (column multiplier).
[0044] Probability modeling: define the probability of element as a normalized exponential distribution:
[0045] ;
[0046] ;
[0047] where Z is a normalization factor, ensuring that the sum of all probabilities is 1.
[0048] Multiplier update: first row multiplier update: adjust by gradient ascent so that the probability sum of each row approaches k = p : . Then update the column multiplier: similarly adjust so that the probability sum of each column approaches : .
[0049] Stop when the multiplier change is less than the threshold or the maximum number of iterations is reached.
[0050] Then generate the matrix row by row based on the optimized probability distribution, ensuring that the column density constraint is not violated.
[0051] First, initialize the column weight counter to have (record the number of 1s placed in each column).
[0052] Then generate row by row: for the ith row, first determine the available column set : filter the columns that satisfy .
[0053] Then calculate the probability distribution: based on and calculate the non-normalized probability of available columns: , normalized to the probability distribution probs.
[0054] Then do non-replacement sampling: select k = p columns from according to probs, avoiding repeated selection.
[0055] After each column is selected, update the probability distribution of the remaining columns (re-normalize).
[0056] Update the matrix and column weight: set the selected column to 1 and update .
[0057] Wait until all rows are processed, output the matrix X.
[0058] Step S2, adjust the storage structure of the entire storage array according to the generated weight constraint matrix. At the same time, a dynamic column density balancing algorithm is adopted to select column distribution through weight probability sampling, avoiding local over-dense or over-sparse; a row and column constraint tolerance (such as tolerance = 1e-3) is introduced to allow small fluctuations to improve generation efficiency.
[0059] Step S21, parameter initialization and constraint configuration:
[0060] Set the matrix size m, row density p and column density q, satisfying m*p = n*q, to ensure the compatibility of row and column constraints; at the same time, define the channel noise standard deviation range σ, the selector failure probability P_fail, the high and low resistance values r0 and r1.
[0061] Step S2, reversible sparse matrix generation, generate a binary matrix M that satisfies sparsity and reversibility through an iterative optimization algorithm:
[0062] Initialize a random binary matrix, fill it by row to meet the row density p;
[0063] Dynamically exchange row / column elements to balance the column density q, and use weight probability sampling to optimize the distribution;
[0064] Verify the reversibility of the matrix based on the Gaussian elimination method, if it is not reversible, regenerate until the maximum number of attempts is reached.
[0065] Step S3, encoding and channel transmission. Sparse encoding: perform matrix multiplication on the original binary data matrix X and the sparse matrix M in the GF(2) field to generate the encoded matrix ;
[0066] Channel modeling: resistance model: simulate the hardware transmission characteristics based on r0 (high resistance state), r1 (low resistance state) and selector failure probability P_fail; noise injection: superimpose Gaussian noise N(0, σ²) to generate the received signal y.
[0067] Step S4, MAP detection: based on the received signal y, use maximum a posteriori probability estimation to estimate the original bit value;
[0068] Sparse decoding: perform GF(2) multiplication operation on the decoded matrix Y' and the sparse inverse matrix to restore the original data .
[0069] Perform simulation experiments to verify the performance of the encoding scheme.
[0070] As Figures 2-3 shown, the provided constraint code scheme is superior to the uncoded array in terms of FER. Figure 2 Simulation results of the constraint code construction method suitable for ReRAM with n being 64, Figure 3 Simulation results of the constraint code construction method suitable for ReRAM with n being 256. The performance improvement is attributed to the characteristics of the ReRAM array, and the factor affecting whether the array will have a detection error is the occurrence of a sneak path. The necessary condition for the occurrence of a sneak path requires that the data stored at the position of the selector failure node must be 1, and there is a low resistance storage at the corresponding position. By adjusting the proportion of 1 in the actual array, the possibility of the occurrence of a sneak path in the entire array is reduced, which brings performance gain.
[0071] The application discloses a constraint code construction method suitable for ReRAM memory, a constraint code construction system based on ReRAM channel, and a basic original for construction. The basic original is the maximum entropy principle, a Lagrange multiplier method is used to construct an encoding matrix, and an encoding scheme that can adjust the distribution of 0.1 in the array as a whole is obtained. Then, for the problem of excessive weight in part of the rows in the array, a bit flipping scheme is adopted to ensure that the density of 1 in the array after encoding is less than the density of 1 in the original array. Through iteration, the optimal encoding scheme is selected to more accurately adapt to the specific characteristics of the ReRAM channel, to maximize the possibility of the occurrence of a sneak path in the array, to reduce the probability of a recovery error in the entire array as much as possible while ensuring a small amount of redundancy, and to improve the efficiency and quality of signal transmission.
[0072] The above is only a preferred specific embodiment of the application, but the protection scope of the application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the application, which should be covered in the protection scope of the application. Therefore, the protection scope of the application should be subject to the protection scope of the claims.
Claims
1. A method for constructing optimal probability distribution constraint codes suitable for ReRAM memory, characterized in that, include: An initial coding matrix is constructed based on the matrix construction scheme of maximizing information entropy. The distribution of 0 and 1 in the entire transmission array is adjusted to obtain the coding matrix. Based on the encoding matrix, the original binary data matrix and the encoding matrix are multiplied in the GF(2) field to generate the latest encoding matrix; The weight of each row of data is statistically analyzed based on the latest encoding matrix. For rows with a weight greater than the threshold, the weight is flipped by 0.1, a marker bit is added to record the situation of each row, and codewords are generated. The codewords are detected, and the detected codewords are decoded to obtain the original input array; An initial coding matrix is constructed based on the matrix construction scheme of maximizing information entropy. The 0,1 distribution in the entire transmission array is adjusted to obtain the coding matrix, which includes: S1. By optimizing the Lagrange multipliers, model the probability distribution so that the expectations of rows and columns satisfy the constraints. S2. Input parameters: number of rows m, number of columns n, row density ratio p, column density ratio q, learning rate α, β, and initialize Lagrange multipliers, with row multiplier λ=0 and column multiplier μ=0. S3. Define the probability of an element as a normalized exponential distribution; S4. Adjustment via gradient ascent This makes the sum of probabilities in each row approximate k=p. : Adjusting via gradient ascent This makes the sum of probabilities in each column approximate : The iteration stops when the change in the multiplier is less than the threshold or the maximum number of iterations is reached. S5. Based on the optimized probability distribution, generate a matrix row by row to ensure that the column density constraint is not violated; S6. Initialize column weight counters. For the i-th row, filter to satisfy... The column, based on and Calculate the unnormalized probability of the available columns and normalize it to a probability distribution; S7, from Choose k=p according to probability distribution Each column is selected to avoid duplicate selections; after each column is selected, the probability distribution of the remaining columns is updated; the matrix and column weights are updated. S8. After all rows have been processed, output matrix X.
2. The method for constructing optimal probability distribution constraint codes for ReRAM memory as described in claim 1, characterized in that, For rows with a weight greater than the threshold, a 0.1 flip is performed, including: S1. Traverse the latest encoding matrix row by row; S2. Extract the data of the current row. For each currently processed row, store all elements of the current row into a temporary variable. S3. Extract the data from the temporary variable and calculate the sum of all elements in the current row; if the sum exceeds m / 2, perform element reversal, invert all elements in the row, and convert them to double precision type; S4. For row data records that have been flipped from 0 to 1, the flag bit is 1; for data records that have not been flipped, the flag bit is 0. S5. Store the processed row data into the corresponding row of the new matrix; S6. The output results consist of two parts. The first part is the processed matrix, which stores the results of all rows after processing. The second part is the flip marker array, which records which rows are flipped because the number of 1s in the data that actually needs to be stored in the row exceeds half of the total number of data in the row.
Citation Information
Patent Citations
SRAM radiation hardening method based on 4-bit adjacent and 3-bit burst error correction codes and memory system
CN107301881A
Processor, and method for generating binarized weights for a neural network
US20220147792A1