To generate the main scrambling code of order N and the secondary
scrambling code of order K within the set identified by the primary
scrambling code of order N, a first m-sequence and a second m-sequence
are generated using Fibonacci linear feedback shift registers. The first
m-sequence and the second m-sequence are modulo-2 added to form the I
branch of the primary scrambling code. A first T-bit masking word and a
second T-bit masking word of rank 0 are generated that correspond to the
polynomial time shifts, and the intermediate taps of the X and y
registers respectively chosen by the masking words are modulo-2 added so
as to generate a third sequence and a fourth sequence, which are modulo-2
added together to form the Q branch of the primary scrambling code.
Starting from the least significant Kmax bits of the register X, of the
K-th intermediate tap corresponding to the secondary scrambling code of
order K within the set identified by the primary scrambling code of order
N, a fifth sequence is generated, which, modulo-2 added to the second
sequence, forms the I branch of the secondary scrambling code. By
modulo-2 summing the intermediate taps of the register X masked by the
first masking word of rank N, a sixth sequence is generated, which,
modulo-2 added to the fourth sequence, forms the Q branch of the
secondary scrambling code.