# Design of Universal Code Generator for Multi-Constellation Multi-Frequency GNSS Receiver
## 3 Code Generators
### Proposed Universal Code Generator  
In this paper, a register structure is proposed to support the generation of spread spectrum codes based on GPS, BDS, GLONASS, Galileo, QZSS, and IRNSS systems. The register structure is based on the LFSR structure derived from the IZ4 code generator, as depicted in Figure 11. The number of register bits adopts the 55-bit shift register of IZ4, and on this basis, the structure shown in Figure 8 is employed. This allows for the division of registers into different bit lengths, including 6, 7, 9, 10, 11, 12, 13, 14, and 27 bits, \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Codes** & **Feedback ROM1** & **Feedback ROM2** & **Output ROM1 (I3)** & **Output ROM2 (I4)** & **Initial ROM1 (I3)** & **Initial ROM2 (I4)** \\  & **(I3 bi9)** & **(I4 bi9)** & **(bib)** & **bib)** & **bib)** & **bib)** \\ \hline L1C/A & 000100000000 & 0001101001100 & 00000000000000 & 00000000000000000 & 00011111111111 & 0000111111111 \\ L2 CM & 100100100101010 & 0101010111100 & 1000000000000 & 0000000000000 & 000000000000 & 0000000000000 \\ L2 CL & 10010010010010 & 0101010111100 & 100000000000 & 0000000000000 & 000000000000 & 0000000000000 \\ L5I & 1101100000000 & 011001110101 & 100000000000 & 0100000000000 & 11111111111111 & 0000000000000 \\ L5Q & 1110110000000 & 01100111011 & 100000000000 & 010000000000 & 111111111111111 & 000000000000 \\ \hline Summary & x0/10x0/0x0x0x0x1x1 xx & x00x000000000 & x0x000000000 & 0x0000000000 & 00000000000 & 000000000000 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Fixed Parameters of the GPS Signal Spread Code Generator. Figure 10: Schematic Diagram of the GPS Universal Code Generator in Ref. [5]. enabling the parallel generation of spread spectrum codes for different signals. For example, simultaneous generation of L5 signal data and the pilot channel spread spectrum code can be achieved, or multiple spread spectrum codes for L1C/A signals and L1C/A and B1I signals can be generated simultaneously by selecting the appropriate control mode. By adopting this approach, not only is the generation of the 55-bit IZ4 spread spectrum code supported, but so is the simultaneous generation of multiple GNSS signal spread spectrum codes, fully utilizing its complex hardware structure. Table 3 shows the signal generation status according to the selection of the universal code generator mode designed in this paper. The generation of the spread spectrum code is performed by selecting the mode. In mode 0000, the spread spectrum code of the IZ4 data and pilot components can be generated by configuring different initial registers. In mode 0001, the first 0-12 bits of R0 and R1 are configured to generate B2a data components, while bits 13-25 are configured to generate B2a pilot components, and bits 26-38 are configured to generate B2b-I branch components. In mode 0010, bits 0-13 of R0 and R1 are configured to generate E5-I components, and bits 14-27 are configured to generate E5-Q components. In mode 0011, configuring bits 0-12 of register R0 generates the L5 XA sequence, configuring bits 0-12 of R1 generates the L5 XB\({}_{Q}\) sequence, and configuring bits 13-25 of R1 generates the L5 XB\({}_{Q}\) sequence. In mode 0100, the universal code generator simultaneously generates five GPS L1C/A spread spectrum codes (or IRNSS L5-SPS, S-SPS, SBAS L1C/A spread spectrum codes). It configures bits 0-9, 10-19, 20-29, 30-39, and 40-49 in R0 and R1 to generate five groups of L1C/A signals. In mode 0101, the generator simultaneously generates four groups of B3I signals by configuring bits 0-12, 13-25, 26-38, and 39-51 in R0 and R1. If the mode is 0110, it generates four groups of L2C signals using the Fibonacci configuration by configuring bits 0-26 and 27-53 in R0 and R1. In mode 0111, configuring bits 0-9 of R0 and R1 registers generates the secondary code of the IZ4 pilot component. In mode 1000, configuring bits 0-9 and 10-19 of R0 and R1 generates two sets of L1C/A  
Figure 11: Universal Code Generator.