Practice Problem [no points]: You should read and understand Fibonacci algorithm, write a code in a…

Homework Help Question & Answers

Practice Problem [no points]: You should read and understand Fibonacci algorithm, write a code in a…

Practice Problem [no points]: You should read and understand Fibonacci algorithm, write a code in a high level language of your choice and in Assembly to find a Fibonacci number and check your result. At the end of this assignment a possible solution to this problem is given both in Python and MIPS assembler. Note that it would have been possible to write the Python differently to achieve the same function. . [20 points] Write and debug a MIPS program that computes factorial of a given number iteratively (not recursively. This is a MIPS program with looping Instructions and Hints: Begin by writing the factorial calculation in your favorite high-leveil programming language and including the entire program as a comment in your MIPS program like the Python code as in the practice problem. Your high-level code must work correctly for any value from 0! upward (remember that 0!1 by definition) for answers that will fit in 32 bits. Your high level language implementation and your MIPS implementation must use the SAME algorithm (same type of loop, same number of and location of branches, no try statements etc.) You will want to use an algorithm that will minimize the number of branches necessary to make the assembly version simpler Evaluation: Your code should be appropriately commented, 25% will be deducted if the high-level language code is not in a comment as specified above The output from your run should look similar to (though obviously not identical to) the Fibonacci output. 2. [EXTRA CREDIT 5 points] Implement a program to calculate the 2’s complement of a number entered by the user. The program should only use the XOR and ADD operators. Your program should include a proper and useful prompt for input, and print the results in a meaningful manner, similar to above
0 0
Add a comment

CLAIM YOUR 30% OFF TODAY

X
Don`t copy text!
WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
???? Hi, how can I help?