3.12.2 Integer and Fractional Data Representation

Both integer and fractional data treat the MSb as a Sign bit, and the binary exponent decreases by one as the bit position advances toward the LSb. The binary exponent for an N-bit integer starts at (N-1) for the MSb and ends at ‘0’ for the LSb. For an N-bit fraction, the binary exponent starts at ‘0’ for the MSb and ends at (1-N) for the LSb (as shown in Figure 3-11 for a positive value and in Figure 3-12 for a negative value).

Conversion between integer and fractional representations can be performed using simple division and multiplication. To go from an N-bit integer to a fraction, divide the integer value by 2N-1. Similarly, to convert an N-bit fraction to an integer, multiply the fractional value by 2N-1.

Figure 3-11. Different Representations of 0x4001
Figure 3-12. Different Representations of 0xC002