MATLAB EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO Podręcznik Użytkownika Strona 38

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 112
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 37
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
Przeglądanie stron 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 111 112

Komentarze do niniejszej Instrukcji

Brak uwag