Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6794703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:15:15+00:00 2026-05-26T18:15:15+00:00

I am new to this and i am trying to do it without using

  • 0

I am new to this and i am trying to do it without using co-processors. Any suggestions? I really need to do good on this assignment! This code is supposed to be in MIPS assembly in which codes newtons method and contains the a-e points. I keep getting my code to asemble but it drops off the bottom…..i am not sure what that means though.

#Part 1
# (A) 
# g(x) = 0
# x = 7^(1/3)
# g(x) = x^3 - 7
# g'(x) = 3x^2
.data
x: .float 1.0
bb: .float 7.0
c: .float 3.0
epsilom: .float 0.00001
divide: .float 2.0

#=======================================
# (B)
# Write a MIPS function newtons_top that takes 1 “floating-point argument”: 
# $f0   xn, the current estimate of the root 
# It computes your function g(xn) = g($f0), and leaves the result in $f2.  Do not 
# modify $f0’s value.  (This would be a good place to document your g(x).)
newtons_top:
l.s $f0, x
l.s $f1, bb
mul.s $f5, $f0, $f0
mul.s $f0, $f5, $f0
sub.s $f2, $f0, $f1

#=======================================
# (C)
# $f0   xn, the current estimate of the root 
# It computes your function g’(xn) = g’($f0), and leaves the result in $f4.  Do not 
# modify $f0’s value.  (This would be a good place to document your g’(x).)
newtons_bottom:
l.s $f3, c
mul.s $f5, $f0, $f0
mul.s $f4, $f5, $f3


#======================================
#(D)
#  Write a MIPS function newtons_err that takes 1 “floating-point argument”: 
# $f0   xn, the current estimate of the root 
# It computes the error term ?n from (Eq. 3), and leaves the result in $f6.  Do not 
# modify $f0’s value.  Hint: Call your previous function
newtons_err:
div.s $f6,$f2,$f4


#========================================
#(E)

newtons_nth:
div.s $f2, $f0, $f1  # $f2 gets n/x
add.s $f2, $f2, $f1  # $f2 gets n/x + x
div.s $f2, $f2, divide  # $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, epsilom     # set the flag if |x'-x| < 0.00001
li $v0, 1


#===========================================
#(F)
#  Write a MIPS function newtons_gee that takes no arguments, and does this: 
#• Initializes x0 = 1.0 from (Eq. 1), by setting $f0 to 1.0. 
# • Repeatedly calls newtons_nth until the return value is non-zero. 
# Remember to pass the current  n in $a0 (even if your implementation 
# doesn’t use it for printing)

newtons_gee:
l.s $f0, 1
beqz $t3, newtons_nth

#=============================================
# Main Block

main:
j newtons_gee
syscall 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:15:16+00:00Added an answer on May 26, 2026 at 6:15 pm

    Here’s a start.

    The following code is nonsense:

    newtons_gee:
        l.s $f0, 1
        beqz $t3, newtons_nth
    

    To call a function in MIPS assembly you should be using the jal instruction and not beqz. $t3 has an undefined value (probably non-zero) when main jumps to newtons_gee, so the branch is not taken and control returns back to main.

    You need to go back and re-read your notes on how to do function calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Django and was trying this code in a tutorial. But
I'm trying to do this: using(var context = new SampleEntities()) { User user =
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
I'm trying to write a simple maze game, without using any deprecated OpenGL API
New to this library (no more familiar with BeautifulSoup either, sadly), trying to do
I am new to php and I am getting this error trying to load
I'm new to this whole Joomla thing, and I'm trying to get an swf
New to all this so forgive my ignorance. I am trying to figure out
Hi iam new to c++ and iam trying out this vector program and i
I'm trying to record audio this.recorder = new android.media.MediaRecorder(); this.recorder.setAudioSource(android.media.MediaRecorder.AudioSource.MIC); this.recorder.setOutputFormat(android.media.MediaRecorder.OutputFormat.DEFAULT); this.recorder.setAudioEncoder(android.media.MediaRecorder.AudioEncoder.DEFAULT); this.recorder.setOutputFile(pruebaAudioRecorder.mp4); **this.recorder.prepare();**

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.