Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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 Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

c. How is trust demonstrated?

Answered: 1 week ago

Question

c. Will leaders rotate periodically?

Answered: 1 week ago

Question

b. Will there be one assigned leader?

Answered: 1 week ago