Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 language

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

(-2.4, -4.1) Plot the given points in a coordinate system.

Answered: 1 week ago

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago

Question

Is SHRD compatible with individual career aspirations

Answered: 1 week ago