One: Floating point and Fixed-point overview
1.1 Related definition Description
Fixed-point number: In layman's parlance, the decimal point fixed number. Take the renminbi as an example, we often talk about such as 123.45¥,789.34¥, and so on, by default, there are two decimal places after the decimal point, that is, the angle, points. If the decimal point precedes the most significant bit, such numbers are called decimal fraction fixed-point numbers, such as 0.12345,0.78934. If the decimal point is after the least significant bit, such numbers are called fixed-point numbers for pure integers, such as 12345,78934.
Float: Generally, the number of decimal points is not fixed. The easier way to understand this is to consider the following scientific notation we see daily, taking examples of the numbers above, such as 123.45, which can be written in the following ways:
12.345x101
1.2345 x102
0.12345 x103
......
In order to represent a number, the position of the decimal point can be changed, that is, the decimal point is not fixed.
1.2 Comparison of fixed-point number and float
In order to simply describe the problem, here are decimal numbers for example, detailed analysis, you can see in the later article.
(1) The accuracy of the expression is different from the range
For example, we use 4 decimal digits to express a number. For the fixed-point number (here is an example of a fixed-point integer), we represent any number in the interval [0000,9999], but there is nothing we can do if we want to represent a value similar to 1234.3, because at this point the accuracy of the representation is 1/100=1; If you use a floating-point number to represent (in warping scientific notation, That is, a valid bit before the decimal point, as an example, can represent any number between [0.000,9.999], the precision of which is 1/103=0.001, the precision is much higher than the previous one, but the range of representation is much smaller.
In other words, the average number of fixed-point digits is lower, but the range of values is larger, and the floating-point numbers are the opposite.
(2) The efficiency of computing in computer is different
Generally speaking, the operation of fixed-point number is simpler and more efficient in the computer, while the operation of floating-point numbers is more complex and less efficient in computer.
(3) Hardware dependencies
In general, as long as the hardware to provide operational components, will provide fixed-point operation support (do not know the exact number, did not have heard of no support fixed-point operation of the hardware), but not necessarily support floating-point operations, such as many embedded development boards do not provide floating-point operations support.
1.3 Relationship with DSP
In general, DSP processors can be divided into two categories: fixed-point and floating point. In comparison, Fixed-point DSP processor has fast speed, low power consumption and cheap price, while floating-point DSP has high computational precision and large dynamic range.
The above is the entire content of this article, I hope to give you a reference, but also hope that we support the cloud habitat community.