This article presents a computer speed quality measurment process.
The sieve of Eratosthenes is an algorithm to find prime numbers developed by the famous ancient Greek mathematician Eratosthenes . It is useful to measure the speed quality of a computer.
At this example , to find prime numbers, we will use the formula 2v+3, v=0,1,2,3... and killing all the multiples (the killed multiples are ocoupied by zeros at the result presentation at Hyperterminal).
To measure the speed of calculation of prime numbers we use the timer T2 that is included at GPT1 module of the microcontroller. The time base of T2 is configured by DAVE to be at 2560 μsec and the speed of calculation (the elapsed time at the T2 register) is measured to be at thousands of μsec. The clock of the microcontroller is configured by DAVE to run at 12.5 MHZ.
We can start, stop and read T2 using macros defined at gpt1.h file.
The C code The result |