• Home
  • Textbooks
  • Digital Signal Processing and Applications with the C6713 and C6416 DSK
  • Architecture and Instruction Set of the C6x Processor

Digital Signal Processing and Applications with the C6713 and C6416 DSK

Rulph Chassaing

Chapter 3

Architecture and Instruction Set of the C6x Processor - all with Video Answers

Educators


Chapter Questions

Problem 1

Write a $\mathrm{C}$ program that calls an assembly function that takes input values a and $\mathrm{b}$ from the $\mathrm{C}$ program to calculate the following: $\left[a^2+(a+1)^2+(a+2)^2\right.$ $\left.+\ldots+(2 a-1)^2\right]-\left[b^2+(b+1)^2+(b+2)^2+\ldots+(2 b-1)^2\right]$. Set $a=3$ and $b=2$ in the $\mathrm{C}$ program and verify that the result is printed as 37 .

Check back soon!
02:21

Problem 2

Write a $\mathrm{C}$ program that calls an assembly function to obtain the determinant of a $3 \times 3$ matrix. Set the matrix values in the $\mathrm{C}$ program. The first row values are $[4,5,9]$; the second row values are $\{8,6,5\}$, and the third row values are $\{2,1,2\}$. Verify that the resulting determinant is printed within CCS as -38 .

James Kiss
James Kiss
Numerade Educator

Problem 3

Write a C program multi_casm.c that calls an assembly function multi_casmfunc.asm to multiply two numbers using the onboard dip switches. The maximum product is $3 \times 4=12$ or $4 \times 3=12$. Note that $4 \times 4=$ 16 cannot be represented with the four dip switches. Use delay loops for debouncing the switches. A partial program is included in Figure 3.25. In the main C source program, the values of $m=100$ and $n=100$ are to check when the first and second switches are pressed. Sw0 is tested and, if pressed, $m=1$, representing the first value. Similarly, $m=2,3,4$ if SW1, SW2, or SW3 is pressed, respectively. Then all LEDs are turned off. This process is repeated while $n=100$ to check for the second value (when the second switch is pressed).
The function values performs the multiplication, adding $m$ (n times) with $m$ and $n$ passed to the asm function through A4 and B4, respectively. Note that ledo is turned on if led $0=1$ (returned from the function resulto). Similarly for $1 \mathrm{ed} 1, \ldots, 1$ ed3. Then, $\mathrm{m}$ and $\mathrm{n}$ are reset to 100 and ii to 1 . The asm function multi_casmfunc.asm includes the functions values, result0,..., result3. The functions result1, result2, result 3 are similar to resulto, but A4 must be shifted first by 1 , by 2 , and by 3 , respectively, in each of these functions. Build and run this project example as multi_casm. Slightly press SW2, then SW 3 to obtain $m=3$ and $n=4$, and verify that SW2 and SW 3 turn on to represent the result of 12 .

Check back soon!

Problem 4

Write a $\mathrm{C}$ program that calls a linear assembly or assembly function to generate a random noise sequence, based on the linear feedback shift register (LFSR) shown in Figure 3.26. In lieu of starting with a 16-bit seed value, 16 integer values are used in an array as the seeds. In this fashion, each 32-bit

Check back soon!