What is a normalized floating point representation
Converting a floating point number into the floating point representation
The decimal number 18,4 should be converted into the binary floating point representation. The process usually consists of 6 steps. The order of the individual steps or separate sub-steps can also be carried out differently.
In principle, the process consists of converting the number, normalizing it, determining the new exponent, forming the sign and then combining the values of sign, characteristic (exponent) and mantissa.
1. Convert integer number
In the first step, the binary number is determined for the number 18 in front of the decimal point. The division method is used here.
2. Convert decimal number
In the second step, the binary number is determined for the number 0.4 after the decimal point. The multiplication method is used.
The result is a dual fractional number.
Result from steps 1 and 2: 18,4 = 10010,011001100110011001101100100...
3. Normalize or normalize (determine mantissa)
With normalization you move the comma so that you get a normalized number. For example 1.0101 (2) or 0.123 (10). The exponential notation is used so that the number retains its value.
10010,01100110011... * 20
1,001001100110011... * 24 (Normalization)
Normalization means that you only want to save the decimal places. In the binary representation of numbers, there is always a one (1) at the front. This one in front of the decimal point can be omitted when saving or when displaying (hidden bit), because there is always a one here. But you have one more place at the back for accuracy.
4. Convert exponent (determine characteristic)
The exponent is also known as a characteristic because it has an offset that is known as bias or excess. What is meant is that the range of values is shifted. You do this so that the exponent is always positive or at least zero. This saves a bit for representing the sign of the exponent. The bias display also makes it easier to compare sizes. Disadvantage, there is a positive zero (+0) and a negative zero (-0).
Two's complement and one's complement are also rare alternatives.
How much the value range is shifted depends on the selected precision (number of bits).
- Single precision (32 bits) means a bias of 127.
- Double precision (64 bits) means a bias of 1023.
Since we are working with a single precision (32 bit), this corresponds to an offset (bias) of 127.
In principle, the bias is subtracted from the exponent determined (through normalization) and the characteristic is obtained in this way.
Characteristic (new exponent) = exponent + bias = 4 + 127 = 131
The characteristic is then converted into a dual number.
5. Determine the sign
6. Form floating point number (with single precision)
Other related topics:
Electronics simple and easy to understand
The electronics primer is a book about the basics of electronics, components, circuit technology and digital technology.
I want that!
Experience electronics with the "Starter Edition" electronics set
Perfect for beginners and newcomers
- Entry into electronics without prior knowledge
- Quick understanding of components and circuit symbols
- Experiment without a soldering iron: just insert components
More informationOrder the electronics set now
- Has psychological warfare ever won a war?
- Should be ashamed of Jony Ive
- Forests have fresh air
- What qualifies as microaggression
- Feel self-harm pain
- Which languages are not capitalized?
- What is Meghan Markle's nationality
- Why did the Russian proletariat revolt?
- Why are all of my pictures blurry
- What is a field report
- How will Ethereum make money
- Who is a good Canadian start-up lawyer
- What is the universe for?
- When and how was bronze invented
- Are the Germans flirtatious
- Is it illegal to download free software?
- Can you give me your honest opinion
- Which factors determine the density level
- Is distraction a belief
- How do I get a Chinese number
- How does it feel to have depression?
- Has contributed to the betterment of society in 9 11
- Should I be using a cracked Nova Prime Launcher
- Is it unethical to use almond milk?