Question: 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)
 Project #1: Part B You are tasked to use the same

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!