pi day - calculation of 3.1415926.... - Page 1
Forum section: electronics / general

author: dannyf
author_rank: Super Contributor
timestamp: March 14, 2014, 08:08:02 pm
content: I learned on the radio that today's the (international?) pi day.What about a completely useless contest on calculating pi on the most primitive computer of them all: a mcu?A few angles:1) on the most primitive mcu: 16 bit? 8 bit? 4 bit? or a 1 bitter?2) fastest to the given length: pi to 10th digits? 50th digits? or 100 / 1000 digits?Just need to do it on a mcu. Otherwise, it is not completely useless,

author: kripton2035
author_rank: Super Contributor
timestamp: March 14, 2014, 08:16:50 pm
content: my father did it on an alphatronic calculator in the seventies.unkown processor = at best a 8bits mcuentirely in assembly langage, it took a week to get ... 100 digits !

author: mboich
author_rank: Contributor
timestamp: March 16, 2014, 01:07:45 am
content: Steve Wozniak (Woz) did 150,000 digits on an Apple II many years ago. That was a 1MHz, 8 bit micro, with probably 8K of memory. (Needless to say, it didn't store the result, but spewed it out!) He did an article for Byte Magazine at the time.

author: senso
author_rank: Frequent Contributor
timestamp: March 17, 2014, 01:07:46 am
content: My first PI calculation, I copied the algorithm that was shown in the SuperPi help file into my Casio CFX and after 5 seconds it spewed out 6 or 7 digits

author: mariush
author_rank: Super Contributor
timestamp: March 17, 2014, 02:21:03 am
content: int main(){long a=10000,b,c=2800,d,e,f,g;for(;b-c;) f[++b]=a/5;for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)for(b=c;d+=f*a,f=d%--g, d/=g--,--b;d*=b);}Should be fairly easy to port to even a 4bit microcontroller as long as it has enough memory/flash

author: apelly
author_rank: Unknown
timestamp: March 17, 2014, 02:29:38 am
content: Quote from: mariush on March 17, 2014, 02:21:03 amnot if you don't put it an a code blockCode:int main(){long a=10000,b,c=2800,d,e,f,g;for(;b-c;) f[++b]=a/5;for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)for(b=c;d+=f*a,f=d%--g, d/=g--,--b;d*=b);}

author: Rigby
author_rank: Super Contributor
timestamp: March 17, 2014, 02:36:27 am
content: Why no sqrt(2) day or phi day? golden ratio day?pi isn't very special.yes, I watched this, and I'm on her side. Highly recommended viewing.

author: kripton2035
author_rank: Super Contributor
timestamp: March 17, 2014, 07:36:11 am
content: Quote from: mariush on March 17, 2014, 02:21:03 amthe challenge is to calculate an infinite quantity of digits, as long as the mcu can run and has enought memory to store the digits and the calculations.

author: Mechatrommer
author_rank: Super Contributor
timestamp: March 17, 2014, 08:45:42 am
content: swmbo made something like this in under than an hour, she made us happy at least we can continue with whatever our work was during the day, and the most important part is, we are happy...

author: PeterG
author_rank: Frequent Contributor
timestamp: March 17, 2014, 08:55:43 am
content: Quote from: Mechatrommer on March 17, 2014, 08:45:42 amYes, fine work indeed. However, are the results repeatable?Regards

author: Mechatrommer
author_rank: Super Contributor
timestamp: March 17, 2014, 09:43:46 am
content: Quote from: PeterG on March 17, 2014, 08:55:43 am"good enough", with specified tolerance

author: scientist
author_rank: Frequent Contributor
timestamp: March 18, 2014, 03:10:05 am
content: Quote from: Mechatrommer on March 17, 2014, 08:45:42 amI demand a CNC'd version!

author: miguelvp
author_rank: Super Contributor
timestamp: March 18, 2014, 03:15:46 am
content: Quote from: scientist on March 18, 2014, 03:10:05 amNot CNC'd:Well maybe can be CNC'd

author: GK
author_rank: Super Contributor
timestamp: March 18, 2014, 03:19:57 am
content: Quote from: Rigby on March 17, 2014, 02:36:27 amOr just 1/3 day.......

author: miguelvp
author_rank: Super Contributor
timestamp: March 18, 2014, 03:32:26 am
content: Quote from: GK on March 18, 2014, 03:19:57 amyup, since Jan 41 and Jan 62 are hard to come by unless they refer to years.Edit: funny fact, I always have treated Jan 2nd as a 1/2 day