How Fixed-Point Binary Represents Fractional Values

Fixed-point binary representation is a method used by digital systems to store and calculate fractional values without the overhead of floating-point hardware. By assigning a predetermined, unmoving position to the radix point (the binary equivalent of a decimal point), fixed-point notation splits a standard integer bitfield into an integer portion and a fractional portion. This provides predictable precision, consistent execution time, and simple arithmetic operations by treating non-integer numbers as scaled integers.

The Concept of Negative Powers of Two

In the standard binary system, digits to the left of the radix point represent non-negative powers of two (\(2^0, 2^1, 2^2, \dots\)). Fixed-point notation extends this system to the right of the radix point using negative powers of two:

To represent a fractional decimal value, the system sums the values of the active fractional bits. For example, the binary fraction 0.1101 evaluates to:

\[(1 \times 0.5) + (1 \times 0.25) + (0 \times 0.125) + (1 \times 0.0625) = 0.8125\]

Fixed-Point Format Notation (Q Notation)

Because physical computer memory stores only continuous sequences of 0s and 1s without an actual decimal point symbol, the location of the radix point is maintained entirely by software conventions and hardware designs.

The most common convention is Q notation (or Qm.n format): * m: The number of bits allocated to the integer part (sometimes including a sign bit). * n: The number of bits allocated to the fractional part.

For instance, an 8-bit Q4.4 format allocates the four most significant bits to the integer component and the four least significant bits to the fractional component.

Conversion Example: Decimal to Fixed-Point Binary

Consider representing the decimal number \(6.625\) in an 8-bit unsigned Q4.4 format:

  1. Convert the integer portion (\(6\)):
    • \(6 = 4 + 2 = 2^2 + 2^1 \rightarrow \mathbf{0110}_2\)
  2. Convert the fractional portion (\(0.625\)):
    • Multiply repeatedly by 2 or break down into negative powers:
    • \(0.625 = 0.5 + 0.125 = (1 \times 2^{-1}) + (0 \times 2^{-2}) + (1 \times 2^{-3}) \rightarrow \mathbf{1010}_2\)
  3. Combine the components:
    • In conceptual notation: 0110.1010
    • Stored in raw memory as the 8-bit integer: 01101010 (which equals decimal 106).

To decode the stored integer back to decimal, divide the raw integer by the scaling factor (\(2^n\)): \[106 \div 2^4 = 106 \div 16 = 6.625\]

Signed Fixed-Point Representation

Signed numbers are typically implemented using Two’s Complement. In a signed format such as SQ3.4 (1 sign bit, 3 integer bits, 4 fractional bits):

Advantages and Limitations