Binary Multiplication
8 - 6
C2000 Microcontroller Workshop - Numerical Concepts
Binary Multiplication
Now that you understand two's complement numbers, consider the process of multiplying two
two's complement values. As with “long hand” decimal multiplication, we can perform binary
multiplication one “place” at a time, and sum the results together at the end to obtain the total
product.
Note:
This is not the method the C28x uses in multiplying numbers — it is merely a way of observing
how binary numbers work in arithmetic processes.
The C28x uses 16-bit operands and a 32-bit accumulator. For the sake of clarity, consider the
example below where we shall investigate the use of 4-bit values and an 8-bit accumulation:
Integer Multiplication (signed)
0100
x 1101
0000
0100
000
0000
00
0100
1
1100
1
1110100
Accumulator
Data Memory
11110100
4
x -3
-12
?
In this example, consider the following:
•
What are the two input values, and the expected result?
•
Why are the “partial products” shifted left as the calculation continues?
•
Why is the final partial product “different” than the others?
•
What is the result obtained when adding the partial products?
•
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?
Note:
With two’s complement multiplication, the leading “1” in the second multiplicand is a
sign bit. If the sign bit is “1”, then take the 2’s complement of the first multiplicand.
Additionally, each partial product must be sign-extended for correct computation.
Summary of Contents for C2000 Piccolo LaunchPad
Page 74: ...Interrupts 4 18 C2000 Microcontroller Workshop Reset and Interrupts ...
Page 100: ...Lab 5 System Initialization 5 26 C2000 Microcontroller Workshop System Initialization ...
Page 218: ...Lab 8 IQmath FIR Filter 8 42 C2000 Microcontroller Workshop Numerical Concepts ...
Page 334: ...F28069 controlCARD A 4 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 ...
Page 336: ...F28035 controlCARD A 6 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 SW3 ...