Author Topic: pi day - calculation of 3.1415926....  (Read 5803 times)

0 Members and 1 Guest are viewing this topic.

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
pi day - calculation of 3.1415926....
« on: March 14, 2014, 08:08:02 pm »
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,  :)
================================
https://dannyelectronics.wordpress.com/
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2740
  • Country: fr
    • kripton2035 schematics repository
Re: pi day - calculation of 3.1415926....
« Reply #1 on: March 14, 2014, 08:16:50 pm »
my father did it on an alphatronic calculator in the seventies.
unkown processor = at best a 8bits mcu
entirely in assembly langage, it took a week to get ... 100 digits !
 

Offline mboich

  • Contributor
  • Posts: 18
Re: pi day - calculation of 3.1415926....
« Reply #2 on: March 16, 2014, 01:07:45 am »
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.
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 953
  • Country: pt
    • My AVR tutorials
Re: pi day - calculation of 3.1415926....
« Reply #3 on: March 17, 2014, 01:07:46 am »
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   :clap:
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5181
  • Country: ro
  • .
Re: pi day - calculation of 3.1415926....
« Reply #4 on: March 17, 2014, 02:21:03 am »
int main()
{
long a=10000,b,c=2800,d,e,f[2801],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
 

Offline apelly

  • Supporter
  • ****
  • Posts: 1067
  • Country: nz
  • Probe
Re: pi day - calculation of 3.1415926....
« Reply #5 on: March 17, 2014, 02:29:38 am »
int main()
{
long a=10000,b,c=2800,d,e,f[2801],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

not if you don't put it an a code block  ;)
Code: [Select]
int main()
{
long a=10000,b,c=2800,d,e,f[2801],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[b]*a,f[b]=d%--g, d/=g--,--b;d*=b);
}
 

Offline Rigby

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: pi day - calculation of 3.1415926....
« Reply #6 on: March 17, 2014, 02:36:27 am »
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.

 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2740
  • Country: fr
    • kripton2035 schematics repository
Re: pi day - calculation of 3.1415926....
« Reply #7 on: March 17, 2014, 07:36:11 am »
int main()
{
long a=10000,b,c=2800,d,e,f[2801],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
the 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.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: pi day - calculation of 3.1415926....
« Reply #8 on: March 17, 2014, 08:45:42 am »
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...

Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline PeterG

  • Frequent Contributor
  • **
  • Posts: 836
  • Country: au
Re: pi day - calculation of 3.1415926....
« Reply #9 on: March 17, 2014, 08:55:43 am »
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...


Yes, fine work indeed. However, are the results repeatable?  ;D ;D

Regards
Testing one two three...
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: pi day - calculation of 3.1415926....
« Reply #10 on: March 17, 2014, 09:43:46 am »
Yes, fine work indeed. However, are the results repeatable?  ;D ;D
"good enough", with specified tolerance ;D
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline scientist

  • Frequent Contributor
  • **
  • !
  • Posts: 317
  • Country: 00
  • User banned.
Re: pi day - calculation of 3.1415926....
« Reply #11 on: March 18, 2014, 03:10:05 am »
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...


I demand a CNC'd version!
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: pi day - calculation of 3.1415926....
« Reply #12 on: March 18, 2014, 03:15:46 am »
I demand a CNC'd version!

Not CNC'd:



Well maybe can be CNC'd


 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: pi day - calculation of 3.1415926....
« Reply #13 on: March 18, 2014, 03:19:57 am »
Why no sqrt(2) day or phi day?  golden ratio day?


Or just 1/3 day.......
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: pi day - calculation of 3.1415926....
« Reply #14 on: March 18, 2014, 03:32:26 am »
Why no sqrt(2) day or phi day?  golden ratio day?


Or just 1/3 day.......

yup, 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 :)
« Last Edit: March 18, 2014, 04:00:35 am by miguelvp »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf