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
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