Binary Fractions
C2000 Microcontroller Workshop - Numerical Concepts 8 - 9
Multiplying Binary Fractions
When the C28x performs multiplication, the process is identical for all operands, integers or
fractions. Therefore, the user must determine how to interpret the results. As before, consider the
4-bit multiply example:
Fraction Multiplication
0100
x 1101
00000100
0000000
000100
11100
11110100
11110100
1/2
x -3/8
-3/16
Accumulator
.
.
Data Memory
-1/4
1110
.
As before, consider the following:
• What are the two input values and the expected result?
• As before, “partial products” are shifted left and the final is negative.
• How is the result (obtained when adding the partial products) read?
• How shall this result be loaded into the accumulator?
• How shall we fill the remaining bit? Is this value still the expected one?
• How can the result be stored back to memory? What problems arise?
To “read” the results of the fractional multiply, it is necessary to locate the binary point (the base
2 equivalent of the base 10 decimal point). Start by identifying the location of the binary point in
the input values. The MSB is an integer and the next bit is 1/2, therefore, the binary point would
be located between them. In our example, therefore, we would have three bits to the right of the
binary point in each input value. For ease of description, we can refer to these as “Q3” numbers,
where Q refers to the number of places to the right of the point.
When multiplying numbers, the Q values add. Thus, we would (mentally) place a binary point
above the sixth LSB. We can now calculate the “Q6” result more readily.