Menu

Improved program for calculation of pi

2019-03-31
2019-07-08
  • Dag Stroman

    Dag Stroman - 2019-03-31

    Hi all,

    I did some improvements on the pi calculation program and thought I should share that too.

    The new version contain several optimizations to save space, allowing for other improvements. The precision has been increased with two bytes to six bytes in total. This gives another 5 decimal digits to the result. The division loop contain new code to skip some unnecessary subtraction. This saves about 25 minutes of execution. The transformation from binary to decimal is made with a quicker algo for multiplicaton by 10 so the result is delivered quicker. And perhaps the most visible improvement: The full resulting decimal value of pi is now also scrolled on the board memory display (at 0x00).

    • Load program from p2.lst
    • Set memory address to 0x00
    • Run from 0x2d

    Program is not re-entrant; If you want to run it again, you have to load the program into memory again.

    Please find more details in the pi2.asm file.

    Enjoy!

    /Dag

     
    • Stez

      Stez - 2019-04-01

      Dag,
      Wow! This is even more awsome!
      Pi= 3.1415926535897 this took my relay computer about an hour at medium speed.
      I don't know what else to say but thank you for your effort, you deserve a medal!
      Steee
      UK

       
    • Francis Bauer

      Francis Bauer - 2019-04-01

      Way cool. My relay computer took a little over an hour at medium speed to calculate the values and then about 5 minutes to present the results. Having the result scroll on the relay computer's display is nice.

      Thank you for the new version...

       
    • Ryan Crosby

      Ryan Crosby - 2019-07-08

      This is awesome. My computer is at 83f1ee37 so far and I can't wait for the final result.

      Would you mind if I checked both versions of your code into my repo? (with full credit to you of course):

      https://github.com/crozone/relaysbc-programs

      I'm trying to collect all the programs I find into one place for safe keeping.

      EDIT:

      ......................!
      pi=3.1415926535897

      Absolutely incredible. Thank you so much for this.

      Video:

      https://youtu.be/yid_RYGp4x0

       

      Last edit: Ryan Crosby 2019-07-08
      • Dag Stroman

        Dag Stroman - 2019-07-08

        Hi Ryan,

        Glad you like my pi hack. And nice to hear that your calculation ended with the correct result. :-) Please go ahead and add my programs to your library.

        Best regards,
        /Dag

         

Log in to post a comment.

MongoDB Logo MongoDB