Summary: Students examine a section of TI TMS320C55x assembly code and determine results by hand. The instructions implement a simple finite impulse response (FIR) filter and include multiplication of fractional numbers using two's complement representation.
Note: This is a preview of how your module will appear when published, assuming that all currently pending role requests are accepted. You must return to the editing interface to edit or publish your changes.
1 FIR_len .set 3
2
3 ; Assume:
4 ; BK03 = FIR_len
5 ; AR2 = 1000h
6 ; AR3 = 1004h
7 ; FRCT = 1
8
9 BSET AR2LC ; sets circular addressing for AR2
10 BSET AR3LC ; sets circular addressing for AR3
11
12 mov LO(AC0),*AR3+
13 mov #0, AC0
14 rpt (FIR_len-1)
15 macm *AR2+,*AR3+,AC0
;" is considered a comment.
In this case, the comments indicate the contents of the
auxiliary registers, the BK03 register, and the address registers before the execution of
the first instruction, mov.
The line FIR_len .set 3 uses the assembler directive .set to define the name FIR_len as equal to 3. The BK03 register contains the length of the
circular buffer we want to use for auxiliary register 0 through 3. The BSET AR2LC modifies the increment operator + so that it
behaves as a circular buffer. This means that the address registers will be incremented until the
(memory-address mod value-in-BK03) = 0.
h" or preceded with a
0x represents a hexadecimal value.
1000h.
![]()
Figure 1: Data Memory Assignment (before execution)
|
mov,
rpt, and macm. Then, step
through each line of code and record the values of the
accumulator AC0, auxiliary register
AR2 and auxiliary register AR3 in the spaces provided
in Figure 2. Additionally, record the value
of the memory contents after all three instructions have been
executed; use the data memory table provided in Figure 3.
Figure 2: Execution Results
|
AC0 is a 40-bit register and that the
multiplier is in the fractional arithmetic mode. The mode is set by the assembler directive FRCT=1.
In this mode, binary words are interpreted as
fractions, and the multiplier treats them accordingly.
This is done by applying a one bit left shift to the multiplication result in the ALU.
DSP numerical representation and arithmetic are described further in Two's Complement and Fractional Arithmetic
for 16-bit Processors.
![]()
Figure 3: Data Memory Assignment (after execution)
|
12 mov LO(AC0),*AR3+