Question: As asked, kindly answer the complete question in MIPS assembly language so that I can copy it there to run and check. Also include screenshot

As asked, kindly answer the complete question in MIPS assembly language so that I can copy it there to run and check.

Also include screenshot of the output and input both directly from the MIPS.

Use typed coding, no handwritten.

As asked, kindly answer the complete question in MIPS assembly language so

The Collatz conjecture problem in mathematics asks whether repeating two simple arithmetic operations will eventually transform every positive integer into one. Consider the following rule that transforms a given positive integer x to another (hailstone): if x is even, it becomes x/2; if x is odd, it becomes 3x+1. Starting at an arbitrary integer, we can repeatedly apply the rule. For example: 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. It has been conjectured that all integers eventually yield a 1. You can referred to this as the "Collatz conjecture", a.k.a. the "3x+1" problem. The conjecture has been verified by computer up to 5.6*10^13. In this assignment, you are to write a MIPS program to verify this conjecture to some extent. Your program will read a positive integer x from the user and repeatedly apply the rule above, print each hailstone (transformed values) until it reaches 1. The basic pseudo code is given here: while (x > 1){ if (x is even){ n=n/2} else{ n= 3*n+ 1} This solution is further constrained by requiring the use of two functions to implement the two kinds of transformation: One function will take an input x and return 3*x+1, while the other function divides its argument by 2. Try not using divide or multiply instructions. Rather use a shift right arithmetic (sra) instruction for division by 2, and use a combination of shift left logical (sll) and addition instructions to multiply by 3. Submit your solution as MIPS assembly file

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!