Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use The Euclidean Algorithm to write a recursive method in mips that can find th

ID: 3719627 • Letter: U

Question

Use The Euclidean Algorithm to write a recursive method in mips that can find the greatest common divisor. The values being entered in should be hard coded.

Please write this in Mips Assembly

// ? program to demonstrate Basic Euclidean Algorithm #include // Function to return gcd of a and b int gcd (int a, int b) if (a0) return b; return gcd (bsa , a) // Driver program to test above function int main) int a-10, b-15 printf ("GCD (%d, %d) a 35, b 10; printf ("GCD (%d, %d) a=31, b = 2; printf ("GCD (%d, %d) return 0 %dn", %dn", %dn", a, a, a, b, b, b, gcd ( a, gcd ( a, gcd ( a, b)); b)); b));

Explanation / Answer

Here is the MIPS code you want.