|
|
|||||||||||||||||||||
|
This interactive tutorial visualizes the 5G NR Gold Sequence Scrambling Generator defined in 3GPP TS 38.211. The generator produces a pseudo-random binary sequence c(n) used for scrambling (e.g. PDSCH, PDCCH). It is built from two 31-bit Linear Feedback Shift Registers (LFSRs) whose outputs are combined with XOR. Despite looking like "random" bit-shifting, it is a deterministic process: the same c_init (initialization value) always yields the same sequence, so the receiver can recreate it exactly.
Mathematical foundation1. M-Sequence x1 First LFSR: x1(n+31) = (x1(n+3) + x1(n)) mod 2. In hardware: the register shifts left; the new bit (feedback) is the XOR of tap positions 0 and 3. Initial state: x1(0)=1, all others 0. This is a fixed maximal-length (m-) sequence. 2. M-Sequence x2 Second LFSR: x2(n+31) = (x2(n+3) + x2(n+2) + x2(n+1) + x2(n)) mod 2. Taps at positions 0, 1, 2, 3. Initial state is set from the 31-bit value c_init (e.g. derived from RNTI, Cell ID, etc.). 3. Output c(n) c(n) = (x1(n) + x2(n)) mod 2, i.e. XOR of the two output bits. The composite sequence is a Gold sequence: deterministic, long period, and good correlation properties for scrambling. 4. Nc offset (warm-up) Per 3GPP, the generator performs Nc = 1600 shifts before the first output bit c(0) is used. This discards the initial "simple" bits so the scrambling sequence appears highly random from the first bit used in the radio frame. Use Start from n=Nc (default) so Initialize runs the warm-up; Start from n=0 skips it for teaching. 5. c_init for PDSCH (example) For PDSCH scrambling, 38.211 defines c_init = n_RNTI · 215 + q · 214 + n_ID, where n_RNTI is the RNTI, q is the codeword index, and n_ID is the data scrambling identity. Changing c_init (e.g. by Cell ID or RNTI) completely changes the resulting sequence, so each user/cell gets a unique scrambling pattern.
Start
1
Status: —
Gold Sequence Formulas (3GPP TS 38.211)
Generated scrambling sequence c(n) — newest left
Mathematical Tracecinit = nRNTI·215 + q·214 + nID
Plugged in: (1 × 32768) + (0 × 16384) + 0
Result: 32768 (decimal)
Binary: bit 15 is HIGH → x2[15] = 1 in the register.
UsageUse this simulation to explore the 5G NR Gold Sequence generator (TS 38.211):
Tips: Start with C_init=1024 and click Initialize, then Step a few times to see the registers shift and c(n) appear. Try PDSCH with different n_RNTI or n_ID to see how the sequence changes. Enable Skip warm-up to observe the effect of the Nc offset. Parameters
|
|||||||||||||||||||||