# Efficient QC-LDPC Encoder for 5G New Radio
## 4 Proposed 5G NR QC-LDPC Encoder Design  
### Proposed QC-LDPC Encoding Algorithm  
This section presents an efficient scheme developed in this study for the construction of efficient encoders for 5G NR QC-LDPC codes. The proposed encoding method is based on the special characteristics of 5G NR QC-LDPC codes, which are presented in Figure 1. The proposed architectures target low-complexity, while ensuring high-throughput. As reported in the literature review, base graphs BG1 and BG2 have similar structures. In this paper, we focus our description on BG1 with a size of \(m_{b}\times n_{b}\) (\(m_{b}\) = 46, and \(n_{b}\) = 68), which is the main 5G NR high rate base graph. Let the codeword \(C=[s\quad p_{a}\quad p_{c}]\), where \(s\) denotes the systematic portion, which is divided into 22 groups of \(Z\) bits, since the base graph BG1 has \(k_{b}=n_{b}-m_{b}=22\) information bit columns. Moreover, \(s=[s_{1},s_{2},\ldots,s_{k_{b}}]\), where each element of \(s\) is a vector of length \(Z\). The information messages received by the encoder are stored in registers that are organized by \(k_{b}\) blocks, denoted by \(s_{i}\) (\(i=1,2,\ldots,k_{b}\)), which correspond to the systematic blocks, where each consists of \(Z\) bits. Given that the encoder was designed to read \(Z\) bits per clock cycle, it requires \(k_{b}\) cycles to store all the information blocks. Moreover, the parity sequence can be grouped into sets of \(Z\) bits. Suppose that the parity portion of each message \(p\) is split into two sub-components as follows: the first \(g=4\) parity bits \(p_{a}=[p_{a_{1}},p_{a_{2}},\ldots,p_{a_{g}}]\), and the remaining \((m_{b}-g)=42\) parity bits \(p_{c}=[p_{c_{1}},p_{c_{2}},\ldots,p_{c_{m_{b}-g}}]\). More precisely, the encoded codeword can be expressed as:  
\[C=\left[s_{1},s_{2},\ldots,s_{k_{b}},p_{a_{1}},p_{a_{2}},\ldots,p_{a_{g}},p_{c _{1}},p_{c_{2}},\ldots,p_{c_{m_{b}-g}}.\right] \tag{16}\]  
The parity check matrix \(H\) of 5G NR QC-LDPC codes can be partitioned into six matrices and presented in the following form:  
\[H= \begin{bmatrix}A&B&0\\ C_{1}&C_{2}&I\end{bmatrix} , \tag{17}\] \begin{table}
\begin{tabular}{c c c} \hline \hline
**Operation** & **Comment** & **Complexity** \\ \hline \(As^{T}\) & Multiplication by sparse matrix & \(O(N)\) \\ \(Bp_{1}^{T}\) & Multiplication by sparse matrix & \(O(N)\) \\ \([As^{T}]+[Bp_{1}^{T}]\) & Addition & \(O(N)\) \\ \(-T^{-1}(As^{T}+Bp_{1}^{T})\) & Back substitution, \(T\) is lower triangular & \(O(N)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Complexity analysis of \(p_{2}^{T}\) calculation. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Operation** & **Comment** & **Complexity** \\ \hline \(As^{T}\) & Multiplication by sparse matrix & \(O(N)\) \\ \(T^{-1}As^{T}\) & Back substitution, \(T\) is lower triangular matrix & \(O(N)\) \\ \(-ET^{-1}[As^{T}]\) & Multiplication by sparse matrix & \(O(N)\) \\ \(Cs^{T}\) & Multiplication by sparse matrix & \(O(N)\) \\ \(\bar{C}=-ET^{-1}[As^{T}]+Cs^{\bar{T}}\) & Addition & \(O(N)\) \\ \(-\bar{D}^{-1}\bar{C}s^{T}\) & Multiplication by \(G\times G\) matrix & \(O(G^{2})\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Complexity analysis of \(p_{1}^{T}\) calculation. where \(A\) is \(g\times k_{b}\), \(B\) is \(g\times g\), \(C_{1}\) is \((m_{b}-g)\times k_{b}\), and \(C_{2}\) is \((m_{b}-g)\times g\). Moreover, \(I\) is an identity matrix with dimensions of \((m_{b}-g)\times(m_{b}-g)\). The encoding of LDPC codes is carried out using the following defining equation:  
\[HC^{T}=0^{T}. \tag{18}\]  
Equation (18) can also be expressed as:  
\[ \begin{bmatrix}A&B&0\\ C_{1}&C_{2}&I\end{bmatrix}\begin{bmatrix}s\\ p_{a}\\ p_{c}\end{bmatrix} =0^{T}. \tag{19}\]  
Equation (19) is then naturally split into two equations, as follows:  
\[A_{s}^{T}+Bp_{a}^{T}+0p_{c}^{T}=0^{T}, \tag{20}\]  
\[C_{1}s^{T}+C_{2}p_{a}^{T}Ip_{c}^{T}=0^{T}. \tag{21}\]  
The proposed algorithm is performed in two steps. In the initial step, the parity bits in the first portion \(p_{a}\) are computed by solving Equation (20).