English
Language : 

DSP56300 Datasheet, PDF (44/108 Pages) Freescale Semiconductor, Inc – Implementing Viterbi Decoders Using the VSL Instruction on DSP Families
Freescale Semiconductor, Inc.
Expanding the Viterbi Algorithm
Traceback: Obtaining the Decoder Output
Example 3-4 Traceback Output Path Code Listing (Continued)
TRCBK
do
#NUMINPUTS/8/2,TRCBK
move x:(r0+n0),a
extractu x0,a,b
lua
(r0-NUMSTATES),r0
move b0,n0
move a1,x1
move x:(r0+n0),a
extractu x0,a,b
lua
(r0-NUMSTATES),r0
move b0,n0
lsl
#8,a
or
x1,a
move a1,y:(r2)-
endm
;once for each byte pair
;recall last path
;get ptr to next earlier path
;point r0 to next earlier states
;save ptr as offset
;save out byte in x1
;do it all again!
;move to upper byte
;or in last byte to get 16 bit word
;store result
We begin the traceback in Example 3-4 by moving the path storage pointer to r0 and
initializing n0 for its use as an offset. Next we position r2 at the end of the buffer that will
contain the decoder output. Again, this is because we will traceback the path from the
end survivor path to the beginning. For our example, we can start at state 0. Start by
taking the current path for state 0 (r5 points to this) and reading into B. We put r2 in
linear addressing mode, then store the last path (the loop will read it again). Finally, we
load x0 with the control code ($513) to extract the pointer to the next traceback location
from the path.
The next section of code is used if the number of bytes of data is odd. It decodes the last
byte, and places it in the most significant byte of decoder output. As this code is like the
last half of the following do loop, discussion of this code is deferred.
The do loop processes the traceback two bytes at a time. In this way, it can assemble the
decoder output into 16-bit words for more efficient storage. Begin by reading the current
path into A1. Then, extract the pointer to the next (actually previous) path using extract.
Recall the control register contains $513, which means we take bits $13-$17 of A or,
equivalently, bits 3-7 of A1. Note that we can load $501d instead and the program will
work in 24-bit mode, although the example data provided would require 00 appended to
every data symbol to test correctly. As noted above, these most significant bits of the
path byte point to the storage address of the path continuation in the previous ÒpageÓ of
memory. By page, we mean the block of stored path bits for each state. There is one page
written each time we store paths (every 8 decoder input periods).
Next, move r0 to point to the previous page, then move the extracted path pointer bits to
n0 to be used in the next traceback read. We end processing of this least significant byte
by moving it to x1.
3-16
Viterbi Decoder Implementation
For More Information On This Product,
Go to: www.freescale.com