Algorithmic Extensions
Allowing More General Branch Metrics
Viterbi Decoder Implementation
For More Information On This Product,
Go to: www.freescale.com
4-5
This code is almost identical to the butterfly code in
Section 3
, with the following
differences. The first executable line is a long move to register Y. This allows us to grab
two branch metrics at the same time. For this example, we show both branch metrics
being added to the path metrics to update the states. Line 9 in the loop (the assembly line
move l:(r2)+,y) is a long read of two more branch metrics. This is an extra line of code,
but it executes in the same number of cycles as the original code because it takes the
place of a pipeline stall. Finally, note that address register 5 is still incremented, but
without a dummy read into a register.
The loop uses the same branch metrics for both upper and lower path metric updates.
This is what is needed for
Example 4-1
, where we still have some symmetry because
both encoding polynomials have a tap on the input bit. If this is not the case, the code can
accommodate other conditions. A more general setup is to uncomment the long move
that reads additional branch metrics in line 4 of the loop. This line will also take the place
of a pipeline stall, and so does not increase the number of cycles needed to execute the
butterfly.
;*****************************************************************
;
ACS
macro
;
;
move
#BRY,r2
move
l:(r2)+,y
move
l:(r5)+n5,a
;
do
#NoAcs,_P_NextStage
add
y0,a
l:(r5)-n5,b
add
y1,b
max
a,b
l:(r5)+n5,a
;
move
l:(r2)+,y
vsl
b,0,l:(r4)+
add
y1,a
l:(r5)-n5,b
add
y0,b
(r5)+
max
a,b
l:(r5)+n5,a
move
l:(r2)+,y
vsl
b,1,l:(r4)+
_P_NextStage
nop
endm
;r2 points to branch metrics
;get first branch metric
;load 1st metric/path pair
;update each state
;sum pt,br met,get next pair
;update metric
;pick max, reload 1st pair
;load next branch metrics
;save surivior, end top half
;sum pt,br,reload next pair
;sum again,inc pt mt read ptr
;pick max, load next pair
;load next branch metrics
;write survivor,end 2nd half
;needed to separate do loop ends
Example 4-1
Modified Viterbi Butterfly (Continued)
F
Freescale Semiconductor, Inc.
n
.