| 数据搜索系统,热门电子元器件搜索 |
|
VL6624 数据表(PDF) 46 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
VL6624 数据表(HTML) 46 Page - STMicroelectronics |
|
46 / 106 page ![]() Register map VL6624/VS6624 46/106 Example Convert -0.41 to Float 900 Convert the fraction into binary by successive multiplication by 2 and removal of integer component 0.41 * 2 = 0.82 0 0.82 * 2 = 1.64 1 0.64 * 2 = 1.28 1 0.28 * 2 = 0.56 0 0.56 * 2 = 1.12 1 0.12 * 2 = 0.24 0 0.24 * 2 = 0.48 0 0.48 * 2 = 0.96 0 0.96 * 2 = 1.92 1 0.92 * 2 = 1.84 1 0.84 * 2 = 1.68 1 0.68 * 2 = 1.36 1 0.36 * 2 = 0.72 0 This gives us -0.0110100011110. We then normalize by moving the decimal point to give - 1.10100011110 * 2^-2. The mantissa is rounded and the leading zero removed to give 101001000. We add the exponent to the bias of 31 that gives us 29 or 11101. A leading zero is added to give 6 bits 011101. The sign bit is set at 1 as the number is negative. This gives us 1011 1011 0100 1000 as our Float 900 representation or BB48 in hex. To convert the encoded representation back to a decimal floating point, we can use the following formula. Real is = (-1)^sign * ((512+mantissae)>> 9) * 2^(exp-31) Thus to convert BB48 back to decimal, the following procedure is followed: Note that >>9 right shift is equal to division by 2^9. Sign = 1 Exponent = 11101 (29 decimal) Mantissa = 101001000 (328 decimal) This gives us: real = (-1)^1 * ((512+328)/2^9) * 2^(29-31) real = -1 * (840/512) * 2^(-2) real = -1 * 1.640625 * 0.25 real = -0.41015625 When compared to the original -0.41, we see that some rounding errors have been introduced. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |