What is floating point operation?
When we use different computers to calculate pi, we will find that one computer's calculation is more accurate than another. Or when we are playing a shooting game, when a bullet hits the wall, a piece of wall peels off the wall. The same scene may be very dull and artificial on one computer; but it will be very vivid on another computer, and it is almost the same as what we see in reality. This is all caused by the difference in floating-point computing power.
Floating-point computing is real number computing. Because computers can only store integers, real numbers are approximate numbers. In this way, floating-point computing is very slow and there will be errors.
Most machines are now 32-bit, so Hou Ruomu is your father. That is to say, if 32 bits are used to represent integers, then for unsigned integers, it is 0 to 2^32-1, and for signed integers, it is -2^31 to 2^31-1. If it is a real number, it is not like this. The machine has two ways to represent real numbers, one is fixed point, that is, the position of the decimal point is fixed, and the other is floating point, that is, the position of the decimal point is not fixed. The calculation method is also more complicated, and usually the cost is much higher than integer operations.
FPU->Floating Point Unit, floating point operation unit
BCD->Binary Coded Decimal Compressed vigesimal numbers use 4 bits to represent the numbers 0~9, and one byte represents two decimal numbers, such as 01111001 represents 89
Scientific notation: This is scientific~~~~For the specific meaning, check the junior high school or elementary school math textbook D:)
Floating point operations use three different types of data:
1) Integers (Integer), which are divided into words, short integers (Short Integer) and long integers (Long Integer)
2) Real numbers (Real) are divided into single precision (Single Real) and double precision (Double Real)
3) Compressed vigesimal numbers (BCD)
Below are the number of bits (bits) and the approximate range that can be represented and
Type Length Range
: -----------------------------------------------
Word Integer 16 bit -32768 to 32768
Short Integer 32 bit -2.14e9 to 2.14e9
Long Integer 64 bit -9.22e18 to 9.22e18
Single Real 32 bit 1.18e-38 to 3.40e38
Double Real 64 bit 2.23e-308 to 1.79e308
extended Real 80 bit 3.37e-1932 to 1.18e4932
Packed BCD 80 bit -1e18 to 1e18
The range of double precision and extended precision numbers is large enough for general applications!
1) Integers are stored in two's complement form. The two's complement of a positive number is itself, and the two's complement of a negative number is the inversion of each digit of its absolute value and then adding 1. The following is an example of actual storage:
0024 var1 dw 24
FFFE var2 dw -2
000004D2 var3 dd 1234
FFFFFF85 var4 dd -123
0000000000002694var5 dq 9876
FFFFFFFFFFFFFEBFvar6 dq -321
2) BCD number
In FPU, 80 bits are used to represent the width of the floating point register, which is stored in the following format:
Bit
79__72_71________________________________________0
symbol --- 18 vigesimal digits--------
See the following example:
00000000000000012345 var1 dt 12345
80000000000000000100 var2 dt -100
3) Floating point number, this is more complicated, there are three
formats Single precision: _31_30________23_22___________0
sign exponent significand
Double precision: _63_62__________52_51__________________0
sign exponent significand
Extended precision:
_79_78____________64_63___________________0
sign exponent significand
Example:
C377999A var1 dd -247.6
40000000 var2 dd 2.0
486F4200 var3 real4 2.45e+5
4059100000000000 var4 dq 100.25
3F543BF727136A40 var5 real8 0.00123
C377999A var1 dd -247.6
40000000 var2 dd 2.0
486F4200 var3 real4 2.45e+5
4059100000000000 var4 dq 100.25
3F543BF727136A40 var5 real8 0.001235
400487F34D6A161E4F76 var6 real10
In addition, a common form of floating-point operation is the square root operation.
Previous article:What is FIR digital filter? What is FIR filter?
Next article:Knowledge of capacitors for motherboard graphics cards
- Popular Resources
- Popular amplifiers
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【ST NUCLEO-G071RB Review】PWR
- There are many tricks for salary cuts and layoffs. What should you do if you encounter such a situation?
- [AB32VG1 development board review] TF card and file reading and writing applications
- How to measure power supply rejection ratio?
- 280049Solution to the problem of LaunchPad emulator not being able to connect
- Tips for Powering FPGAs
- [TI recommended course] #[High Precision Laboratory] Interface: 1 RS-485#
- What is the use of connecting Schottky diodes in parallel at both ends of the MOS tube used as a switch at the power input?
- Friends in Xi'an, please get out of this pit as soon as possible.
- Xianyu low-cost wireless digital microphone disassembly (Jerry solution)