Question: Write a program that computes 13x. Do this by using register $7 for x and register $10 for the final result. Load $7 at the

Write a program that computes 13x. Do this by using register $7 for x and register $10 for the final result. Load $7 at the start of the program using an ori instruction with a small positive integer value for x of your choice. Assume that bit patterns represent positive integers using unsigned binary. Different values for x are done by editing the source file.

Do the multiplication by shifting and adding. Notice that 13x is equal to 8x + 4x + x.

Don't use explicit multiply instructions. Compute the values for 8x and 4x by left shifting the bit pattern in $7 into some other registers.

Don't do input or output or loading and storing from memory. The instructions up through chapter 13 are enough. Put the result in register $10 at the end of the program. Write the program so that the value for x can easily be changed by editing the ori instruction at the beginning of the program.

Execute your program by repeated "single steps" through the machine code. At the end, $10 should hold the value you expect.

Create your source file using Notepad++ or other text editor. Align columns, do not use tab characters.

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!