Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your task is to implement addition and subtraction of multi-precision (multiword) integers using MIPS. You will need to use a MIPS simulator in order to

image text in transcribed

Your task is to implement addition and subtraction of multi-precision (multiword) integers using MIPS. You will need to use a MIPS simulator in order to execute MIPS assembly language; we recommend the self-contained simulator SPIM, which can be run on all major operating systems (Windows/Mac/Linux). If you would prefer to use another MIPS simu- lator, thats fine, but be warned we may not be as familiar with it as with SPIM. You can download SPIM at http://spimsimulator.sourceforge.net ake room in the data section of your code for two vectors A and both A and B represent 256-bit integers. or positive 256-bit (8-word) numbers. 2's complement and add. B, each of size8 words, and put the initial addresses in registers a0 and a1. As each are 8 words long, 2. Compute C- A + B in 2's complement arithmetic, where A and B can be negative 3. Compute D-A (-B) in 2's complement arithmetic, where you compute (-B) in 4. Put C and D somewhere in memor;y Since MIPS uses 32-bit operands, there are some subtleties you need to be aware of, such as the carry bit. Consider such that Ai and Bi are 32-bit words. Adding Ao and B0 together produces Co, but also produces a carry-bit c1. Therefore, the addition of A1 and Bi involves: Ai + Bi + c1, where Ai, B1 are words and ci is a single bit) Your task is to implement addition and subtraction of multi-precision (multiword) integers using MIPS. You will need to use a MIPS simulator in order to execute MIPS assembly language; we recommend the self-contained simulator SPIM, which can be run on all major operating systems (Windows/Mac/Linux). If you would prefer to use another MIPS simu- lator, thats fine, but be warned we may not be as familiar with it as with SPIM. You can download SPIM at http://spimsimulator.sourceforge.net ake room in the data section of your code for two vectors A and both A and B represent 256-bit integers. or positive 256-bit (8-word) numbers. 2's complement and add. B, each of size8 words, and put the initial addresses in registers a0 and a1. As each are 8 words long, 2. Compute C- A + B in 2's complement arithmetic, where A and B can be negative 3. Compute D-A (-B) in 2's complement arithmetic, where you compute (-B) in 4. Put C and D somewhere in memor;y Since MIPS uses 32-bit operands, there are some subtleties you need to be aware of, such as the carry bit. Consider such that Ai and Bi are 32-bit words. Adding Ao and B0 together produces Co, but also produces a carry-bit c1. Therefore, the addition of A1 and Bi involves: Ai + Bi + c1, where Ai, B1 are words and ci is a single bit)

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

Step: 3

blur-text-image

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions