OpenCores
URL https://opencores.org/ocsvn/Aquarius/Aquarius/trunk

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [application/] [shc_pi/] [readme.txt] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 thorn_aitc
//===============================
2
// Calculate Circular Constant Pi
3
// (1024 figures)
4
//-------------------------------
5
// for VirtexE Evaluation Board
6
// July.20 2003 Ver.1
7
//===============================
8
 
9
1. Introduction
10
---------------------------
11
This is a program for calculating the Circular Constant (Pi).
12
This source program can make 1024 figures after the decimal fraction.
13
If you have large memory space, you can expand figures
14
to be calculated only by changing the definition of MAXFIGURE.
15
This program is also a good verification of Aquarius quality.
16
 
17
2. Algorithm
18
---------------------------
19
This program uses the basic Matin's formula.
20
    PI/4 =  4*arctan(1/5) -   arctan(1/239)
21
    arctan(1/p) = 1/p - 1/(3*p^3) + 1/(5*p^5) - 1/(7*p^7) + ...
22
 
23
3. How to compile
24
---------------------------
25
Simply make it.
26
    $ make clean
27
    $ make
28
Then, it creates a program for the FPGA System
29
which is described in Aquarius document.
30
 
31
4. Performace
32
---------------------------
33
To calculate 1024 figures,
34
it approximately takes 4.5sec@20MHz.
35
(Aquarius don't have RTC yet,
36
so accurate speed can not be measured.)
37
 
38
5. Result
39
---------------------------
40
Load the s-format object by the Aquarius monitor,
41
and run it from the address 0x00002008.
42
This program displays the result on LCD display
43
on the Aquarius FPGA System, like as follows.
44
Hit any key to page.
45
================
46
Constant Pi = 3.
47
 
48
1415926535897932
49
3846264338327950
50
 
51
2884197169399375
52
1058209749445923
53
 
54
0781640628620899
55
8628034825342117
56
 
57
0679821480865132
58
8230664709384460
59
 
60
9550582231725359
61
4081284811174502
62
 
63
8410270193852110
64
5559644622948954
65
 
66
9303819644288109
67
7566593344612847
68
 
69
5648233786783165
70
2712019091456485
71
 
72
6692346034861045
73
4326648213393607
74
 
75
2602491412737245
76
8700660631558817
77
 
78
4881520920962829
79
2540917153643678
80
 
81
9259036001133053
82
0548820466521384
83
 
84
1469519415116094
85
3305727036575959
86
 
87
1953092186117381
88
9326117931051185
89
 
90
4807446237996274
91
9567351885752724
92
 
93
8912279381830119
94
4912983367336244
95
 
96
0656643086021394
97
9463952247371907
98
 
99
0217986094370277
100
0539217176293176
101
 
102
7523846748184676
103
6940513200056812
104
 
105
7145263560827785
106
7713427577896091
107
 
108
7363717872146844
109
0901224953430146
110
 
111
5495853710507922
112
7968925892354201
113
 
114
9956112129021960
115
8640344181598136
116
 
117
2977477130996051
118
8707211349999998
119
 
120
3729780499510597
121
3173281609631859
122
 
123
5024459455346908
124
3026425223082533
125
 
126
4468503526193118
127
8171010003137838
128
 
129
7528865875332083
130
8142061717766914
131
 
132
7303598253490428
133
7554687311595628
134
 
135
6388235378759375
136
1957781857780532
137
 
138
1712268066130019
139
2787661119590921
140
 
141
6420198938095257
142
2010654858632788
143
================
144
 
145
End of document.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.