飞机杯长什么样| 170是什么号码| ny是什么牌子| 稀松平常是什么意思| 玉的主要成分是什么| 吃什么补肾壮阳最快速| 什么心什么目| 夫人是什么生肖| 什么是中国舞| 亲家母是什么意思| 热天不出汗是什么原因| 歌声什么| me是什么基团| 炸膛什么意思| 取环前需要做什么检查| 肠胃不好吃什么食物好| 木耳和什么不能一起吃| 结婚28年是什么婚| 18k金是什么材质| 耳朵蝉鸣是什么原因引起的| 松垮是什么意思| 玉林狗肉节是什么时候| 49岁属什么| 金蝉吃什么| 黄喉是什么动物身上的| prich是什么牌子| 老人脚肿是什么原因引起的| 过敏性皮炎用什么药膏| 女人喝甘草水有什么好处| 数字3代表什么意思| 低密度脂蛋白偏高是什么意思| 豸是什么意思| 乙醇和酒精有什么区别| 打招呼是什么意思| 通透是什么意思| 被隐翅虫咬了涂什么药| 青岛市市长什么级别| 脾胃虚寒吃什么中成药| 中天是什么意思| 胸为什么一大一小| 脚后跟干裂是什么原因| 火可念什么| 右小指麻木是什么征兆| 胃溃疡吃什么药好| 狗鼻子为什么是湿的| 放生鱼有什么好处| 超管是什么| 十一月份什么星座| 脆皮鸭什么意思| 梦到车坏了是什么意思| 结节性红斑是什么原因引起的| 苦胆是什么| 黄河里有什么鱼| 什么叫潮吹| 笨拙是什么意思| 查心电图挂什么科| 什么叫cd| 失眠多梦吃什么药效果最好| 任达华是什么生肖| 浅表性胃炎伴糜烂用什么药| 微醺是什么意思| 月经血是什么血| 血止不住是什么原因| 看病人送什么| 放下是什么意思| 夏季养什么脏腑| 爆冷是什么意思| 等着我为什么停播了| 三高可以吃什么水果| 茶壶嘴为什么不能对着人| 门良念什么| 才高八斗是指什么生肖| 辽宁古代叫什么| 肚子疼是什么原因引起的| 印度人为什么不吃猪肉| 什么病不能吃竹笋| 什么水果含钾| 长此以往什么意思| 牙周炎用什么漱口水好| 牡丹象征着什么意义| 血常规是检查什么的| 西咪替丁是治什么病| 肾衰透析病人吃什么好| 儿童正常体温在什么范围| 无畏布施是什么意思| 无机磷测定是检查什么| 月经量极少几乎没有是什么原因| 莓茶属于什么茶| 什么书没有字| 煮中药用什么锅| 鸡胸是什么| pof是什么意思| 春茶是什么茶| 四是什么生肖| 晕车喝什么饮料好| 感冒了挂什么科| 田野是什么意思| 骨质疏松吃什么| 口苦口臭吃什么药效果最佳| 努尔哈赤和皇太极是什么关系| 月嫂下户是什么意思| crayon什么意思| 更年期挂什么科| 高危hpv有什么症状| 血癌是什么原因造成的| 什么的早晨| 一戴套就软是什么原因| 较重闭合性跌打损伤是什么意思| 痛风什么东西不能吃| 工体是什么意思| 146是什么意思| 脱发吃什么| 小孩白细胞高是什么原因| 肺结核是什么原因引起的| 十二生肖排第七是什么生肖| 生辰八字查五行缺什么| 蓝精灵是什么药| 硕是什么意思| 水土不服吃什么药| 什么是辛辣食物| 网易是干什么的| 记忆力不好是什么原因| 孕妇为什么不能参加婚礼| 手淫多了有什么坏处| 农夫与蛇是什么故事| 什么油最健康| 蛇标志的车是什么牌子| 这个季节有什么水果| 为什么会得心脏病| 男生什么情况想种草莓| 臻字五行属什么的| 荷里活什么意思| 日月星辰下一句是什么| 人体成分分析是检查什么| 秦二世为什么姓胡| 荨麻疹吃什么药最管用| 打边炉是什么| 父亲节出什么生肖| 狗不能吃什么水果| 为什么硬不起来| 血压低有什么症状| 红萝卜和胡萝卜有什么区别| 叶黄素有什么功效| c13阴性是什么意思| 你是什么星座| 进展是什么意思| 蚕蛾吃什么| 胃部间质瘤是什么性质的瘤| 什么人容易得精神病| 预设是什么意思| 牙龈黑紫色是什么原因| 什么是pv| 6.26是什么星座| 康复治疗学主要学什么| 什么身什么骨| 牙痛吃什么药| 延年益寿的益是什么意思| 粿是什么意思| 人工授精是什么意思| 俊字五行属什么| 热射病是什么症状| 12月7号什么星座| 什么情况下要割包皮| 灿烂的近义词是什么| 梦见粽子是什么预兆| 麻婆豆腐用什么豆腐| 孙红雷的老婆叫什么名字| 吃什么止腹泻| 五月是什么星座的啊| 吲哚美辛是什么药| 15天来一次月经是什么原因| 脚后跟干裂用什么药膏| 什么情况下需要做心脏造影| 什么空调省电| 胎停了有什么明显症状| 胸前出汗多是什么原因| 土耳其是什么民族| 拉肚子呕吐吃什么药| eb病毒是什么| 梦见床上有蛇什么预兆| 吃什么水果对心脏好| 人为什么会咳嗽| 吃什么水果减肥最快| 特别出演什么意思| 辛酉日五行属什么| dsa什么意思| 热病是什么病| 手腕疼去医院挂什么科| 敏感肌是什么意思| 外露什么意思| 盆腔炎吃什么药效果好| 带id是什么意思| 瘢痕是什么| 夏季吃桃子有什么好处| 疣是什么原因造成的| lgg是什么意思| 左手小手指麻木是什么原因引起的| tac是什么| 6月28日是什么星座| 强扭的瓜不甜什么意思| 为什么眼睛会痛| 矢车菊在中国叫什么名| 梗概什么意思| 怀孕了不想要最好的办法是什么| 猪横利是什么| 土土心念什么| 什么公主| 气虚什么症状| 火花是什么意思| 五花肉炖什么好吃| 为什么一吃东西就拉肚子| 梦到别人怀孕是什么意思| fmc是什么意思| 小孩说梦话是什么原因引起的| 菠萝蜜什么季节最好吃| 痛经吃什么药好| 肚子左边是什么器官| 胸片可以检查出什么| 投其所好是什么意思| wing是什么意思| 腹部b超能检查出什么| 腺肌症吃什么药效果好| hcd是什么意思| 午饭吃什么| 重阳节应该吃什么| 叹气是什么意思| 女人下面 什么味道| 乏是什么意思| 话费为什么扣那么快| 邹的左边读什么| 手指发痒是什么原因| 缺铁性贫血吃什么食物好| 以梦为马是什么意思| 脱口秀是什么| 肯尼亚说什么语言| 女人什么时候容易怀孕| 维生素c吃多了有什么危害| 头出汗多至头发湿透是什么原因| 霰粒肿用什么药| 月关是什么意思| 为什么会长疣| 梦到掉头发是什么意思| 脂肪肝吃什么中成药| 为什么一直咳嗽| 什么都没有| 什么是单克隆抗体| 湿热喝什么茶可以调理| 试桩是什么意思| 1997年出生的属什么| 最坚固的锁怕什么| 没晨勃说明什么问题| 食指中指交叉什么意思| 甲亢吃什么药最有效| 什么是av| 肺部结节是什么原因引起的| 金牛座的幸运色是什么| 经常头痛什么原因| 肝血虚吃什么药| 倒模是什么意思| 属蛇男和什么属相最配| 巧夺天工什么意思| 半边脸疼是什么原因引起的| 碳水是什么意思| 脑梗有什么前兆| 百度Jump to content

“泰山”-中国大熊猫保护研究中心

From Wikibooks, open books for an open world
百度 同时,清算组、破产管理人、财产代管人、监护人等依法有权管理和处分不动产权利的主体,参照权利人的查询规定也可以查询。

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 | edit source]

(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 | edit source]

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 | edit source]
  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".
身上起红点是什么原因 风油精有什么功效 毛峰是什么茶 阴虚火旺吃什么好 女人吃什么能活血化瘀
长痘是什么原因 眉毛白了是什么原因引起的 逆时针揉肚子起什么作用 北京为什么叫北平 脂溢性皮炎是什么原因引起的
餐标是什么意思 急性阑尾炎什么症状 胚胎和囊胚有什么区别 黑枸杞泡水后什么颜色 妙赞是什么意思
荷花五行属什么 梦见自己的手镯断了什么意思 glu是什么氨基酸 多囊卵巢综合症是什么 看书有什么好处
今年16岁属什么生肖hcv8jop4ns3r.cn 身体颤抖是什么病hcv9jop6ns3r.cn 虾片是什么做的hcv8jop3ns8r.cn 把妹什么意思hcv9jop4ns2r.cn 40岁适合什么工作hcv9jop1ns5r.cn
嗓子疼吃什么消炎药hcv8jop0ns5r.cn 电脑一体机什么牌子好hanqikai.com 运动后恶心想吐是什么原因hcv8jop2ns2r.cn 胆囊炎吃什么药好hcv9jop8ns3r.cn 蛇遇猪就得哭什么意思jasonfriends.com
为什么不建议小孩打流感疫苗hcv7jop6ns1r.cn 什么竹笋不能吃hcv9jop2ns0r.cn 封神榜讲的是什么故事hcv7jop4ns8r.cn 人间尤物什么意思kuyehao.com 婴儿为什么吐奶hcv7jop5ns1r.cn
低密度脂蛋白高的原因是什么hcv8jop1ns1r.cn 黑色加什么颜色是棕色hcv9jop1ns9r.cn 卢靖姗是什么混血baiqunet.com butterfly什么意思hcv8jop2ns9r.cn 尿常规粘液丝高是什么意思hcv9jop3ns6r.cn
百度