Question: MIPS assembly language. please make sure the code works. Thanks in advance. 3 Quadratic Congruence (40 marks) One of the problems in the set of

MIPS assembly language. please make sure the code works. Thanks in advance.MIPS assembly language. please make sure the code works. Thanks in advance.

3 Quadratic Congruence (40 marks) One of the problems in the set of NP-Complete problems is that of quadratic congruences: given positive integers a, b and c, does there exist an integer a c such that r2a mod b? For small values of a, b, and c, we can decide by brute force if the congruence can be solved Write a program in assembly to get values for a, b and c from the user and then outputs each value of r, for which congruence holds, or reports back that there is no solution. You can use a single main program for this question: i.e., you do not have to use subroutines. However, if you use subroutines make sure that they are commented and your code is well structured. Note that you can use the rem pseudo-instruction to get the modulus of two numbers. Please name your solution file quad.asm. An example of four test cases is given below. We will test your program with these and some other (different) test cases. Note, you can print your solutions for r in any way you like the table below just shows the full solution set for certain choices of a, b,c. bc Solution (x) 47 5 Yes (2,5) 15 6 Yes (1,4,6) 3 10 4 No solution 512 7No solution 3 Quadratic Congruence (40 marks) One of the problems in the set of NP-Complete problems is that of quadratic congruences: given positive integers a, b and c, does there exist an integer a c such that r2a mod b? For small values of a, b, and c, we can decide by brute force if the congruence can be solved Write a program in assembly to get values for a, b and c from the user and then outputs each value of r, for which congruence holds, or reports back that there is no solution. You can use a single main program for this question: i.e., you do not have to use subroutines. However, if you use subroutines make sure that they are commented and your code is well structured. Note that you can use the rem pseudo-instruction to get the modulus of two numbers. Please name your solution file quad.asm. An example of four test cases is given below. We will test your program with these and some other (different) test cases. Note, you can print your solutions for r in any way you like the table below just shows the full solution set for certain choices of a, b,c. bc Solution (x) 47 5 Yes (2,5) 15 6 Yes (1,4,6) 3 10 4 No solution 512 7No solution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!