This homework MUST be completed individually. 1. Implement two functions: a. A function called “getorder” which takes in $a0 a positive integer, and finds the order of it, where a number has order m...

I have attached the pdf


This homework MUST be completed individually. 1. Implement two functions: a. A function called “getorder” which takes in $a0 a positive integer, and finds the order of it, where a number has order m if it is between [2m, 2m+1). • For example, the order of 10 is 3, because 8 <= 10="">< 16.="" b.="" a="" function="" called="" “findmaxorder,”="" which="" takes="" in="" $a0="" the="" starting="" address="" of="" an="" integer="" array,="" $a1="" the="" length="" of="" the="" array,="" and="" prints="" out="" the="" largest="" order="" in="" this="" array.="" note="" that="" you="" must="" practice="" mips="" calling="" conventions="" in="" this="" problem.="" “findmaxorder”="" must="" call="" the="" “getorder”="" function.="" 2.="" please="" implement="" a="" function="" called="" “applog”="" that="" approximates="" log(1-x)="" by="" -x-="" x2/2-x3/3-…="" -x9/9="" for="" all="" values="" of="" x="" in="" (0,1).="" you="" should="" use="" single="" precision.="" x="" will="" be="" passed="" in="" $a0,="" and="" the="" return="" result="" should="" be="" in="" $v0.="" sample="" output:="" 0.25:="" -0.28768026="" 0.50:="" -0.69306493="" 0.75:="" -1.37365872="" note:="" 1.="" you="" should="" document="" your="" code="" properly="" in="" this="" homework.="" you="" may="" use="" the="" following="" code="" as="" a="" template:="" #="" newton.asm="" –="" a="" simple="" program="" calculating="" the="" square="" root="" of="" a="" given="" #="" is="" number="" n="" using="" singles.="" the="" value="" of="" the="" square="" root="" of="" n,="" #="" denoted="" by="" x,="" approximated="" by="" x="(x+n/x)/2," until="" the="" the="" #="" absolute="" value="" of="" the="" difference="" between="" new="" x="" and="" the="" previous="" #="" x="" is="" smaller="" than="" a="" given="" threshold="" such="" as="" 1.0e-3.="" #="" calling="" the="" calsqrt="" function="" and="" display="" the="" results="" #="" register="" use:="" #="" $a0="" syscall="" parameter="" #="" $v0="" syscall="" parameter="" #="" $f0="" exp="" and="" syscall="" return="" value="" #="" $f12="" exp="" and="" syscall="" parameter="" .text="" .globl="" main="" main:="" li.s="" $f0,="" 361.0="" mfc1="" $a0,="" $f0="" jal="" calsqrt="" done:="" mtc1="" $v0,="" $f12="" li="" $v0,2="" syscall="" eixt:="" li="" $v0,10="" syscall="" #="" calculating="" the="" square="" root="" of="" a="" given="" number="" n="" using="" singles.="" #="" the="" value="" of="" the="" square="" root="" of="" n,="" denoted="" by="" x,="" approximated="" #="" by="" x="(x+n/x)/2," until="" the="" the="" absolute="" value="" of="" the="" difference="" #="" between="" new="" x="" and="" the="" previous="" x="" is="" smaller="" than="" a="" given="" #="" threshold="" such="" as="" 1.0e-3.="" #="" register="" use:="" #="" $a0="" parameter="" from="" calling="" routine="" #="" $v0="" return="" value="" #="" $f0="" storing="" the="" value="" of="" n="" as="" a="" single="" precision="" number="" #="" $f1="" current="" value="" of="" x="" #="" $f2="" next="" value="" of="" x="" #="" $f3="" tempory="" vaiable="" #="" $f20="" storing="" constant="" 2="" for="" dividing="" #="" $f21="" storing="" constant="" 0.001="" for="" exit="" comparision="" calsqrt:="" addi="" $sp,="" $sp,="" -24="" swc1="" $f0,="" 20($sp)="" swc1="" $f1,="" 16($sp)="" swc1="" $f2,="" 12($sp)="" swc1="" $f3,="" 8($sp)="" swc1="" $f20,="" 4($sp)="" swc1="" $f21,="" 0($sp)="" mtc1="" $a0,="" $f0="" #="" $f0="" gets="" n="" li.s="" $f20,="" 2.0="" #="" $f20="" storing="" constant="" 2="" for="" dividing="" li.s="" $f21,="" 0.001="" #="" $f21="" storing="" constant="" 0.001="" for="" exit="" comparision="" div.s="" $f1,="" $f0,="" $f20="" #="" $f1="" gets="" n/2="" calsqrtloop:="" div.s="" $f2,="" $f0,="" $f1="" #="" $f2="" gets="" n/x="" add.s="" $f2,="" $f2,="" $f1="" #="" $f2="" gets="" n/x="" +="" x="" div.s="" $f2,="" $f2,="" $f20="" #="" $f2="" gets="" x'="(n/x" +="" x)/2="" sub.s="" $f3,="" $f2,="" $f1="" #="" $f3="" gets="" x'-x="" abs.s="" $f3,="" $f3="" #="" $f3="" gets="" |x'-x|="" c.lt.s="" $f3,="" $f21="" #="" set="" the="" flag="" if="" |x'-x|="">< 0.001 bc1t calsqrtdone mov.s $f1, $f2 j calsqrtloop calsqrtdone: mfc1 $v0, $f2 lwc1 $f0, 20($sp) lwc1 $f1, 16($sp) lwc1 $f2, 12($sp) lwc1 $f3, 8($sp) lwc1 $f20, 4($sp) lwc1 $f21, 0($sp) addi $sp, $sp, 24 jr $ra .data msg_done: .asciiz "done\n" 2. your programs will be evaluated using the following criteria: proper use of registers and memory (0-8,9-16,17-20) proper use of load, store and branch instructions (0-4,5-8,9-10) proper use of integer arithmetic instructions (0-4,5-8,9-10) proper use of floating point arithmetic instructions (0-4,5-8,9-10) proper use of subprogram calls [including use of stack] (0-4,5-8,9-10) proper use of return instructions [including use of stack] (0-2,3-4,5-5) proper design of a subprogram meet specified requirements (0-8,9-16,17-20) proper use of appropriate tools to assemble, test and debug program (0-2,3-4,5-5) appropriate documentation (0-4,5-8,9-10) the three point ranges next to each item specify the range of scores that will be used to represent ineffective, effective and highly effective performance, respectively. 0.001="" bc1t="" calsqrtdone="" mov.s="" $f1,="" $f2="" j="" calsqrtloop="" calsqrtdone:="" mfc1="" $v0,="" $f2="" lwc1="" $f0,="" 20($sp)="" lwc1="" $f1,="" 16($sp)="" lwc1="" $f2,="" 12($sp)="" lwc1="" $f3,="" 8($sp)="" lwc1="" $f20,="" 4($sp)="" lwc1="" $f21,="" 0($sp)="" addi="" $sp,="" $sp,="" 24="" jr="" $ra="" .data="" msg_done:="" .asciiz="" "done\n"="" 2.="" your="" programs="" will="" be="" evaluated="" using="" the="" following="" criteria:="" proper="" use="" of="" registers="" and="" memory="" (0-8,9-16,17-20)="" proper="" use="" of="" load,="" store="" and="" branch="" instructions="" (0-4,5-8,9-10)="" proper="" use="" of="" integer="" arithmetic="" instructions="" (0-4,5-8,9-10)="" proper="" use="" of="" floating="" point="" arithmetic="" instructions="" (0-4,5-8,9-10)="" proper="" use="" of="" subprogram="" calls="" [including="" use="" of="" stack]="" (0-4,5-8,9-10)="" proper="" use="" of="" return="" instructions="" [including="" use="" of="" stack]="" (0-2,3-4,5-5)="" proper="" design="" of="" a="" subprogram="" meet="" specified="" requirements="" (0-8,9-16,17-20)="" proper="" use="" of="" appropriate="" tools="" to="" assemble,="" test="" and="" debug="" program="" (0-2,3-4,5-5)="" appropriate="" documentation="" (0-4,5-8,9-10)="" the="" three="" point="" ranges="" next="" to="" each="" item="" specify="" the="" range="" of="" scores="" that="" will="" be="" used="" to="" represent="" ineffective,="" effective="" and="" highly="" effective="" performance,="">
Apr 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here