[SOLVED] COEN20 Lab4-Solving Quadratics

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab4-la8exc.zip (191.5 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (2 votes)

 

 

Topics: Instructions for integer arithmetic, calling a C function from assembly.

Prerequisite Reading: Chapters 1-5

 

Revised: August 27, 2019

 

Create a single ARM Cortex-M4 assembly source code file containing four functions. (Note that functions π‘…π‘œπ‘œπ‘‘1 and π‘…π‘œπ‘œπ‘‘2 should both contain calls to functions π·π‘–π‘ π‘π‘Ÿπ‘–π‘šπ‘–π‘›π‘Žπ‘›π‘‘ and π‘†π‘žπ‘’π‘Žπ‘Ÿπ‘’π‘…π‘œπ‘œπ‘‘.) Functions π·π‘–π‘ π‘π‘Ÿπ‘–π‘šπ‘–π‘›π‘Žπ‘›π‘‘, π‘…π‘œπ‘œπ‘‘1, π‘…π‘œπ‘œπ‘‘2 and π‘„π‘’π‘Žπ‘‘π‘Ÿπ‘Žπ‘‘π‘–π‘ are called by a main program (download from here) that will test your functions for three test cases. All of the parameters and return values are of type int32_t:

  1. π·π‘–π‘ π‘π‘Ÿπ‘–π‘šπ‘–π‘›π‘Žπ‘›π‘‘(π‘Ž, 𝑏, 𝑐) = 𝑏2 βˆ’ 4π‘Žπ‘
  2. π‘…π‘œπ‘œπ‘‘1(π‘Ž, 𝑏, 𝑐) =

βˆ’π‘+π‘†π‘žπ‘’π‘Žπ‘Ÿπ‘’π‘…π‘œπ‘œπ‘‘(π·π‘–π‘ π‘π‘Ÿπ‘–π‘šπ‘–π‘›π‘Žπ‘›π‘‘(π‘Ž,𝑏,𝑐))

 

2π‘Ž

  1. π‘…π‘œπ‘œπ‘‘2(π‘Ž, 𝑏, 𝑐) =

βˆ’π‘βˆ’π‘†π‘žπ‘’π‘Žπ‘Ÿπ‘’π‘…π‘œπ‘œπ‘‘(π·π‘–π‘ π‘π‘Ÿπ‘–π‘šπ‘–π‘›π‘Žπ‘›π‘‘(π‘Ž,𝑏,𝑐))

 

2π‘Ž

  1. π‘„π‘’π‘Žπ‘‘π‘Ÿπ‘Žπ‘‘π‘–π‘(π‘₯, π‘Ž, 𝑏, 𝑐) = π‘Žπ‘₯2 + 𝑏π‘₯ + 𝑐

 

Note: Function SquareRoot is a function written in C implemented in the same source code file as the main program. It requires a single unsigned integer parameter and returns an unsigned integer result. It should be called from your assembly language functions Root1 and Root2.

If your code is correct, the three test cases should look similar to the image above. Incorrect values will be displayed as white text on a red background.

 

  • Lab4-la8exc.zip