1 |
8 |
Papayaved |
`ifndef _atan32_table_
|
2 |
|
|
`define _atan32_table_
|
3 |
|
|
// atan table for values 1, 1/2, 1/4, 1/8, 1/16...
|
4 |
|
|
// Scale: code 2^30 = 90 deg, code 0 = 0 deg
|
5 |
|
|
|
6 |
|
|
package ConstPkg;
|
7 |
|
|
|
8 |
|
|
parameter STEPS = 32;
|
9 |
|
|
parameter real K = 0.6072529350088813;
|
10 |
|
|
parameter bit [29:0] K_u30 = 30'h26dd3b6a;
|
11 |
|
|
parameter bit [31:0] K_u32 = 32'h9b74eda8;
|
12 |
|
|
// for sin and cos start calculation from vector {K_u30, 0}
|
13 |
|
|
// modulus of vector {I, Q} = (coe_abs * K_u32) >> 32
|
14 |
|
|
// last table value dont use
|
15 |
|
|
|
16 |
|
|
parameter bit signed [31:0] atan_table[STEPS] = '{
|
17 |
|
|
32'sh20000000, // tan = 1/2^1 = 1/2
|
18 |
|
|
32'sh12e4051e, // tan = 1/2^2 = 1/4
|
19 |
|
|
32'sh09fb385b, // tan = 1/2^3 = 1/8
|
20 |
|
|
32'sh051111d4, // tan = 1/2^4 = 1/16
|
21 |
|
|
32'sh028b0d43, // tan = 1/2^5 = 1/32
|
22 |
|
|
32'sh0145d7e1, // tan = 1/2^6 = 1/64
|
23 |
|
|
32'sh00a2f61e, // tan = 1/2^7 = 1/128
|
24 |
|
|
32'sh00517c55, // tan = 1/2^8 = 1/256
|
25 |
|
|
32'sh0028be53, // tan = 1/2^9 = 1/512
|
26 |
|
|
32'sh00145f2f, // tan = 1/2^10 = 1/1024
|
27 |
|
|
32'sh000a2f98, // tan = 1/2^11 = 1/2048
|
28 |
|
|
32'sh000517cc, // tan = 1/2^12 = 1/4096
|
29 |
|
|
32'sh00028be6, // tan = 1/2^13 = 1/8192
|
30 |
|
|
32'sh000145f3, // tan = 1/2^14 = 1/16384
|
31 |
|
|
32'sh0000a2fa, // tan = 1/2^15 = 1/32768
|
32 |
|
|
32'sh0000517d, // tan = 1/2^16 = 1/65536
|
33 |
|
|
32'sh000028be, // tan = 1/2^17 = 1/131072
|
34 |
|
|
32'sh0000145f, // tan = 1/2^18 = 1/262144
|
35 |
|
|
32'sh00000a30, // tan = 1/2^19 = 1/524288
|
36 |
|
|
32'sh00000518, // tan = 1/2^20 = 1/1048576
|
37 |
|
|
32'sh0000028c, // tan = 1/2^21 = 1/2097152
|
38 |
|
|
32'sh00000146, // tan = 1/2^22 = 1/4194304
|
39 |
|
|
32'sh000000a3, // tan = 1/2^23 = 1/8388608
|
40 |
|
|
32'sh00000051, // tan = 1/2^24 = 1/16777216
|
41 |
|
|
32'sh00000029, // tan = 1/2^25 = 1/33554432
|
42 |
|
|
32'sh00000014, // tan = 1/2^26 = 1/67108864
|
43 |
|
|
32'sh0000000a, // tan = 1/2^27 = 1/134217728
|
44 |
|
|
32'sh00000005, // tan = 1/2^28 = 1/268435456
|
45 |
|
|
32'sh00000003, // tan = 1/2^29 = 1/536870912
|
46 |
|
|
32'sh00000001, // tan = 1/2^30 = 1/1073741824
|
47 |
|
|
32'sh00000001, // tan = 1/2^31 = 1/2147483648
|
48 |
|
|
32'sh00000000 // tan = 1/2^32 = 1/4294967296
|
49 |
|
|
};
|
50 |
|
|
|
51 |
|
|
endpackage: ConstPkg
|
52 |
|
|
|
53 |
|
|
`endif
|