AN2254 Freescale Semiconductor / Motorola, AN2254 Datasheet - Page 11

no-image

AN2254

Manufacturer Part Number
AN2254
Description
Scrambling Code Generation for WCDMA
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor
mainloop
Scrambling Code Generation for WCDMA on the StarCore™ SC140/SC1400 Cores, Rev. 1
;-------------------------generation of binary PN codes (c1 & c2) starts here-----------------a
b
c
;---------------------------mainloop main kernel--------------------------------------
falign:
loopstart0
d
e
f
lsll d15,d1
[
push d6
push d7
]
[
push r6
push r7
]
move.l #REG1,r0
move.l #REG2_INIT,d7
move.l (r0),d6
move.l #CODE_IQ,r0
[
move.f #0.5,d13
move.f #-0.5,d14
clr d4
]
dosetup0 mainloop
[
tfr d7,d9
]
[
eor d9,d0
lsrr #3,d6
]
[
lsr d7
eor d7,d9
eor d6,d1
lsr d6
]
[
eor d7,d9
lsr d7
lsrr #3,d6
tfr d6,d8
move.w #9,d15
]
[
eor d7,d8
lsrr #2,d7
and #MASK16,d1,d1
and #MASK16,d9,d9
]
[
eor d6,d8
lsll d15,d9
lsrr #9,d6
move.w #9,d15
tfr d6,d0
lsr d7
tfr d6,d1
eor d7,d9
lsr d7
;//x25 =<<9
Software Implementation on the StarCore SC140/SC1400 Cores
;//R0 points to initial value of upper LFSR
;//D7 is the lower LFSR
;//D6 is the upper LFSR
;//R0 points to where IQ scrambling code will be stored
;//1 scaled down by a factor of 2 to 0.5 to avoid overflow
;//-1 scaled down by a factor of 2 to -0.5 to avoid
;//overflow
;//used to keep track for decimation of c2 code
;used for offset purposes in shifting registers
;//c1 = x0
;//y25 = y0
;//y1
;//x25 = x0
;//y25 = yo^y1
;//c2 = x0^y0
;//y2
;//x3 = x >> 3
;//y3
;//y25 = y0^y1^y2
;//x25 = x0^x3
;//x4
;//y25 = y0^y1^y2^y3
;//y4
;//x7
;//c2 = x4
;//used as offset in shifting
;//c2 = x4^y4
;//y6
;//get lower 16 bits of x25, zero high bits
;//get lower 16 bits of y25, zero high bits
;//c2 = y4^x4^x7
;//y25 =<<9
;//x >> 16
doen0 #NUM_ITER
11

Related parts for AN2254