Question: Code in MIPS/ Assembly using MARS, WILL THUMBS UP I have my code in part A where I calculate 2 functions. I must now include

Code in MIPS/ Assembly using MARS, WILL THUMBS UP

I have my code in part A where I calculate 2 functions. I must now include a remainder, mod, and a quotient with my output now. Please do not use any {mul, mul.d, mul.s, mulo, mulou, mult, multu, mulu, div, divu, rem, sll, sllv, sra, srav, srl, srlv} OR Macro, Subroutines, or Functions

Code in MIPS/ Assembly using MARS, WILL THUMBS UP I have my

Here is my code that you can use so you can input part B or you can create your own code using the values from Part A

.data prompt: .asciiz " Enter 4 integers for A, B, C, D respectively: " decimal: .asciiz " f_ten = " binary: .asciiz " f_two = " decimal2: .asciiz " g_ten = " binary2: .asciiz " g_two = "

.text la $a0,prompt li $v0,4 syscall #store A in s0 li $v0,5 syscall move $s0,$v0 #store B in s1 li $v0,5 syscall move $s1,$v0 #store C in s2 li $v0,5 syscall move $s2,$v0 #store D in s3 li $v0,5 syscall move $s3,$v0 #F FUCNCTION STARTS HERE #A^4 move $t0,$s0 li $s4,0 loop: blt $t0,1,loop1 add $s4,$s4,$s0 addi $t0,$t0,-1 j loop loop1: move $t0,$s4 li $s5,0 loop11: blt $t0,1,loop2 add $s5,$s5,$s4 addi $t0,$t0,-1 j loop11

#B^3 loop2: move $t1,$s5 move $t0,$s1 li $s4,0 loop21: blt $t0,1,loop22 add $s4,$s4,$s1 addi $t0,$t0,-1 j loop21 loop22: move $t0,$s1 li $s5,0 loop23: blt $t0,1,loop24 add $s5,$s5,$s4 addi $t0,$t0,-1 j loop23 loop24: li $t0,4 li $s6,0 loop25: blt $t0,1,loop3 add $s6,$s6,$s5 addi $t0,$t0,-1 j loop25 #c^2 loop3: move $t2,$s6 move $t0,$s2 li $s4,0 loop31: blt $t0,1,loop32 add $s4,$s4,$s2 addi $t0,$t0,-1 j loop31 loop32: move $t4,$s4 li $t0,3 li $s5,0 loop33: blt $t0,1,loop4 add $s5,$s5,$s4 addi $t0,$t0,-1 j loop33 #2D loop4: move $t3,$s5 li $t0,2 li $s5,0 loop41: blt $t0,1,next add $s5,$s5,$s3 addi $t0,$t0,-1 j loop41 next: #CALCULATE F sub $t1,$t1,$t2 add $t1,$t1,$t3 sub $t1,$t1,$s5

#F display in decimal la $a0,decimal li $v0,4 syscall

move $a0,$t1 li $v0,1 syscall

#F display for binary la $a0,binary li $v0,4 syscall

move $a0,$t1 li $v0,35 syscall

#G FUCNTION STARTS HERE #B^2 loopg: move $t0,$s1 li $s4,0 loopg1: blt $t0,1,loopg2 add $s4,$s4,$s1 addi $t0,$t0,-1 j loopg1 #AB^2 loopg2: move $t0,$s0 li $s5,0 loopg3: blt $t0,1,loopg4 add $s5,$s5,$s4 addi $t0,$t0,-1 j loopg3 #D^3 loopg4: move $t5,$s5 move $t0,$s3 li $s4,0 loopg5: blt $t0,1,loopg6 add $s4,$s4,$s3 addi $t0,$t0,-1 j loopg5 loopg6: move $t0,$s3 li $s5,0 loopg7: blt $t0,1,loopg8 add $s5,$s5,$s4 addi $t0,$t0,-1 j loopg7 #(C^2)*D^3 loopg8: move $t0,$t4 li $s6,0 loopg9: blt $t0,1,loopg10 add $s6,$s6,$s5 addi $t0,$t0,-1 j loopg9 loopg10: #CALCULATE G add $s6,$s6,$t5 syscall exit:

#G display in decimal la $a0,decimal2 li $v0,4 syscall

move $a0,$s6 li $v0,1 syscall #G display in binary la $a0,binary2 li $v0,4 syscall

move $a0,$s6 li $v0,35 syscall #end of the program li $v0,10 syscall

You are tasked to use the same positive integers from Part A to also compute: i (E+g) MOD h quotient; 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. The values already entered for Part A for a, b, c, and d shall be used. Output the value of h and i in {quotient with remainder; in a format as separate decimal integers. Indicate the denominator for the remainder Note: To receive credit, no multiplication, no division, and no shift instructions shall be used. Namely, none of fmul, mul.d, mul.s, mulo, mulou, mult, multu, mulu, div, divu, rem, sl1, 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 XTY is computed such that unique integers Q and R satisify X-(Y*Q+ R) where 0 s R Y then the division XTY is computed such that unique integers Q and R satisify X-(Y*Q+ R) where 0 s R

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!