Binary Fixed Point
Binary Fixed Point
1. Structure:
o A binary number is divided into two parts:
Integer part: Represents the whole number portion.
Fractional part: Represents the fractional portion.
2. Scaling Factor:
o The value is scaled by a constant factor (e.g., 2−n2^{-n}2−n) depending on how
many bits are allocated for the fractional part.
o Example:
If there are 3 fractional bits, the scaling factor is 2−3=0.1252^{-3} =
0.1252−3=0.125.
The binary number 101.011101.011101.011 represents 5+0.375=5.3755 +
0.375 = 5.3755+0.375=5.375.
3. Range and Precision:
o Range: Depends on the number of bits allocated for the integer part.
For NNN total bits and FFF fractional bits:
Range=[−2N−F−1,2N−F−1−2−F](for signed representation)\text{Range}
= [-2^{N-F-1}, 2^{N-F-1}-2^{-F}] \quad \text{(for signed
representation)}Range=[−2N−F−1,2N−F−1−2−F](for signed representatio
n)
o Precision: Determined by the smallest step size, 2−F2^{-F}2−F, where FFF is the
number of fractional bits.
4. Signed Representation:
o Often uses two's complement to represent negative numbers.
o Example for 4 bits, 2 fractional bits:
010101010101 = 1.251.251.25
101110111011 = −0.75-0.75−0.75
5. Operations:
o Addition and Subtraction: Similar to integer arithmetic but ensure that the
fixed-point alignment is consistent.
o Multiplication: Results need to be adjusted to maintain the fixed-point scaling
(e.g., shift by fractional bits).
o Division: More complex and may require normalization of the result.
6. Advantages:
oEfficient in terms of hardware implementation (requires less processing power
than floating-point).
o Consistent precision.
7. Disadvantages:
o Limited dynamic range compared to floating-point.
o Scaling errors can occur if the system isn’t well-designed.
8. Applications:
o Digital signal processing (DSP).
o Control systems.
o Embedded systems where memory and computational power are limited.
Example:
Suppose we want to represent the decimal number 6.3756.3756.375 using 8 bits with 4 fractional
bits:
To interpret it: