Floating Point Number Systems and Representation

Limitations of Integer and Fixed-Bit Representations

  • Standard Bit-Width Capabilities: In a system using nn bits, the range of representable numbers depends on the encoding scheme used:

    • Unsigned Integers: These can represent values ranging from 00 to 2n2^n.
    • 2’s Complement Signed Integers: These can represent values ranging from −2n−1-2^{n-1} to 2n−1−12^{n-1} - 1.
  • 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 9,349,398,989,787,762,244,859,087,6789,349,398,989,787,762,244,859,087,678.
    • Extremely Small Numbers: For example, a decimal value such as 0.00000000000000000000000456910.0000000000000000000000045691.
    • Rational Numbers: Fractions such as 23\frac{2}{3}.
    • Irrational Numbers: Values that cannot be expressed as simple fractions, such as 2\sqrt{2}.
    • Transcendental Numbers: Complex mathematical constants such as ee and π\pi.

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 M×10EM \times 10^E.
  • Key Definitions:
    • Mantissa (MM): The significand or the part of the number containing its significant digits.
    • Exponent (EE): 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 1010. In computer systems, the base is typically 22.
    • Scaling Factor: The component represented by the base raised to the exponent (e.g., 10E10^E).

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 5151 can be expressed in various non-normalized formats, but only one is strictly normalized:
    • .51×102.51 \times 10^2
    • 0.051×1030.051 \times 10^3
    • 5100.×10−25100. \times 10^{-2}
    • Normalized Form: 5.100×1015.100 \times 10^1
  • Normalization in Base 2 (Binary): The same principle applies to binary strings to ensure consistent representation and maximize precision:
    • Example 1: The binary string 0100101001 is normalized to 1.001×231.001 \times 2^3.
    • Example 2: The binary value 00101101.10100101101.101 is normalized to 1.01101101×251.01101101 \times 2^5.
    • Example 3: The fractional binary value 0.00011010011100.0001101001110 is normalized to 1.101001110×2−41.101001110 \times 2^{-4}.

IEEE Half-Precision Standard

  • Bit Allocation: The IEEE Half-Precision format uses a total of 1616 bits to encode a number, divided into three distinct fields:
    • Sign: 11 bit is dedicated to indicating whether the number is positive or negative.
    • Exponent: 55 bits are used for the exponent.
    • Mantissa: 1010 bits are used for the significand.
  • Biasing: The exponent in this format is biased, specifically using an "excess 1515" representation. This means the actual exponent value is stored as the true exponent plus a bias of 1515.