Having random x and y between 0 to 1 and compare the added squares with 1. Using 8-bit fixed-point number.
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 edge counter recommended(funnyblinky is a possible choice)
# | Input | Output |
---|---|---|
0 | clock | counter 0 |
1 | reset | counter 1 |
2 | sw control 0 | counter 2 |
3 | sw control 1 | counter 3 |
4 | counter 4 | |
5 | counter 5 | |
6 | counter 6 | |
7 | counter 7 |