指甲硬是什么原因| 腋下属于什么科| 一直不来月经是什么原因| 渴望是什么意思| 什么蔬菜含钾量最高| 77年属什么| 四面佛是什么佛| 深千尺是什么意思| 南宁有什么特产| 最高法院院长什么级别| 护照补办需要什么材料| 白色虫子是什么虫图片| 牛的尾巴有什么作用| 夏天吹什么风| 激素是什么| 不应期是什么| 孩子结膜炎用什么眼药水| 维生素c弱阳性是什么意思| 陈皮是什么皮做的| 子字五行属什么| 一语惊醒梦中人是什么意思| 嘴皮发白是什么原因| 眼睛散光是什么症状| 为什么一喝酒就拉肚子| ptsd是什么意思| mm什么意思| 婚检是什么| 皮肤过敏不能吃什么| 梦见父母是什么意思| 秦始皇墓为什么不敢挖| 高血糖适合吃什么主食| 炎症是什么原因引起的| 肺火吃什么药| 做梦梦到男朋友出轨了是什么意思| 蛇为什么会咬人| 粉刺是什么| instagram什么意思| 三千烦恼丝什么意思| 巧克力不能和什么一起吃| 小孩子注意力不集中看什么科| 小儿惊痫是什么症状| 肝内囊性灶什么意思| 女贞子是什么| 喝盐水有什么作用和功效| 挽联是什么意思| 什么样的嘴巴| 88年属什么的生肖| 高血压吃什么降的快| 宫颈囊肿是什么原因| 巴扎黑是什么意思| 梦见自己被火烧是什么意思| 女生下边长痘痘是什么病| 绀是什么意思| 广东有什么市| 气血两虚吃什么补最快| 大肠炒什么菜好吃| 吃什么去黄褐斑最有效| 汕头有什么好玩的地方| 鱼腥草破壁饮片有什么功效| 下巴上有痣代表什么| b超和彩超有什么区别| 10月18日什么星座| 男人梦见血是什么预兆| 外阴炎用什么药| 手串18颗代表什么意思| 助产是干什么的| 出家当尼姑需要什么条件| 三冬是什么意思| 公元前是什么意思| 血糖高去医院挂什么科| 虾不能和什么东西一起吃| 周知是什么意思| 月经有血块是什么原因| 渎神是什么意思| 牙龈发炎吃什么药| 端午节吃什么菜呢| 血脂高能吃什么水果| 易出汗是什么原因| 尿蛋白高不能吃什么食物| 打黄体酮针有什么副作用| 脖子发黑是什么原因| 恶露是什么样子的图片| 老酒是什么酒| 腺肌瘤是什么病| 肠易激综合症吃什么药| 什么是禽流感| 麦字五行属什么| 买李世民是什么生肖| 水克什么| 食用植物油是什么油| 什么叫自然拼读| 什么是绩效工资| 秀禾服是什么意思| ct检查是什么意思| 什么是寻麻疹| 夜间睡觉出汗是什么原因| 耸肩是什么意思| 物欲横流是什么意思| 血糖高喝什么茶好| igg抗体是什么意思| 滚床单什么意思| 什么情况下打破伤风| 算了吧什么意思| 2月4号是什么星座| 虾仁炒什么菜好吃| 骨裂是什么感觉| 惊厥是什么症状| 焦俊艳和焦恩俊是什么关系| 不过是什么意思| 上户口需要什么材料| 无为而治什么意思| 心肌是什么意思| 沾花惹草是什么生肖| 体质指数是什么意思| 梅毒长什么样子| 嘴角开裂是什么原因| 3月31号什么星座| 莆田医院是什么意思| jeans是什么意思| 尿酸偏高有什么危害| 夏五行属什么| 肝血不足吃什么| 血管疼是什么原因| cba新赛季什么时候开始| 一般炒什么菜放蚝油| 薄荷脑是什么东西| 缘故的故是什么意思| 老人走之前有什么预兆| 孕初期有什么症状| 肩胛骨疼挂什么科| 海马萎缩是什么情况| 胃肠外科是看什么病的| 舌头辣辣的是什么原因| 皮肤容易晒黑是什么原因| 9月份什么星座| 宫颈多发纳囊是什么病| 肝回声稍密是什么意思| 槿字五行属什么| 牙齿发黑是什么原因| 中蛊什么意思| 杜甫被称为什么| 九月十六是什么星座| 夜尿多吃什么中成药| 生理盐水敷脸有什么效果| w代表什么单位| 塞翁失马什么意思| 什么食物胆固醇含量高| 南瓜不能和什么一起吃| 后脖子出汗多是什么原因| 什么是人棉| 相位是什么| vinegar是什么意思| 胎儿胆囊偏小有什么影响| 脸肿是什么原因| 秋葵与什么食物相克| 蚊子咬了为什么痒| 莆田系是什么意思啊| honor是什么牌子的手机| 什么油适合油炸| 周岁和虚岁是什么意思| jio是什么意思| 惭愧的意思是什么| 发端是什么意思| 激素是什么| 去脂肪粒最有效的药膏叫什么| 喝什么水减肥最快| 小孩子长白头发是什么原因| 胸推什么意思| 什么什么的落叶| 为人是什么意思| 糖异生是什么意思| 金银花什么时候采摘最好| 乐加是什么药| 什么是交际花| 取环需要做什么检查| 什么是龟头炎| 有甲状腺结节不能吃什么| 移民澳洲需要什么条件| 暧昧什么意思| 为什么肚子老是胀气| 5月12号是什么日子| 月经提前十几天是什么原因| 同型半胱氨酸是什么意思| 假释是什么意思| pnh是什么病| 皈依证是什么意思| 广义货币m2是什么意思| 摩羯男和什么星座最配| 大姨妈发黑是什么原因| 马黛茶什么味道| 迪士尼是什么意思| 抻是什么意思| 什么是穿刺| 脚掉皮是什么原因| 冬天开什么花| 疑虑是什么意思| 心肌劳损是什么意思| 胎儿顶臀长是什么意思| 柒牌男装什么档次| 明目退翳什么意思| 鬼压床是什么| 中性粒细胞偏低是什么意思| 五月二十五是什么星座| 吗啡是什么药| 请问今晚买什么生肖| 长公主是什么意思| 咽喉疼痛吃什么药好| 为什么腿会抽筋| 十万个为什么作者是谁| 2月29号是什么星座| 隆科多为什么不姓佟| 全身燥热是什么原因引起的| 什么可以减肥| 甘油三酯高是什么病| 淋巴炎吃什么药| 杜甫的诗被称为什么| 七八年属什么| 狐臭是什么原因| 家里进蝙蝠什么预兆| 成龙姓什么| 大便不成形吃什么食物好| 红蜘蛛是什么虫| 为什么白带是黄色的| 抓周是什么意思| 痛风吃什么菜比较好| 谨守是什么意思| 9月30日是什么纪念日| 失联是什么意思| 骨质增生是什么| 一九七二年属什么生肖| 草头是什么菜| 盘古是一个什么样的人| 田螺小子是什么意思| 口干舌燥喝水也不解渴是什么原因| 照影是什么检查| 喝黄瓜汁有什么好处| 紫苏泡酒有什么功效| 肚脐眼臭是什么原因| 巴厘岛机场叫什么| 女娲是一个什么样的人| 吃什么补钙| a和ab型生的孩子是什么血型| 副厅长是什么级别| 巨蟹是什么星座| 姐姐的孩子叫什么| 微信密码是什么| 经常挖鼻孔有什么危害| 骨科是什么梗| 丘疹是什么| 姜黄与生姜有什么区别| 三焦热盛是什么意思| 镜架什么材质好| peg是什么意思| 话糙理不糙是什么意思| 死了是什么感觉| 龙抄手是什么| 男神是什么意思| 阴道痒用什么药好| 喉部有异物感是什么病| 吃什么食物对心脏好| 癌胚抗原是什么| 盐酸氟桂利嗪胶囊治什么病| 做梦梦到蜘蛛是什么意思| 表哥的儿子叫我什么| 百度

纽曼腾飞科技有限公司荣获“年度最佳手...

百度 我劝天公重抖擞,不拘一格降人才。

Floating point numbers are ....

Like all information, floating point numbers are represented by bits.

Early computers used a variety of floating-point number formats. Each one required slightly different subroutines to add, subtract, and do other operations on them.

Because some computer applications use floating point numbers a lot, Intel standardized on one particular format, and designed floating-point hardware that calculated much more quickly than the software subroutines. The 80186 shipped with a floating-point co-processor dubbed the 80187. The 80187 was a floating point math unit that handled the floating point arithmetic functions. In newer processors, the floating point unit (FPU) has been integrated directly into the microprocessor.

Many small embedded systems, however, do not have an FPU (internal or external). Therefore, they manipulate floating-point numbers, when necessary, the old way. They use software subroutines, often called a "floating point emulation library".

However, floating-point numbers are not necessary in many embedded systems. Many embedded system programmers try to eliminate floating point numbers from their programs,[1] instead using fixed-point arithmetic. Such programs use less space (fixed-point subroutine libraries are far smaller than floating-point libraries, especially when just one or two routines are put into the system). On microprocessors without a floating-point unit, the fixed-point version of a program usually runs faster than floating-point version. However, these embedded system programmers must figure out exactly how much accuracy a particular application needs, and make sure their fixed-point routines maintain at least that much accuracy.

Math Routines

edit

(Is there a better place in this wikibook for this discussion? It doesn't even mention floating point.)

Low-end embedded microcontrollers typically don't even have integer multiply in their instruction set.[2] So on low-end CPUs, you must use routines that synthesize basic math operators (multiply, divide, square root, etc.) from even simpler steps. Practically all microprocessors have such routines, posted on the internet by their manufacturer or other users ("Multiplication and Division Made Easy" by Robert Ashby, "Novel Methods of Integer Multiplication and Division", "efficient bit twiddling methods", etc.).

Following the advice known as "Make It Work Make It Right Make It Fast" and "Make It Work Make It Small Make It Fast", many people pick one or two number resolutions that are adequate for the largest and most precise kind of data handled in a program, and use that resolution for everything. For desktop machines, often 32-bit integers and 64 bit "double precision floating point" numbers are more than adequate. For embedded systems, often 24-bit integers and 24-bit "fixed point" numbers are more than adequate. If the software fits in the microcontroller, and is plenty fast enough, it is a waste of valuable human time to try to "optimize" it further.

Alas, sometimes the software does not fit in the microcontroller.

  • If you run out of RAM, sometimes you only need 2 bytes or 1 byte or 4 bits or 1 bit to store a particular variable.
  • If you run out of time, sometimes you can add lower-precision math routines that quickly calculate the results needed for that inner loop, even though other parts of the code may need higher-precision math routines.
  • If you run out of ROM, sometimes you can trade time for ROM space. Rather than a collection of sets of math routines, each one customized to a slightly different width, you can use a single set of math routines that can handle the maximum possible width. If you have some variables less than that width (to save RAM), then you typically sign-extend variables into a full-size register or global buffer, do full-width calculations there, and then truncate and store the result to the small size.

Fixed-Point Arithmetic

edit

Some embedded microprocessors may have an external unit for performing floating point arithmetic(FPU), but most low-end embedded systems have no FPU. Most C compilers will provide software floating point support, but this is significantly slower than a hardware FPU. As a result, many embedded projects enforce a no floating point rule on their programmers.[3][4][5][6][7] This is in strong contrast to PCs, where the FPU has been integrated into all the major microprocessors, and programmers take fast floating point number calculations for granted. Many DSPs also do not have an FPU and require fixed-point arithmetic to obtain acceptable performance.[8]

A common technique used to avoid the need for floating point numbers is to change the magnitude of data stored in your variables so you can utilize fixed point mathematics. For example, if you are adding inches and only need to be accurate to the hundredth of an inch, you could store the data as hundredths rather than inches. This allows you to use normal fixed point arithmetic. This technique works so long as you know the magnitude of data you are adding ahead of time, and know the accuracy to which you need to store your data.

People use many tricks and techniques to speed up Fourier transform calculation. The fast Fourier transform (FFT) is the biggest speedup, but there are several other tricks on top of that that each can give another factor of two improvement.[9][10]

Many people do FFT using fixed-point arithmetic.[11][12][13][14][15][16]

The Fast Hartley Transform is an alternative that requires less resources than the FFT.[17]

DTMF decoders often use the Goertzel algorithm because, when only a few frequencies need to be analyzed, it is much faster than the FFT algorithm.

... more tips and hints here ...

Further reading

edit
  1. Avoiding floating point arithmetic on the iPhone
  2. Robert Ashby. "Simplifying Formulas". 2006. quote: "we still need to find ways to simplify complex problems before we can put them into our 50-cent micros. Hardware multiplication is rarely seen below $1.50 ... That leaves us with the target of reducing everything down to addition, subtraction, shifting bits, and comparisons."
  3. "Stop using floating point!". quote: "Please learn to use fixed-point arithmetic"
  4. "Writing efficient JavaScript (HTML)" quote: "Use integer arithmetic where possible"
  5. Erich Styger. "Adding/Removing Floating Point Format for S08 Projects". quote: "Usually I do *not* use floating point numbers in my projects."
  6. "Avoiding floating point math".
  7. "Avoid floating point in hash table implementation."
  8. Boris Lerner. "Fixed vs. floating point: a surprisingly hard choice".
  9. Douglas L. Jones. "Decimation-in-time (DIT) Radix-2 FFT". OpenStax-CNX. September 15, 2006.
  10. Douglas L. Jones. "Efficient FFT Algorithm and Programming Tricks". OpenStax-CNX. February 24, 2007
    • Kiss FFT library that can use either fixed or floating point data types.
  11. Simon Inns. "Fast Hartley Transformation Library for AVR microcontrollers".
女性得乙肝有什么症状 身主天相是什么意思 毛囊炎挂什么科 小便黄吃什么药 烁字五行属什么
坐月子能吃什么 冠状动脉粥样硬化性心脏病吃什么药 战区司令员是什么级别 三角巾是什么 耐是什么意思
笔触是什么意思 猫为什么要绝育 孙膑原名叫什么 dido是什么牌子 泰山在什么地方
芡实不能和什么一起吃 抵抗力差吃什么可以增强抵抗力 伏是什么意思 皮肤发烫是什么原因 梦见好多狗是什么预兆
什么牌子洗发水好clwhiglsz.com 宝宝手脚冰凉是什么原因hlguo.com 冰箱为什么不制冷了hcv9jop4ns8r.cn 腺肌症有什么症状表现jinxinzhichuang.com 什么水果含维c最多hcv8jop3ns7r.cn
鹌鹑蛋是什么动物的蛋hcv8jop8ns2r.cn 一蹴而就什么意思jasonfriends.com 922是什么星座hcv8jop6ns8r.cn 骨折吃什么药hcv9jop6ns9r.cn 内啡肽是什么hcv9jop3ns4r.cn
鸟语花香是什么生肖hcv8jop5ns2r.cn smile是什么意思hcv8jop4ns1r.cn 左附件囊肿注意什么cj623037.com 晚饭适合吃什么0735v.com 如火如荼是什么意思hcv8jop8ns8r.cn
什么叫夏至hcv9jop0ns2r.cn 癌抗原125是什么意思hcv8jop3ns3r.cn 为什么没有广东大学hcv7jop6ns3r.cn 镜里观花是什么生肖hcv8jop8ns2r.cn 十二生肖叫老大是什么生肖hcv8jop6ns4r.cn
百度