Post Reply 
Square Root Process Similar to Long Division
09-18-2021, 08:55 PM (This post was last modified: 09-18-2021 09:00 PM by jeejohn.)
Post: #6
RE: Square Root Process Similar to Long Division
I had never taken the time to "reverse engineer" the HP square root algorithm. I knew it had to be something similar to what I posted as it calculated square roots only a little bit slower than doing divisions.

I take it that dividing R by 2 in DEC is still fast? In HEX it would just be a bit shift. I see that this allows each subtraction step to be incremented by 1. Nice.

Back in the days of the HP-48 newsgroup, I had posted a challenge over redoing the HP-48 ML multiplication in a different possibly faster way. It used one of the multipliers - say X and calculated 4X. Then using a bunch of GOTOs,
if digit=1 -> +X
digit=2 -> +X+X
digit=3 -> +4X-X (instead of +X+X+X)
digit=4 -> +4X (instead of +X+X+X+X)
etc. It was slightly faster, but not really worth the effort. All the tests and GOTOs steps added a lot of clock cycles.

For division, something similar can be done and also an idea was to add a second loop to follow a negative remainder to "Add Up" to a positive remainder.

Something similar could be done for the square root algorithm. When I did my manual square root calculations, I would keep a table of 2Xδ updated to grab quickly to add at the bottom and subtract to get the next remainder.

Interesting how the processor capabilities affects which algorithm is used to calculate irrational functions. HP finding out about the Cordic algorithm galvanized HP into creating the HP-9100 (the first desktop scientific calculator), which in turn, encourage Bill Hewlett to challenged his workers to create the HP-35.

John Edry
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Square Root Process Similar to Long Division - jeejohn - 09-18-2021 08:55 PM



User(s) browsing this thread: 1 Guest(s)