
Extended Algorithm Program Listing
Viterbi Decoder Implementation
For More Information On This Product,
Go to: www.freescale.com
B-7
;***********************ACSFlush Macro****************************
;
FUNCTION: This routine is very similar to the ACS macro, except that
;
the encoding shift register is now flushing back to 0.
;
This means that only the upper paths are taken, halving
;
the number of states we need to update. The ACS code is
;
modified so that we don't compute the lower paths. In
;
addition, state storage is modified so that survivor
;
paths are stored in consecutive memory locations.
;
Survivors are even states on the first pass, then
;
every fourth state, etc.
;
INPUTS:
;
r2 should point to the beginning of the branch metric table
;
r5 should point to the latest path metric for state 0
;
r4 should point to the storage location for updated state 0
;
n5 should be the number of input states/2 to process
;
n5 is halved each time this macro is invoked
;
OUTPUTS:
;
Updated path metrics/paths stored in XY memory
;
REGISTERS USED:
;
a,b,y01,r2,n2,r3,n3,r4,r5,n5 r2 unchanged (modulo req'd)
;
;
SA------NSA
;
C /
;
/
;
/
;
D/
;
/
;
/
;
SB
;*****************************************************************
ACSFlush macro
;**
move
#BRY,r2
move
r5,r3
move
r4,n3
move
l:(r2)+n2,y
move
l:(r5)+n5,a
;
do
n5,_NextStage
add
y0,a
l:(r5)-n5,b
add
y1,b
l:(r2)+n2,y
max
a,b
(r5)+
move
l:(r5)+n5,a
vsl
b,0,l:(r4)+
_NextStage
move
n5,b
asr
b
n2,a
move
n3,r5
move
b,n5
asl
a
(r2)-n2
move
r3,r4
move
a,n2
endm
;r2 points to branch metrics
;save r5 to init r4 later
;save r4 to init r5 later
;get first branch metrics
;load 1st metric/path pair
;update each state
;updt met,load next pair
;updt met,ld nxt br met
;sel surv,save met,inc st ptr
;ld next pair
;end 2nd half
;recall flush count, loop count
;divide it by 2,prep double branch jump
;storage for flush count
;reinit branch ptr
;next pass, skip more branches
Example B-1
Extended Algorithm Program Listing (Continued)
F
Freescale Semiconductor, Inc.
n
.