Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project # 1 : Part B You are tasked to use the same positive integers from Part A to also compute: h = f t

Project #1: Part B
You are tasked to use the same positive integers from Part A to also compute:
h=ften+16g-ten ;
i=(ften+g-t)
More formally, write MIPS code to output the result of above expression of h and i without using any
built-in MIPS/MARS instructions for multiplication or division. MOD function returns the remainder of a
division operation. The values already entered in Project 1 Part A for a,b,c, and d can be used for f_ten
and g_ten. Alternatively, you may also take f_ten and g_ten as direct inputs from the user. Output the
value of hquotient,hremainder, and i_mod in a format shown below, as separate decimal integers.
Note: To receive credit, no multiplication, no division, and no shift instructions shall be used. Namely,
none of {mul, mul.d, mul.s, mulo, mulou, mult, multu, mulu, div, divu,
rem, sll, sllv, sra, srav, srl, srlv} or else a zero score will result. Thus, it is to
compose your own division technique. In addition, use of a loop is required for credit to realize the
division code. It part of the project points to design a way to realize division using a loop.
Hint: You can refer to the definition of division and how division works. For example, given a positive
integer x, and a positive integer Y where x>Y then the division xY is computed such that unique
integers
Q and R satisfy x=(Y**Q+R) where QR{x=7,Y=2}7=2**3+1Q=3R=1{x=8,Y=4}8=4**2+0Q=2R=0{x=13,Y=5}13=5**2+3Q=2R=3ften=237
gten=197
hquotient =1
hremainder =56
imod=420R. The value Qis called the quotient and Ris called the
remainder. Some examples are:
{x=7,Y=2} then 7=2**3+1soQ=3 and R=1
{x=8,Y=4} then 8=4**2+0soQ=2 and R=0
{x=13,Y=5} then 13=5**2+3soQ=2 and R=3
Sample output for Part Bis:
ften=237
gten=197
hquotient =1
hremainder =56
imod=42
The submitted program shall provide outputs in exactly the sequence and format shown above. To
receive full credit, no additional superfluous outputs shall occur. (10 points for output formatting, 15
points for code comments, 10 points for checkoff QnA, rest 65 points for correct outputs)
image text in transcribed

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago