97 Monte Carlo Pi Integrator

97 : Monte Carlo Pi Integrator

Select Project123456789ONSW2
  • Author: regymm
  • Description: Calculate the value of Pi using the Monte Carlo method
  • GitHub repository
  • Clock: 1000 Hz

How it works

Having random x and y between 0 to 1 and compare the added squares with 1. Using 8-bit fixed-point number.

How to test

SW 00: counter shows total sample points. SW 01: counter shows sample points inside 1 radius. SW 10: counter 0 and 1 will toggle, 0 for every sample point and 1 for inside point, for use with external counter.

External hardware

External edge counter recommended(funnyblinky is a possible choice)

IO

#InputOutput
0clockcounter 0
1resetcounter 1
2sw control 0counter 2
3sw control 1counter 3
4counter 4
5counter 5
6counter 6
7counter 7