Prime Number Prog as Benchmark for my Gigatron build
Posted: 22 Dec 2018, 21:27
Hi Community,
As my first soldering project I built the gigatron without any error, thanks for the great instructions!!
As benchmark I did a quick and dirty Program, that computes all prime numbers from 2-32767. Ofcourse, all the usual arithmetical improvemnets are implemented, as they are: only dividing thru earlier computed prime numbers till the half of the tested number and ofcourse only testing odd numbers above 2. I am not a programmer, so I am sure there are many of improvement possibilities in code, so any improvement suggestions are greatly welcome!! The last displayed number on screen is the 3512, the number of found prime numbers. The referenced basic program on github takes about 3 minutes for 1-200, my version about 2 seconds, the whole run till 32767 is about 3 hours and 45 minutes in lowest vga mode. if you are interested, my code is attached, the display of the computed prime numbers is copied from the examples directory.
many thanks to the originators of that great project, I do it for educational purpose and its great therefor!
peter
As my first soldering project I built the gigatron without any error, thanks for the great instructions!!
As benchmark I did a quick and dirty Program, that computes all prime numbers from 2-32767. Ofcourse, all the usual arithmetical improvemnets are implemented, as they are: only dividing thru earlier computed prime numbers till the half of the tested number and ofcourse only testing odd numbers above 2. I am not a programmer, so I am sure there are many of improvement possibilities in code, so any improvement suggestions are greatly welcome!! The last displayed number on screen is the 3512, the number of found prime numbers. The referenced basic program on github takes about 3 minutes for 1-200, my version about 2 seconds, the whole run till 32767 is about 3 hours and 45 minutes in lowest vga mode. if you are interested, my code is attached, the display of the computed prime numbers is copied from the examples directory.
many thanks to the originators of that great project, I do it for educational purpose and its great therefor!
peter