Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this exercise. It needs to be coded on MARS 3 Quadratic Congruence (40 marks One of the problems in the set
I need help with this exercise. It needs to be coded on MARS
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 x c such that x2 a 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 x in any way you like the table below just shows the full solution set for certain choices of a, b, c a bc Solution (x) 475 Yes (2,5) 156 Yes (1,4,6) 3 10 4No solution 5 127No solution This has to be written in MIPS language 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 x c such that x2 a 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 x in any way you like the table below just shows the full solution set for certain choices of a, b, c a bc Solution (x) 475 Yes (2,5) 156 Yes (1,4,6) 3 10 4No solution 5 127No solution This has to be written in MIPS languageStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started