Question

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 .

    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 .
Show more…
Digital Signal Processing and Applications with the C6713 and C6416 DSK
Digital Signal Processing and Applications with the C6713 and C6416 DSK
Rulph Chassaing 1st Edition
Chapter 3, Problem 3 ↓

Instant Answer

verified

Step 1

Ensure you have a suitable compiler for C (like GCC) and an assembler for the assembly code (like NASM or an equivalent).  Show more…

Show all steps

lock
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
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 .
Close icon
Play audio
Feedback
Powered by NumerAI
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever