Connexions

You are here: Home » Content » FIR Filtering with TI TMS320C55x: Prelab

FIR Filtering with TI TMS320C55x: Prelab

Module by: Lee Potter, Douglas L. Jones, Thomas Shen Based on: FIR Filtering: Basic Assembly Exercise for TI TMS320C55x by Douglas L. Jones, Swaroop Appadwedula, Matthew Berry, Mark Haun, Jake Janovetz, Michael Kramer, Dima Moussa, Daniel Sachs, Brian Wade, Jason Laska, Thomas Shen

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.

Assembly Exercise

      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
	
Text following a ";" 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.
Note that any number followed by an "h" or preceded with a 0x represents a hexadecimal value.
Example 1 
1000h and 0x1000 both refer to the decimal number 4096.
Assume that the data memory is initialized as follows starting at location 1000h.
Figure 1: Data Memory Assignment (before execution)
Refer to the Mnemonic Instruction Set manual to familiarize yourself with the syntax and operation of three assembly language instructions: 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.
AC0 AR2 AR3  
00 0000 8000h 1000h 1004h at start of code
      after mov instruction
      after mov instruction
      after rpt instruction
      after first macm instruction
      after second macm instruction
      after third macm instruction
Figure 2: Execution Results
When working through the exercise, take into account that the accumulator 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)

Prelab Submission

For the prelab exercise, each student should submit the following:
  1. Register contents recorded in Table 2.
  2. Register contents recorded in Table 3.
  3. A brief description of each component appearing in line 12 of the given code:
     12      mov    LO(AC0),*AR3+
	

Comments, questions, feedback, criticisms?

Send feedback

Content Actions