User`s guide
Table Of Contents
- Getting Started
- Using the IQmath Library
- Block Reference
- Blocks — Alphabetical List
- Absolute IQN
- Arctangent IQN
- C24x ADC
- C24x CAN Receive
- C24x CAN Transmit
- C24x From Memory
- C24x PWM
- C24x To Memory
- C28x ADC
- C28x eCAN Receive
- C28x eCAN Transmit
- C28x From Memory
- C28x PWM
- C28x To Memory
- Division IQN
- F2812 eZdsp
- Float to IQN
- Fractional part IQN
- Fractional part IQN x int32
- Integer part IQN
- Integer part IQN x int32
- IQN to Float
- IQN x int32
- IQN x IQN
- IQN1 to IQN2
- IQN1 x IQN2
- LF2407 eZdsp
- Magnitude IQN
- Saturate IQN
- Square Root IQN
- Trig Fcn IQN
- Index

2 Using the IQmath Library
2-4
Two’s complement is the most common representation of signed fixed-point
numbers and is used by TI digital signal processors.
Negation using signed two’s complement representation consists of a bit
inversion (translation into one’s complement) followed by the binary addition
of a 1. For example, the two’s complement of 000101 is 111011, as follows:
000101 ->111010 (bit inversion) ->111011 (binary addition of a 1 to the LSB)
Q Format Notation
The position of the binary point in a fixed-point number determines how you
interpret the scaling of the number. When it performs basic arithmetic such as
addition or subtraction, hardware uses the same logic circuits regardless of the
value of the scale factor. In essence, the logic circuits have no knowledge of
a binary point. They perform signed or unsigned integer arithmetic — as if the
binary point is to the right of b
0
. Therefore, you determine the binary point.
In the IQmath Library, the position of the binary point in the signed,
fixed-point data types is expressed in and designated by Q format notation.
This fixed-point notation takes the form
Qm.n
where
• designates that the number is in Q format notation — the Texas
Instruments representation for signed fixed-point numbers.
• is the number of bits used to designate the two’s complement integer
portion of the number.
• is the number of bits used to designate the two’s complement fractional
portion of the number, or the number of bits to the right of the binary point.
In Q format, the most significant bit is always designated as the sign bit.
Representing a signed fixed-point data type in Q format always requires
m+n+1 bits to account for the sign.
Example — Q.15
For example, a signed 16-bit number with n = 15 bits to the right of the binary
point is expressed as
Q0.15
Q
m
n