# Efficient QC-LDPC Encoder for 5G New Radio
## 2 5G NR QC-LDPC Codes
### 5G NR QC-LDPC Characteristics  
As mentioned above, QC-LDPC codes play an important role in 5G communications and have been accepted as the channel coding scheme for the 5G eMBB data channel in 3 GPP standard meeting. Figure 1 illustrates the general structure of the NR QC-LDPC base graph. The columns are divided into three parts: information columns, core parity columns, and extension parity columns. The rows are partitioned into two parts: core check rows and extension check rows. As shown in the figure, the base matrix is composed of five submatrices, namely, \(A\), \(B\), \(O\), \(C\), and \(I\)[22]. Submatrix \(A\) corresponds to systematic bits. In addition, \(B\) corresponds to the first set of parity bits and is a square matrix with a dual-diagonal structure: its first column is of weight 3, whereas the submatrix composed of other columns after the first column has an upper dual-diagonal structure. Submatrix \(O\) is an all-zero matrix. For the efficient support of incremental redundancy hybrid automatic repeat request (IR-HARQ), a single parity-check (SPC) based extension is used to support lower rates, as shown in Figure 1. Submatrix \(C\) corresponds to SPC rows, and \(I\) is an identity matrix that corresponds to the second set of parity bits, i.e., the SPC extension. The combination of \(A\) and \(B\) is referred to as the kernel, and the other parts (\(O\), \(C\), and \(I\)) are referred to as extensions. This code structure is similar to the Raptor-like extension, as described in [26]. The 3 GPP agreed to consider two rate-compatible base graphs, denoted by BG1 and BG2, for the channel coding. Base graphs BG1 and BG2 have similar structures. However, BG1 is targeted for larger block lengths (\(500\leq K\leq 8448\)) and higher rates (\(1/3\leq R\leq 8/9\)), whereas BG2 is targeted for smaller block lengths (\(40\leq K\leq 2560\)) and lower rates (\(1/5\leq R\leq 2/3\)). The actual base graph usage and the definition of the two matrices are detailed in the NR standard specification TS 38.212 [27]. The base graph that supports \(K_{max}\) should support the following set of shift sizes \(Z\), where \(Z=a\times 2^{j}\) for \(a\in\{2,3,5,7,9,11,13,15\}\) and \(0\leq j\leq 7\). For base graphs BG1 and BG2, the number of shift coefficient designs is 8. All lift sizes are divided into eight sets based on parameter \(a\), where \(a\) is used for the definition of the lifting-size \(a\times 2^{j}\). The set of shift coefficients are listed in Table 1.  
The shift value \(P_{i,j}\) can be calculated using the function \(P_{i,j}=f(V_{ij},Z)\), where \(V_{i,j}\) is the shift coefficient of the \((i,j)\)-th element in the corresponding shift design. The function \(f\) is defined as Equation (4), in which _mod_ denotes the modulo arithmetic:  
\[P_{i,j}=f(V_{i,j},z)= \begin{cases}-1,&\text{if }V_{i,j}=-1,\\ mod(V_{i,j},z),&else.\end{cases}  \tag{4}\]  
The following procedures are the steps of constructing the parity check matrix of the target \((N,K)\) QC-LDPC code with a given information block size \(K\) and code rate \(R=K/N\). For a base graph, \(k_{b}\) denotes the number of information circulant columns; thus, if the lifting size is \(Z\), \(K=Z\times k_{b}\) nominally. \begin{table}
\begin{tabular}{c c} \hline \hline
**Exponent Matrix** & **Lifting Size Set** \\ \hline Set 1 & \(Z=2\times 2^{j},j=0,1,2,3,4,5,6,7\) \\ Set 2 & \(Z=3\times 2^{j},j=0,1,2,3,4,5,6,7\) \\ Set 3 & \(Z=5\times 2^{j},j=0,1,2,3,4,5,6\) \\ Set 4 & \(Z=7\times 2^{j},j=0,1,2,3,4,5\) \\ Set 5 & \(Z=9\times 2^{j},j=0,1,2,3,4,5\) \\ Set 6 & \(Z=11\times 2^{j},j=0,1,2,3,4,5\) \\ Set 7 & \(Z=13\times 2^{j},j=0,1,2,3,4\) \\ Set 8 & \(Z=15\times 2^{j},j=0,1,2,3,4\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Relationship between exponent matrices and sets of lifting size. Figure 1: Sketch of base parity check structure for the 5G NR QC-LDPC codes. **Step 1:**: Obtain the base graph BG1 or BG2 and determine the value of \(k_{b}\) for the given \(K\) and \(R\). - For BG1: \(k_{b}=22\).