Floating Point Number Systems and Representation
Limitations of Integer and Fixed-Bit Representations
Standard Bit-Width Capabilities: In a system using bits, the range of representable numbers depends on the encoding scheme used:
- Unsigned Integers: These can represent values ranging from to .
- 2’s Complement Signed Integers: These can represent values ranging from to .
Challenges for Fixed-Width Representations: Fixed-point or standard integer systems fail to efficiently handle specific categories of numbers that are essential for scientific and engineering calculations:
- Extremely Large Numbers: For example, a value such as .
- Extremely Small Numbers: For example, a decimal value such as .
- Rational Numbers: Fractions such as .
- Irrational Numbers: Values that cannot be expressed as simple fractions, such as .
- Transcendental Numbers: Complex mathematical constants such as and .
The Concept of Floating-Point Representation
- Overview: Floating-point representation is an approach where a number is represented according to a fixed number of decimal places and a specific level of precision.
- Methodology: This system allows the decimal or binary point to "float" rather than being in a fixed position, enabling the representation of a much wider range of magnitudes within the same number of bits.
Components of Scientific Notation
- General Formula: Scientists and engineers represent numbers using scientific notation, expressed in the form .
- Key Definitions:
- Mantissa (): The significand or the part of the number containing its significant digits.
- Exponent (): The power to which the base is raised, determining the magnitude and the position of the decimal point.
- Base: In standard scientific notation, the base is . In computer systems, the base is typically .
- Scaling Factor: The component represented by the base raised to the exponent (e.g., ).
Normalization Principles and Examples
- Definition of Normalized Form: A number is considered to be in normalized form when there is exactly one non-zero digit to the left of the decimal (or binary) point.
- Normalization in Base 10: The number can be expressed in various non-normalized formats, but only one is strictly normalized:
- Normalized Form:
- Normalization in Base 2 (Binary): The same principle applies to binary strings to ensure consistent representation and maximize precision:
- Example 1: The binary string is normalized to .
- Example 2: The binary value is normalized to .
- Example 3: The fractional binary value is normalized to .
IEEE Half-Precision Standard
- Bit Allocation: The IEEE Half-Precision format uses a total of bits to encode a number, divided into three distinct fields:
- Sign: bit is dedicated to indicating whether the number is positive or negative.
- Exponent: bits are used for the exponent.
- Mantissa: bits are used for the significand.
- Biasing: The exponent in this format is biased, specifically using an "excess " representation. This means the actual exponent value is stored as the true exponent plus a bias of .