# Flexible 5G New Radio LDPC Encoder Optimized for High Hardware Usage Efficiency
## 5 Proposed Hardware Realization of Flexible 5G NR LDPC Encoder
### Circular Shifting Network for High Flexibility  
The circular shifting network is designed to work in one of the following three modes: (1) as a single CS when lifting size is in the range 192 < \(Z\leq\) 384, (2) as two independent CSs when lifting size is in the range 96 < \(Z\leq\) 192, and (3) as four independent CSs when lifting size is in the range 2 \(\leq Z\leq\) 96. For supporting such functionality, the chosen basic component for the entire network is a CS that supports all 5G NR lifting sizes of up to 96  
Figure 7: Genetic algorithm crossover and mutation examples for 20-element vectors. (CS96). Four CS96 components are used as either independent CSs or as partial CSs for higher lifting sizes. A CS96 shifter is designed as a two-stage shifter as in [11; 44], where the first stage is a pre-rotator network and the second stage is a QSN (abbreviated from QC-LDPC Shift Network) circular shifter [45]. As stated in (20), the 5G NR lifting size can take values of the form \(Z=a\cdot 2^{i}\), where \(j\) goes from 0 for smallest to 7 for largest lifting sizes. For lifting sizes supported by the CS96 shifter, \(j\) is always less than or equal to 5. Given that \(j\) can take values as small as 0, the pre-rotator network must have outputs for multiple rotation sizes [11], which is obtained as in [46]. With CS96 available, CS for higher lifting sizes is realized using appropriate bit permutations and reordering before and after CS96 blocks. A rationale for permutation and reordering network design is based on the possibility of rearranging CPMs to a group of smaller submatrices of which some are also circularly shifted identity matrices of size \(Z/D\)\(\times\)\(Z/D\), where \(D\) is a natural number. Such rearranging has been previously used for the design of LDPC decoders that support lower parallelism than \(Z\) and for preventing pipeline RAW data hazards [43], but here, it is applied to the design of CS. The CPM splitting relies on row and column permutations. Both row and column indexes in the new matrix are calculated using the following formula:  
\[idx_{new}=(idx_{old}\text{mod}D)\cdot\frac{Z}{D}+\left\lfloor\frac{idx_{old} }{D}\right\rfloor. \tag{34}\]  
Examples of presented permutations for \(D=2\) and \(D=4\) are shown in Figure 8. For the sake of simplicity and clearer presentation, the original lifting size is 16. A generalized illustration of CPM splitting for any lifting size is shown in Figure 9. One exponent matrix entry \(P\) gives \(2\times 2=4\) new entries if \(D=2\), and \(4\times 4=16\) new entries if \(D=4\). Figure 8: CPM splitting examples: (a) the original CPM, (b) original CPM with columns permuted for \(D=2\), (c) final permuted CPM for \(D=2\), and (d) final permuted CPM for \(D=4\). Figure 9: General circulant permutation matrix splitting results for \(D=2\) and \(D=4\). \(P\) is the shift value from the exponent matrix. Exponent matrix entry value \(-1\) represents a zero submatrix. The described property proves that a single circular shift for a large lifting size can be split into multiple circular shifts for a smaller lifting size. Therefore, the circular shifting network for large lifting sizes can be designed by using independent smaller lifting sizes CSs. This can be performed using the following steps. Input bits are firstly permuted using the relation from (34) to obtain independent groups of data. Each group of data is circularly shifted in shifters of smaller lifting sizes. The shifted data are in the permuted order and hence need an inverse permutation to obtain the proper output bits arrangement. The CS architecture that implements this method suitable for 5G NR codes is shown in Figure 10. In addition to the already mentioned permutations, the shifting network needs a group reordering stage, which depends on the remainder after the division of the original shift value with \(D\).