source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/ads/7552/bads_mth.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 5.9 KB
Line 
1/***************************************************************************
2 *     (c)2003-2010 Broadcom Corporation
3 * 
4 *  This program is the proprietary software of Broadcom Corporation and/or its licensors,
5 *  and may only be used, duplicated, modified or distributed pursuant to the terms and
6 *  conditions of a separate, written license agreement executed between you and Broadcom
7 *  (an "Authorized License").  Except as set forth in an Authorized License, Broadcom grants
8 *  no license (express or implied), right to use, or waiver of any kind with respect to the
9 *  Software, and Broadcom expressly reserves all rights in and to the Software and all
10 *  intellectual property rights therein.  IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU
11 *  HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY
12 *  NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. 
13 *   
14 *  Except as expressly set forth in the Authorized License,
15 *   
16 *  1.     This program, including its structure, sequence and organization, constitutes the valuable trade
17 *  secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof,
18 *  and to use this information only in connection with your use of Broadcom integrated circuit products.
19 *   
20 *  2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
21 *  AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
22 *  WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
23 *  THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES
24 *  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE,
25 *  LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION
26 *  OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF
27 *  USE OR PERFORMANCE OF THE SOFTWARE.
28 * 
29 *  3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
30 *  LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
31 *  EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
32 *  USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF
33 *  THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT
34 *  ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
35 *  LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF
36 *  ANY LIMITED REMEDY.
37 *
38 * $brcm_Workfile: bads_mth.h $
39 * $brcm_Revision: Hydra_Software_Devel/1 $
40 * $brcm_Date: 10/10/11 2:05p $
41 *
42 * Module Description:
43 *
44 * Revision History:
45 *
46 ***************************************************************************/
47
48
49#ifndef __BADS_MTH_H__
50#define __BADS_MTH_H__
51
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57/***************************************************************************
58* Define Math
59****************************************************************************/
60
61/*Function to get twos complement of a 32 bit register*/
62#define Twos_Complement32(x) ((uint32_t)((x ^ 0xFFFFFFFF) + 1))
63
64#define POWER2_0 1
65#define POWER2_1 2
66#define POWER2_2 4
67#define POWER2_3 8
68#define POWER2_4 16
69#define POWER2_5 32
70#define POWER2_6 64
71#define POWER2_7 128
72#define POWER2_8 256
73#define POWER2_9 512
74#define POWER2_10 1024
75#define POWER2_11 2048
76#define POWER2_12 4096
77#define POWER2_13 8192
78#define POWER2_14 16384
79#define POWER2_15 32768
80#define POWER2_16 65536
81#define POWER2_17 131072
82#define POWER2_18 262144
83#define POWER2_19 524288
84#define POWER2_20 1048576
85#define POWER2_21 2097152
86#define POWER2_22 4194304
87#define POWER2_23 8388608
88#define POWER2_24 16777216
89#define POWER2_25 33554432
90#define POWER2_26 67108864
91#define POWER2_27 134217728
92#define POWER2_28 268435456
93#define POWER2_29 536870912
94#define POWER2_30 1073741824
95#define POWER2_31 2147483648UL
96
97
98
99#define POWER2_0_M1 0
100#define POWER2_1_M1 1
101#define POWER2_2_M1 3
102#define POWER2_3_M1 7
103#define POWER2_4_M1 15
104#define POWER2_5_M1 31
105#define POWER2_6_M1 63
106#define POWER2_7_M1 127
107#define POWER2_8_M1 255
108#define POWER2_9_M1 511
109#define POWER2_10_M1 1023
110#define POWER2_11_M1 2047
111#define POWER2_12_M1 4095
112#define POWER2_13_M1 8191
113#define POWER2_14_M1 16383
114#define POWER2_15_M1 32767
115#define POWER2_16_M1 65535
116#define POWER2_17_M1 131071
117#define POWER2_18_M1 262143
118#define POWER2_19_M1 524287
119#define POWER2_20_M1 1048575
120#define POWER2_21_M1 2097151
121#define POWER2_22_M1 4194303
122#define POWER2_23_M1 8388607
123#define POWER2_24_M1 16777215
124#define POWER2_25_M1 33554431
125#define POWER2_26_M1 67108863
126#define POWER2_27_M1 134217727
127#define POWER2_28_M1 268435455
128#define POWER2_29_M1 536870911
129#define POWER2_30_M1 1073741823
130#define POWER2_31_M1 2147483647
131#define POWER2_32_M1 4294967295UL
132
133
134#define LOG10_POWER2_0_X5120 0
135#define LOG10_POWER2_1_X5120 1541
136#define LOG10_POWER2_2_X5120 3083
137#define LOG10_POWER2_3_X5120 4624
138#define LOG10_POWER2_4_X5120 6165
139#define LOG10_POWER2_5_X5120 7706
140#define LOG10_POWER2_6_X5120 9248
141#define LOG10_POWER2_7_X5120 10789
142#define LOG10_POWER2_8_X5120 12330
143#define LOG10_POWER2_9_X5120 13871
144#define LOG10_POWER2_10_X5120 15413
145#define LOG10_POWER2_11_X5120 16954
146#define LOG10_POWER2_12_X5120 18495
147#define LOG10_POWER2_13_X5120 20037
148#define LOG10_POWER2_14_X5120 21578
149#define LOG10_POWER2_15_X5120 23119
150#define LOG10_POWER2_16_X5120 24660
151#define LOG10_POWER2_17_X5120 26202
152#define LOG10_POWER2_18_X5120 27743
153#define LOG10_POWER2_19_X5120 29284
154#define LOG10_POWER2_20_X5120 30825
155#define LOG10_POWER2_21_X5120 32367
156#define LOG10_POWER2_22_X5120 33908
157#define LOG10_POWER2_23_X5120 35449
158#define LOG10_POWER2_24_X5120 36991
159#define LOG10_POWER2_25_X5120 38532
160#define LOG10_POWER2_26_X5120 40073
161#define LOG10_POWER2_27_X5120 41614
162#define LOG10_POWER2_28_X5120 43156
163#define LOG10_POWER2_29_X5120 44697
164#define LOG10_POWER2_30_X5120 46238
165#define LOG10_POWER2_31_X5120 47779
166#define LOG10_POWER2_32_X5120 49321 
167
168
169
170#ifdef __cplusplus
171}
172#endif
173 
174#endif
175
176
177
Note: See TracBrowser for help on using the repository browser.