Forum Discussion
Altera_Forum
Honored Contributor
18 years agocalculate pi in verilog
Im trying to develop a system which will calculate pi using verilog and using the Gregory Leibniz series. this is the equation pi = 4 x ( (-1)^n / 2n+1 ); where n = 0 to infinity ive tri...
Altera_Forum
Honored Contributor
18 years agonaamhin,
You can try to get a look at the LPM_DIVIDE megafunction for the division. AFAIK, it is not possible to use the divide '/' operator in verilog directly for creating logic. In a simulator I think it should work. Be careful with the number of bits you use for the calculations. You should investigate how much bits you need for a particular precision of your resulting PI value. Stefaan