亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mmath.h

?? TDK 6521 SOC 芯片 DEMO程序
?? H
字號:
/***************************************************************************
 * This code and information is provided "as is" without warranty of any   *
 * kind, either expressed or implied, including but not limited to the     *
 * implied warranties of merchantability and/or fitness for a particular   *
 * purpose.                                                                *
 *                                                                         *
 * Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved.    *
 ***************************************************************************/
//**************************************************************************
//  DESCRIPTION: 71M652x Meter MATH library. 
// 
//  AUTHOR:  MTF
//
//  HISTORY: See end of file.
//**************************************************************************
// File:  MMATH.H
//
#ifndef MATH_H
#define MATH_H 1
//===========================================================================//
// 'add', 'add_1', 'add_2', 'add8_8', 'add8_4', 'abs_x'..
// 'sub', 'sub_1', 'sub8_8', 'sub8_4' work w/ 2s-complement integers.
//
// All other functions work with non-negative values.
// All non-void routines return 'carry' or 'borrow'.
//===========================================================================//
// Binary addition of 8n-bit 'x'; Also works w/ 2s-complement numbers. 
//                 to 8n-bit 'y'.
// *x += *y;       returns carry.
int8_t add (uint8x_t *x, uint8p_t *y, uint8_t n);

// Binary addition of 8-bit 'y_',
//                 to 8n-bit 'x'.
// *x += y_;       returns carry.
int8_t add_1 (uint8x_t *x, uint8_t n, int8_t y_);

#if PULSE_CNT
// Binary addition of 16-bit 'y_',
//                 to 8n-bit 'x'.
// *x += y_;       returns carry.
int8_t add_2 (uint8x_t *x, uint8_t n, int16_t y_) small reentrant;
#endif

// Binary addition of 64-bit 'y'; Also works w/ 2s-complement numbers. 
//                 to 64-bit 'x'.
// *x += *y;
void add8_8 (uint8x_t *x, uint8x_t *y);

// Binary addition of 32-bit 'y'; Also works w/ 2s-complement numbers. 
//                 to 64-bit 'x'.
// *x += *y;
void add8_4 (uint8x_t *x, uint8p_t *y);

//===========================================================================//
// Binary subtraction of 8n-bit 'y'; Also works w/ 2s-complement numbers. 
//                  from 8n-bit 'x'.
// *x -= *y;        returns borrow.
int8_t sub (uint8x_t *x, uint8p_t *y, uint8_t n);

// Binary subtraction of 8-bit 'y_',
//                 from 8n-bit 'x'.
// *x -= y_;       returns the borrow.
int8_t sub_1 (uint8x_t *x, uint8_t n, int8_t y_);

// Binary subtraction of 16-bit 'y_',
//                  from 8n-bit 'x'.
// *x -= y_;       returns the borrow.
int8_t sub_2 (uint8x_t *x, uint8_t n, int16_t y_);

// Binary subtraction 64-bit 'y'; Also works w/ 2s-complement numbers. 
//               from 64-bit 'x'.
// *x -= *y;
void sub8_8 (uint8x_t *x, uint8p_t *y);

// Binary subtraction 32-bit 'y'; Also works w/ 2s-complement numbers.
//               from 64-bit 'x'.
// x -= y;
void sub8_4 (uint8x_t *x, uint8p_t *y);

//===========================================================================//
// Binary multiplication of 8m-bit 'y',
//                      and 8n-bit 'x',
//    leaving result in 8(n+m)-bit 'w'; 't' is a scratchpad for partial products.
// *w = *x * *y; 
void multiply (uint8x_t *w, uint8x_t *x, uint8_t m, uint8p_t *y, uint8_t n, uint8p_t *t);

// Multiply and accumulate positive 8n-bit partial product into 'w'.
// Multiplication of 8n-bit 'x',
//               and  8-bit 'y_', accumulated positive into 'w'.
// *w += *x * y_;       't' is a scratchpad for partial products.
uint8_t macp (uint8x_t *w, uint8x_t *x, uint8_t n, uint8_t y_, uint8p_t *t);

// Binary multiplicaton of 8n-bit 'x',
//                      by  8-bit 'y_',
//      leaving result in  8n-bit 'w' with a returned carry.
// w = x * y_;          't' is a scratchpad for partial products.
uint8_t multiply_1 (uint8p_t *w, uint8x_t *x, uint8_t n, uint8_t y_);

//---------------------------------------------------------------------------//
// Binary multiplicaton of 64-bit 'x',
//                      by 32-bit 'y'.
//       leaving result in 96-bit 'w'.
// *w  = *x * *y;
void multiply_8_4 (uint8x_t *w, uint8x_t *x, uint8p_t *y);

// Multiply and accumulate positive 64-bit partial product into 'w'.
// *w += *x * y_;       't' is a scratchpad for partial product.
uint8_t macp8 (uint8x_t *w, uint8x_t *x, uint8_t y_, uint8p_t *t);

// Binary multiplicaton of 64-bit 'x',
//                      by  8-bit 'y_',
//       leaving result in 64-bit 'w' with a returned carry.
// *w  = *x * y_;
uint8_t multiply_8_1 (uint8p_t *w, uint8x_t *x, uint8_t y_);

//---------------------------------------------------------------------------//
// Binary multiplicaton of 32-bit 'x',
//                      by 32-bit 'y',
//       leaving result in 64-bit 'w'.
// *w  = *x * *y;
void multiply_4_4 (uint8x_t *w, uint8x_t *x, uint8p_t *y);

// Multiply and accumulate positive 32-bit partial product into 'w'.
// *w += *x * y_;       't' is a scratchpad for partial product.
uint8_t macp4 (uint8x_t *w, uint8x_t *x, uint8_t y_, uint8p_t *t) ;

// Binary multiplicaton of 32-bit 'x',
//                      by  8-bit 'y_',
//       leaving result in 32-bit 'w' with a returned carry.
// *w  = *x * y_;
uint8_t multiply_4_1 (uint8p_t *w, uint8x_t *x, uint8_t y_);

//---------------------------------------------------------------------------//
// About twice as fast as general multiply.
// Binary squaring of 8n-bit 'x',
// leaving result in 16n-bit 'w'.
// *w = *x ** 2;   Square n-byte 'x' into a 2n-byte 'w'.
void square (uint8x_t *w, uint8p_t *x, uint8_t n);

//===========================================================================//
// Binary divide of unnormalized 8m-bit 'u',
//               by unnormalized 8n-bit 'v',
// leaving quotient & remainder back in 'u'. 
// *u /= *v; 't' = temporary storage, allocate at least 'm' bytes.
// The dividend 'u' becomes the quotient and remainder;
// Remainder is in the low order part of 'u'.
// divide() returns how many bytes are in the quotient.
uint8_t divide (uint8x_t *u, uint8_t m, uint8x_t *v, uint8_t n, uint8p_t *t);

// Normalize 8m-bit dividend 'u' and 8n-bit divisor 'v' so division is possible.
// It makes the divisor 'v' such that the first digit is..
// ..greater than half the first digit of the dividend 'u'.
// 't' = temporary storage, allocate at least 'm' bytes.
uint8_t normalize (uint8x_t *u, uint8_t m, uint8x_t *v, uint8_t n, uint8p_t *t);

// Takes a 64-bit 'w',
// Returns a 32-bit number containing the least significant 6 decimal digits.
uint32_t Mod10_6 (uint8x_t *w);

// Binary divide of normalized 8m-bit 'u',
//               by normalized 8n-bit 'v',
// leaving quotient & remainder back in 'u'. 
// *u /= *v; like divide, except it assumes everything is already normalized.
void divide_ (uint8x_t *u, uint8_t m, uint8p_t *v, uint8_t n, uint8p_t *t);


// Multiply and accumulate negative, a 32-bit partial product 'u'.
// (uint32x_t) u += (uint32i_t) v * (uint8_t) q_; 't' is a scratchpad for partial product.
// *u -= *v * *q_; 'q_' is the intermediate quotient, a single byte, 
uint8_t macn (uint8x_t *u, uint8p_t *v, uint8_t n, uint8_t q_, uint8p_t *t);

// *u /= v;
void divide_1 (uint8x_t *u, uint8_t n, uint8_t v);
//---------------------------------------------------------------------------//
// Shift (in-place) n-byte 'x' to the right by 's' bits.
void shift_right (uint8x_t *x, uint8_t n, uint8_t s);

// Calculates the absolute (positive) value of 'x'. 
void abs_x (uint8x_t *x, uint8x_t *x0, uint8_t n);

// Calculates the twos complement value of 'x'.
void complement_x (uint8x_t *x, uint8x_t *x0, uint8_t n);

// Returns the log base 2 of 'k'.
uint8_t log2 (uint16_t k) small reentrant;

// returns the maximum of a and b
uint32_t lmax (uint32_t a, uint32_t b) small reentrant;

// returns the minimum of a and b
uint32_t lmin (uint32_t a, uint32_t b) small reentrant;

// returns the absolute (positive) value of a
int32_t labsx (int32_t a) small reentrant;

//---------------------------------------------------------------------------//
//  Domain of following equation is |tan(theta)| <= 1.
//
//  atan(tan(theta)) = -3/10 + 62 * tan(theta) - 100/6 * tan(theta)^2 degrees.
//  accurate to less than one degree (about 0.1 degree)
//
//  atan(y/x) = -3/10 + 62 * (y/x) - 100/6 * (y/x)^2 degrees.
//            = -3/10 + (y/x) * [62  - 100/6 * (y/x)] degrees.
//            = -3/10 + (y/x) * [62  - 50/3 *  (y/x)] degrees.
//
//  atan(y/x) * 1000  = [62000 - ((y * 1000 / x) * 50 / 3)] * y / x - 300 mDegrees.
//                    = [62000 - ((y * 50000 / x) / 3)] * y / x - 300 mDegrees.
//                    = [62000 -  (y * 16667 / x)] * y / x - 300 mDegrees.
//  
//  Scale y and x so that y < x < 2^16. 
//  
uint32_t latan2 (int32_t sy, int32_t sx);

//---------------------------------------------------------------------------//
// Takes the square root of 64-bit 'x' and produces 32-bit result.
uint32_t sqrt8_4 (uint8p_t *x);

// Returns the 32-bit square root of the 32-bit argument 'x'.
// The most  significant two bytes of result are the integer part,
// the least significant two bytes of result are the fractional part.
uint32_t sqrt4_4 (int32_t x);      // Sqrt (y << 16).

// Returns the 16-bit square root of the 32-bit argument 'x'.
uint16_t sqrt4_2 (int32_t x); 

// Shift 64-bit 'x' right 1 bit.
void shift_right8_1 (uint8x_t *x);

// Shift 64-bit 'x' right  2 bits.
void shift_right8_2 (uint8x_t *x);

// converts 64-bit number to float. Has up to 40 bits of underflow!!
float s2f (uint8x_t *s);

// standard C99 library function not provided by Keil
// converts a float to the nearest long integer.
// Keil's float->long conversion has some defects at boundaries.
// e.g. INT32_MIN  (0x8000000) doesn't convert correctly to float.
long lroundf (float f);

#endif
/***************************************************************************
 * History
 * $Log: mmath.h,v $
 * Revision 1.6  2006/09/09 01:15:34  gmikef
 * *** empty log message ***
 *
 * Revision 1.5  2006/08/30 02:09:59  gmikef
 * *** empty log message ***
 *
 * Revision 1.4  2006/04/12 00:30:41  tvander
 * Added code for phased calibration, 6513 compiled with equations 3 and 4.
 *
 * Revision 1.3  2006/03/06 03:42:47  Michael T. Fischer
 * More 6530 prep.
 *
 * Revision 1.2  2006/01/10 04:13:01  gmikef
 * Added PDATA support for CE Outputs.
 *
 * Revision 1.1  2006/01/04 04:47:57  gmikef
 * Switched RMS and VA calculations to use floating point. (and Calibration).
 *
 * Revision 1.14  2005/09/22 23:45:27  tvander
 * Clean build all models and unit tests, updated copyright to be fore Teridian
 *
 * Revision 1.13  2005/08/10 02:06:11  gmikef
 * *** empty log message ***
 *
 * Revision 1.12  2005/06/25 02:04:45  tvander
 * Integrated pulse counting
 *
 * Revision 1.11  2005/06/17 22:54:46  tvander
 * Separated imports and exports.
 * Some imports and exports were not being updated.
 *
 * Revision 1.10  2005/05/13 00:34:48  tvander
 * 6511/32k works
 * Integrated and debugged self-calibration.
 * The build has one unused segment, and no other errors or warnings.
 * default LCD and pulse displays appear OK.
 * EEPROM, software timers and hardware timers are all integrated.
 *
 * Revision 1.9  2005/05/04 01:00:53  gmikef
 * *** empty log message ***
 *
 * Revision 1.10  2005/05/03 22:29:41  gmikef
 * *** empty log message ***
 *
 * Revision 1.9  2005/05/03 02:18:56  gmikef
 * *** empty log message ***
 *
 * Revision 1.8  2005/05/02 18:03:20  gmikef
 * *** empty log message ***
 *
 * Revision 1.8  2005/04/30 02:19:22  gmikef
 * *** empty log message ***
 *
 * Revision 1.7  2005/04/28 19:12:27  tvander
 * Comments only!  Restored history comments.
 *
 * Revision 1.6  2005/04/27 23:47:43  gmikef
 * Some MATH rountines now use 'idata'.
 * Added MATH_FAST flag to 'options.h".
 * Changed "6521B.Uv2" to max optimization.
 *
 * Revision 1.5  2005/04/21 02:07:51  gmikef
 * *** empty log message ***
 *
 * Revision 1.4  2005/04/20 00:10:41  tvander
 * Revised the comments.  Hopefully they're more readable.
 *
 * Revision 1.3  2005/04/19 18:08:15  tvander
 * First working flag interface.
 *
 * Revision 1.2  2005/04/13 16:36:28  tvander
 * Removed spurious text
 *
 * Revision 1.1  2005/04/12 21:53:35  tvander
 * Library and math, compiles ok, added some comments (needs more)
 *
 * Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved.    *
 * this program is fully protected by the United States copyright          *
 * laws and is the property of Teridian Semiconductor Corporation.         *
 ***************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合网色综合| 同产精品九九九| 成人av在线一区二区三区| 精品美女被调教视频大全网站| 国产成人午夜高潮毛片| 蜜臀精品久久久久久蜜臀| 亚洲黄色在线视频| 国产精品久久久久9999吃药| 99精品久久只有精品| 欧美一区二区三区四区视频| 国产日韩欧美电影| 久久99精品国产麻豆婷婷| 午夜精品爽啪视频| 不卡一区中文字幕| 久久综合狠狠综合久久激情| 欧美成人午夜电影| 午夜久久电影网| 欧美性猛片xxxx免费看久爱| 在线观看一区二区视频| 亚洲五月六月丁香激情| 国产一区二区三区四区五区美女 | 99视频一区二区| 精品国精品国产| 日本成人超碰在线观看| 色爱区综合激月婷婷| 国产精品情趣视频| 激情偷乱视频一区二区三区| 日韩三区在线观看| 午夜精品福利一区二区三区av| 日韩一区二区三区视频在线| 成人av网址在线观看| 亚洲第一电影网| 日本韩国欧美一区| 久草在线在线精品观看| 国产精品欧美久久久久无广告 | 免费成人av在线播放| 欧美在线看片a免费观看| 蜜桃视频免费观看一区| 国产精品入口麻豆原神| 91精品蜜臀在线一区尤物| 一区二区免费看| 99久久国产综合色|国产精品| 亚洲成人第一页| 欧美激情一区在线| 99久久er热在这里只有精品66| 亚洲成a天堂v人片| 亚洲欧洲精品一区二区三区| 不卡的av电影在线观看| 蜜桃免费网站一区二区三区| 亚洲一区二区中文在线| 欧美日韩高清一区二区不卡 | 欧美日韩国产一区二区三区地区| 国产九色sp调教91| 亚洲精品在线电影| 美国av一区二区| 亚洲综合清纯丝袜自拍| 国产精品萝li| 国产日韩在线不卡| 欧美一区二区三区免费观看视频 | 欧美四级电影在线观看| 粉嫩一区二区三区在线看| 国产精品白丝在线| 2023国产精华国产精品| 91精品国产福利| 欧美色图在线观看| 91片黄在线观看| 午夜精品一区在线观看| 亚洲国产你懂的| 17c精品麻豆一区二区免费| 国产日韩v精品一区二区| 欧美日韩国产精品自在自线| 日韩成人午夜精品| 日韩专区欧美专区| 久久精品免视看| 成人丝袜18视频在线观看| 亚洲精品ww久久久久久p站| 一区二区中文字幕在线| 看片网站欧美日韩| 色av成人天堂桃色av| 日本特黄久久久高潮| 色88888久久久久久影院按摩| 久久国产精品免费| 黑人精品欧美一区二区蜜桃| 2020国产精品| 久久久久国产免费免费| 在线观看国产日韩| 在线免费观看成人短视频| 色国产精品一区在线观看| 色综合中文字幕国产 | 国产午夜亚洲精品理论片色戒| 日韩三级中文字幕| 欧美精品一区二区三区一线天视频| 精品精品国产高清a毛片牛牛| 欧美一激情一区二区三区| 日韩欧美在线综合网| 九九九精品视频| 亚洲欧美aⅴ...| 一本到不卡精品视频在线观看 | 91在线一区二区| 色狠狠一区二区| 国产在线视频一区二区三区| 国产jizzjizz一区二区| 91片在线免费观看| 3atv一区二区三区| 久久亚区不卡日本| 综合精品久久久| 国产日产欧美一区| 日日摸夜夜添夜夜添国产精品| 一区二区免费在线| 亚洲一区在线观看免费| 欧美一区二区观看视频| 欧美精品第1页| 欧美综合一区二区三区| 国产中文字幕精品| 色综合天天在线| 欧美一区二区三区免费| 国产精品网友自拍| 亚洲r级在线视频| 国产成人一区在线| 欧美色电影在线| 色婷婷综合激情| 欧美一区二区私人影院日本| 国产精品区一区二区三| 日韩一区二区三区电影在线观看| av在线不卡网| 91国产免费看| 精品视频123区在线观看| 国产三级欧美三级日产三级99| 久久久久久久精| 亚洲成人av电影在线| 国产成人亚洲综合a∨婷婷图片| 精品视频在线免费| 国产清纯在线一区二区www| 精品久久久久久久久久久院品网| 色欧美日韩亚洲| 欧美一级日韩免费不卡| 久久久亚洲高清| 中文字幕中文在线不卡住| 5858s免费视频成人| 亚洲天堂av一区| 国产麻豆精品在线| 91精品在线一区二区| 欧洲在线/亚洲| 国产欧美视频一区二区三区| 蜜臀99久久精品久久久久久软件| 91成人国产精品| 亚洲欧洲精品一区二区三区 | 成人黄色av网站在线| 日韩一级二级三级| 午夜婷婷国产麻豆精品| 国产91精品久久久久久久网曝门| 欧美zozo另类异族| 亚洲午夜三级在线| 一本久久a久久精品亚洲| 国产日韩在线不卡| 国产麻豆视频精品| 精品国产精品一区二区夜夜嗨| 亚洲成人在线网站| 91丨九色丨蝌蚪富婆spa| 中文字幕av一区二区三区免费看| 国产一区欧美二区| 精品欧美一区二区三区精品久久| 日韩影院在线观看| 在线观看亚洲精品视频| 一区二区国产视频| 欧美午夜电影网| 亚洲一区在线看| 欧美精品高清视频| 日本中文字幕不卡| 欧美成人在线直播| 精品综合久久久久久8888| 日韩欧美另类在线| 国产欧美精品日韩区二区麻豆天美| 久久国产生活片100| 欧美va在线播放| 另类欧美日韩国产在线| 欧美mv日韩mv| 国产一区二区三区在线观看精品| 久久久久久久性| 不卡视频在线观看| 亚洲卡通动漫在线| 欧美日韩国产影片| 国内精品视频一区二区三区八戒| 久久久久99精品一区| 北条麻妃国产九九精品视频| 亚洲三级电影网站| 欧美无乱码久久久免费午夜一区| 亚洲成人av一区二区三区| 日韩欧美另类在线| 亚洲国产精品一区二区久久恐怖片| 欧美色中文字幕| 蜜桃91丨九色丨蝌蚪91桃色| 久久精品视频在线看| 91一区一区三区| 亚洲成av人片| 精品免费视频.| 亚洲图片自拍偷拍| 欧美成人三级在线| 91网页版在线| 美女爽到高潮91|