SLAU846A June 2023 – October 2023 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1
Unsigned 32-bit numbers include an integer component and fractional component using Q number format. It is expressed as UQm.n, where:
m is the integer component number of bits
n is the fractional component number of bits
The m and n components vary depending on the operand type. For instance, an operand in UQ16.16 format has the signed number components as shown in Table 5-2
Description | Value | Number of Bits | Bits |
---|---|---|---|
Integer component | I | m = 16 | 31:16 |
Fractional component | F | n = 16 | 15:0 |
To generate an unsigned number, such as 4.75 in UQ16.16:
Express the integer component (I = 4) as a number in m bits (0x0004)
Express the fractional component (F = 0.75) as a number in n bits (0xC000)
Express the resulting hexadecimal value as an unsigned value (0x0100C000)