BKM - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: August 31, 2016, 05:35:53 pm
content: deleted

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: September 02, 2016, 04:27:52 pm
content: I tend to use lookup tables on microcontrollers to avoid having to to calculate sin/cos, etc., during run time.

author: rstofer
author_rank: Super Contributor
timestamp: September 02, 2016, 06:18:55 pm
content: Maybe I am missing something, it happens with old age, but how is this 'new'? It was first published in 1994. It's old enough to buy liquor!Yes, it's about 40 years newer than Cordic but hardly 'new'.

author: westfw
author_rank: Super Contributor
timestamp: September 06, 2016, 07:28:57 am
content: OK. It's been a long time since my numerical methods class, but:QuoteHow does subtracting a number with 66bit precision from a number with 53bit precision end up giving you a result with only 13bits of precision?

author: rstofer
author_rank: Super Contributor
timestamp: September 09, 2016, 01:36:32 pm
content: It sounds like you are having a great time with this and making excellent progress. It will be interesting to see the 'cost' difference between CORDIC and BKM. Logic is cheap, speed and accuracy are better metrics.

author: rstofer
author_rank: Super Contributor
timestamp: September 10, 2016, 02:19:25 am
content: One time, not long ago, I was looking through the floating point library, specifically FEXP (standard precision EXP) for the IBM 1130 and I think I noticed where they were doing range reduction to some oddball limits. I wonder if they were using the CORDIC algorithms? This code would have been written earlier than '65. The date seems reasonable for CORDIC and too early for BKM.I see the CORDIC algorithms were first developed at the aeronautics division of Convair which just so happens to be a place where my entire family worked at one time or another between '51 and '69. We had nothing to do with them...

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: September 10, 2016, 10:06:17 am
content: Quote from: rstofer on September 10, 2016, 02:19:25 amNot impossible but I would say doubtful. Your mention of range reduction struck a memory.Volder's CORDIC IEEE paper which generalizes cordic to other elementary functions dates to around 1967 if I recall correctly. In the seventies I was a teenager and had my first TI scientific calculator given to me. It was the thing that prompted me to teach my self how to code and find out how these things worked. So off to my local university 26 miles away and I scavenged the libraries and computer rooms for answers. The uni had at that time 360 and 370 mainframes which were eventually replaced some years with Amdahl improvements. In the general access computer labs were the manuals of most use to students, held in those bolt thru trays so you couldn't steal them! But none contained any documentation on how the scientific library routines were implemented. For that I had to sneak into the special book room in the building that housed the university systems programmers. It was like finding that mega stash of playboys your dirty uncle hid in his tool shed.Knowing I had limited time for this mission impossible before being discovered I flipped through all the manuals as fast as I could. By some luck I found the Fortran code very quickly. It was nothing like what I expected. Convoluted and arcane with many if branches on input range. The trig functions had some obvious reductions to quarter angle or finer but then the code lost me. In all cases the final calculation was a unique (to that branch) rational polynomial. I had the sense that some masterful math PHD (of which IBM had many) had handcrafted and tuned the whole thing. I was evicted from the building before I could spend quality time studying the code so my memory is limited and fading.Now you can say the 360 family does not equal 1130, fair enough. The general design choice at the time and still today was if you had four banger floating point hardware you used either rational polynomials or chebyshev polynomial approximationsnot Taylor series!. I don't know how many times over the years I have had to educate engineers you don't use Taylor series for anything. And if you only had an integer CPU then CORDIC. I was under the impression the 1130 did have some form of floating point assist and it certainly had a fortran implementation which makes the 360 style fortran library more likely in my mind. Besides CORDIC is not how those egg heads at IBM would roll.

author: rstofer
author_rank: Super Contributor
timestamp: September 10, 2016, 02:45:35 pm
content: Quote from: chickenHeadKnob on September 10, 2016, 10:06:17 amI don't know anything about the 360s but I am intimately familiar with the 1130 having built an FPGA version that runs all of the IBM software without change. The 1130 was the first computer I ever used ('70..) and it has been a 46 year love affair. I still use FORTRAN IV and the attached plotter (really an HP Laserjet) to demonstrate programming and math to my grandson.The 1130 does not have floating point assist. In fact, it doesn't even have a decent adder in that carries are saved and additional add cycles are used until none remain. Even something as simple as adding is implemented with the absolute minimum possible hardware. No, my version doesn't do that... I don't do multiply one bit at a time either and, for whatever gain there might be, I implemented non-restoring division.I didn't spend enough time looking at the FEXP() function but it could have been a polynomial implementation. I just glanced over the comments and moved on.

author: rstofer
author_rank: Super Contributor
timestamp: September 10, 2016, 07:55:25 pm
content: Quote from: legacy on September 10, 2016, 05:15:28 pmAnd, for scientific applications, the Control Data machines were bigger and faster. For the times...The CDC 6xxx machines had a 60 bit integer which eliminated the need for floating point in many applications but the same 60 bits was used for floating point.Interestingly, integer multiply and divide was performed in floating point and included conversions.At the time, FORTRAN could reach 0.5 MFLOPS and assembly language could reach 3 MFLOPS. Today we can get 500 GFLOPS with a XEON chip!https://en.wikipedia.org/wiki/CDC_6600#Wordlengths.2C_charactersIt is amazing how far we have come since the early '70s!https://www.microway.com/knowledge-center-articles/detailed-specifications-intel-xeon-e5-2600v3-haswell-ep-processors/

author: Tom45
author_rank: Frequent Contributor
timestamp: September 11, 2016, 04:25:57 pm
content: Quote from: legacy on September 09, 2016, 10:11:52 amThanks for mentioning this book. I hadn't been aware of it until now and have ordered a copy.A much earlier book is Approximations for Digital Computers by Cecil Hastings.Looking at the Muller book's contents on Amazon, a lot has happened since Hastings wrote his little book in 1955.

author: rstofer
author_rank: Super Contributor
timestamp: September 11, 2016, 08:19:24 pm
content: Quote from: Tom45 on September 11, 2016, 04:25:57 pmI ordered a copy from Alibris, it should be an interesting read. I have many books on computer math but they tend to deal with hardware integer and floating point arithmetic and don't really address complex elementary functions.BTW, 'complex elementary' seems like an oxymoron!

author: rstofer
author_rank: Super Contributor
timestamp: September 23, 2016, 06:27:37 pm
content: That's really great work!

author: brokenshakles
author_rank: Newbie
timestamp: September 30, 2016, 07:25:02 am
content: I concur! I'm really hoping a code sample to study, as I am interested in a fast solver for the basic trig functions for fixed point numbers.

author: brokenshakles
author_rank: Newbie
timestamp: October 01, 2016, 06:00:31 pm
content: I considered that, but I'm not sure which of the funcs beyond the basics ones I will need ultimately, and I like more generalized solutions. Is your git coded in C?Edit: Also, does it accept fixed point numbers as inputs and give fixed point numbers as output? Is the position of the fixed point adjustable on init?Edit2: I also need tan and arctan, I'm not sure if CORDIC covers that.

author: brokenshakles
author_rank: Newbie
timestamp: October 01, 2016, 07:46:20 pm
content: hmm, what about rescaling the output? I heard that cordic messes with the unit scale. I am aware of the range reduction, but unsure how to implement such a thing, I'm mostly busy with all the other bits of code I need OTHER than a func to provide basic trig operations for fixed point numbers, which is why I'm asking around. Also, I'm using 64 bit ints to represent a fixed point number with 48 bits of integers, so wouldnt it be 80/64 ticks?