Fractional variable formats

In addition to the Natural, Binary, Decimal, and Hexadecimal variable formats, CodeWarrior supports an additional class of custom fractional formats called Qn. Qn is a floating point representation of a fractional or fixed point number where n signifies the number of fractional bits (the number of bits to the right of the binary point).

CodeWarrior supports fractional formats ranging from Q0 to Q31.

To change the variable display format to fractional format:

  1. Open the Variables view, see Opening Variables view.
  2. Right-click a variable in the Variables view.

    A shortcut menu appears.

    Figure 1. Choosing fractional format

    Choosing Fractional Format

  3. Choose Format > Fractional > Qn (where n = 0 to 31).

    The variable value will be displayed in the specified Qn format.

    Note: The Qn formats are available or dimmed depending on the size of the variable.

    - Q0 - Q7 available for 1 byte variables

    - Q0 - Q15 available for 2 byte variables

    - Q0 - Q31 available for 4 byte variables