sqare root assembler code

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have written a square root routine (input 40 bit integer) in assember (in AVR studio) that I use in RMS calculations. "Problem" is that the routine takes up to 3mS (7.37MHz). Is there anyone out there that have a square root routine that is faster with minimum 40bit input ???

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the algorithm shift twice and subtract? Booth's Algorithm for multiply is shift and add, division is shift and subtract, I saw a book on hw math years ago that did a square root with shift twice and subtract. Should be 20 shifts and subtracts... faster than division.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This code is an untested extension from a thoroughly verified 32 bit version. It is written for Imagecraft ICCAVR as an assembly file. At your frequency it should be 93 uSeconds worst case.
Dave Raymond

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much Dave! After askin Atmel and hours of search on the web with no result it will be just great if this routine works !
I will make a test program with this routine and my old one with result compare to test that calculation is correct.
Thank's again !