# An FPGA Design with High Memory Efficiency and Decoding Performance for 5G LDPC Decoder
## 2 Related Definitions and Preliminaries
### 5G Quasi-Cyclic LDPC Codes  
Quasi-Cyclic (QC) LDPC codes are one of the typical structured LDPC codes extensively used in practice [25]. These QC-LDPC codes offer a number of advantages, including similar decoding performance compared with random-LDPC codes with a basic and structured design, suitability for hardware implementations with parallelizable architecture, a simple interconnection network, and support for flexible block lengths. In general, QC-LDPC codes are defined by a base matrix \(\mathbf{B}\) of size \(L\times C\) with entries \(b_{i,j}\geq-1\), where \(i\in\{1,2,\ldots,L\}\) and \(j\in\{1,2,\ldots,C\}\). The PCM \(\mathbf{H}\) of a QC-LDPC code is determined by extending its base matrix with an expansion factor \(Z\). Each element in the base matrix is replaced with the sparse matrix of size \(Z\times Z\) in the following manner: all zero matrices are extended for elements \(b_{i,j}=-1\), and elements \(b_{i,j}>-1\) are replaced by a circulant permutation matrix created by right shifting the identity matrix by \(b_{i,j}\) positions. As a result, a PCM \(\mathbf{H}\) has \(M=Z\times L\) rows and \(N=Z\times C\) columns. The 5G LDPC code design allows it to support many code sizes and code rates. Moreover, the base matrix of the 5G LDPC code is extensible by the expansion factor up to 384, allowing it to support very high parallelism levels. The expansion factor values can be obtained as \(Z=a\times 2^{k}\), where \(a=\{2,3,5,7,9,11,13,15\}\) and \(k=\{0,1,2,3,4,5,6,7\}\). Consequently, there are all 51 expansion factor \(Z\) values listed in Table 2[9]. The BG1 and BG2 matrices are considered for 5G New Radio channel coding by 3 GPP [9]. While BG1 is constructed for higher rates (\(1/3\leq R\leq 8/9\)) and larger information bits (\(500\leq K\leq 8448\)), BG2 is designed for lower rates (\(1/5\leq R\leq 2/3\)) and smaller information bits (\(40\leq K\leq 2560\)). In this paper, the BG1 matrix is considered. It must be emphasized that the 5G LDPC codes are dramatically irregular for both check nodes and variable nodes. For example, with BG1, the check node degree varies from 3 to 19 and the variable node degree varies from 1 to 30. BG1 can support the maximum information bits of 8448. QC-LDPC codes can apply layered scheduling due to their construction based on circulant matrices. A decoding layer in layered scheduling typically consists of \(Z\) consecutive rows of the parity check matrix \(\mathbf{H}\), corresponding to one row of the base matrix \(\mathbf{B}\). In general, the decoding layer can consist of a number of consecutive rows of \(\mathbf{B}\) such that these rows do not overlap. As mentioned above, since each non-negative element of the base matrix \(\mathbf{B}\) is replaced by a circulant matrix (permutation), each column of matrix \(\mathbf{H}\) has exactly one non-negative element in each decoding layer. In a decoding layer, only CNs belonging to one (or some) row(s) of the base matrix \(\mathbf{B}\) update their messages and the VNs connecting to that CN update their AP information. A decoding iteration is done when all of the CNs of \(\mathbf{H}\) update their messages. The algorithm of the suggested decoder with the layered scheduling principle using the HOMS algorithm [19] is summarized in Algorithm 1. The message transmitted from VN \(n\) to neighbor CN \(m\) is denoted by \(\alpha_{m,n}\) (VTC messages), while the message sent from CN \(m\) to VN \(n\) is denoted by \(\beta_{m,n}\) (CTV messages). The priori information is indicated by \(\gamma_{n}\). The PCM \(\mathbf{H}\) of size \(M\times N\) is divided into \(L\) horizontal layers, commonly known as decoding layers.