|
|
|||||||||||||
|
This tutorial explains the 5G NR Gold sequence generator as a mechanism, not just as a stream of random-looking bits. The generator has two 31-bit shift registers, x1 and x2. Their output bits are XORed to create the scrambling sequence c(n). The important idea is that the sequence is deterministic. If transmitter and receiver use the same c_init, they build the same x2 initial state and therefore generate the same scrambling bits. Sections Mathematical FoundationThe 5G Gold sequence is defined by three equations. The first equation tells how to produce the scrambling bit. The next two equations tell how to update the two shift registers. c(n) = (x1(n + Nc) + x2(n + Nc)) mod 2
This means the scrambling bit c(n) = x1[0] XOR x2[0]
x1(n + 31) = (x1(n + 3) + x1(n)) mod 2
This is the feedback rule for the first 31-bit register. To create the next bit entering the end of x2(n + 31) = (x2(n + 3) + x2(n + 2) + x2(n + 1) + x2(n)) mod 2
This is the feedback rule for the second 31-bit register. To create the next bit entering Therefore each Step does two things in order: first it reads 1. Build c_initFor a PDSCH-style example, this page uses: c_init = n_RNTI × 215 + q × 214 + n_ID
For example, if 2. Load two registersThe first register is fixed:
The second register is loaded from 3. Generate one scrambling bitThe current output is c(n) = x1[0] XOR x2[0]
4. Shift with feedbackAfter producing the output bit, both registers shift and append a new feedback bit: x1 feedback = x1[0] XOR x1[3]
x2 feedback = x2[0] XOR x2[1] XOR x2[2] XOR x2[3] 5. Nc warm-up5G NR uses SimulationThe interactive simulator is below. Use the controls to explore the concepts described above.
1.00
x1 register: output bit has green outline, feedback taps have yellow border x2 register: loaded from c_init, least significant bit first Gold sequence equations Generated c(n), newest first Status Live formulas Step details
Usage Instructions
What To NoticeThe output bit is read before the shift. Therefore each Step first computes The yellow tap bits decide the next feedback bit. The green-outlined bit is the current output bit. Key observation: changing
c_init only changes the x2 register. The x1 register always starts from the same fixed state x1(0)=1, x1(1..30)=0 — this is what makes the family a Gold sequence rather than a single m-sequence.Parameters
Limitations
|
|||||||||||||