Digital Signal Processing Reference
In-Depth Information
Thus bit position 6 is available for the sign bit. The 8-bit equivalent would have 2
sign bits (bits 6 and 7). The C6x supports signed and unsigned multiplies and there-
fore provides 2 n bits for the product.
Consider the multiplication of two fractional 4-bit numbers, with each number
consisting of 3 fractional bits and 1 sign bit. Let the product be represented by an
8-bit number. The first number is
-
0.5 and the second number is 0.75; the multi-
plication is as follows:
-
0.50
=
1.100
¥
0.75
=
0.110
111 11000
11 1000
111.101000
C
= -
2 1
+
2 0
+
2 -1
+
2 -3
= -
0.375
The underlined bits of the multiplicand indicate sign extension. When a negative
multiplicand is added to the partial product, it must be sign-extended to the left up
to the limit of the product in order to give the proper larger bit version of the same
number. To demonstrate that sign extension gives the correct expanded bit number,
scan around the number wheel in Figure C.2 in the counterclockwise direction from
0. Write the codes for 5-bit, 6-bit, 7-bit,...negative numbers. Notice that they would
be derived correctly by sign-extending the existing 4-bit codes; therefore, sign exten-
sion gives the correct expanded bit number. The carry-out will be ignored; however,
the numbers 111.101000 (9-bit word), 11.101000 (8-bit word), and 1.101000 (7-bit
word) all represent the same number:
-
0.375. Thus, the product of the preceding
example could be represented by (2 n
1) bits, or 7 bits for a 4-bit system.
When two 16-bit numbers are multiplied to produce a 32-bit result, only 31 bits
are needed for the multiply operation. As a result, bit 30 is sign-extended to bit 31.
The extended bits are frequently called sign bits.
Consider the following example: to multiply (0101) 2 by (1110) 2 , which is equiva-
lent to multiplying 5 by
-
-
2 in decimal, which would result in
-
10. This result is
outside the dynamic range {
8,7} of a 4-bit system. Using a Q-3 format, this corre-
sponds to multiplying 0.625 by
-
-
0.25, yielding a result of
-
0.15625, which is within
the fractional range.
When two Q-15 format numbers (each with a sign bit) are multiplied, the result
is a Q-30 format number with one extra sign bit. The MSB is the extra sign bit. One
can shift right by 15 to retain the MSBs and only one of the 2 sign bits. By shifting
right by 15 (dividing by 2 15 ) to be able to store the result into a 16-bit system, this
discards the 15 LSBs, thereby losing some precision. One is able to retain high pre-
cision by keeping the most significant 15 bits. With a 32-bit system, a left shift by 1
bit would suffice to get rid of the extra sign bit.
Search WWH ::




Custom Search