Binary Multiplication: Rules, Shifts, and Worked Examples
Multiply binary integers and fractions with shift-and-add. Work through six examples and check signed values, carries, and overflow.
TL;DR
Multiply by each binary digit, shift each partial product to match its place, and add in base 2. A multiplier bit of 1 copies the other factor. A bit of 0 contributes zero.
Key Points
- The one-bit products are zero except for .
- A left shift by one position doubles a nonnegative binary integer when enough space is available.
- Align partial products by place value. Add using base-2 carries.
- For binary fractions, use the total fractional places of both factors before removing trailing zeros.
- Check the bit width and signed representation when using a fixed-width register.
What are the binary multiplication rules?
Binary uses digits 0 and 1. The four possible single-digit products are:
| First bit | Second bit | Product |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
The binary number system guide explains why the rightmost bit of a whole number is the units place, followed by the twos, fours, and eights. Place value determines where a partial product belongs. McMaster University, Number Systems and Binary Arithmetic
How do you multiply two binary numbers by hand?
- Write one factor above the other with their rightmost digits aligned.
- Read the bottom factor from right to left. For a 1, copy the top pattern. For a 0, use a zero row.
- Move the copied row left by the bottom bit’s position, counting the rightmost position as zero.
- Add the rows one at a time in binary. Two ones give , so write 0 and carry 1. Three ones give , so write 1 and carry 1.
For , the rightmost bit is zero. The next bit copies one place left as . The last bit copies it two places left as . Adding gives . This is the same place-value method as decimal long multiplication, with powers of two instead of ten. University of Iowa, Binary Multiplication Algorithms
Why does the shift-and-add method work?
Write the bottom factor as a sum of powers of two. For example, . Multiplying the top factor by that sum gives . The distributive property explains the two rows.
A left shift by positions multiplies an unsigned integer by if all result bits fit. You can skip zero rows because their contributions are zero. A computer can use the same idea by choosing a partial product for each bit and adding the shifted results. Circuit Quest, Binary Multiplication by Hand
How do binary fractions, negative numbers, and bit width change the process?
For nonnegative fractions, temporarily remove both binary points. Multiply as integers, then count back from the right by the total number of fractional bits removed. Each fractional bit represents an additional division by 2. Add leading zero bits when needed to show the point clearly. The number systems guide explains fractional place values.
For ordinary signed numbers written with a minus sign, multiply magnitudes and apply the sign. A fixed-width signed value may instead use two’s complement, where the highest bit has a negative place weight. Determine the intended representation before reading the bits. For instance, the four-bit string denotes 13 as an unsigned value and in four-bit two’s complement.
Two unsigned numbers of at most bits can require up to product bits. Keeping only the low bits leaves the result modulo . If the intended value is out of range, that truncated result is not the full product. University of Michigan, Binary Arithmetic
Worked Binary Multiplication Examples
Example 1
Multiply by .
- The nonzero bits in the second factor are at positions 1 and 2.
- Add the rows and .
- The result is . In decimal, .
Example 2
Multiply by .
- The bottom 1 bits are in the units and fours positions.
- Add and .
- The result is , equal to .
Example 3
Multiply by .
- The three partial products are , , and .
- Adding the first two gives .
- Adding the last gives , equal to .
Example 4
Find .
- Removing one fractional bit position from each factor leaves and .
- Their integer product is .
- Restore two fractional positions to get . In decimal, .
Example 5
Two four-bit two’s-complement inputs are and . Find the signed product and check whether it fits in four bits.
- The signed inputs are and 2.
- Their product is , which lies in the four-bit signed range from to 7.
- Add 16 to to obtain its four-bit pattern . As a check, that pattern has value under this interpretation.
Example 6
Multiply the unsigned four-bit values and . What happens if only four result bits are kept?
- The decimal product is .
- The full binary product is .
- Its low four bits are , or 13. This is modulo 16. The full value needs six bits.
Mistakes That Change a Binary Product
Mistake 1: Shifting only when the multiplier bit is 1
A zero contributes no row. Its position still affects how much to shift later rows.
Mistake 2: Writing a decimal carry in the result column
In base 2, . Write the 0 in that column and carry 1 left.
Mistake 3: Treating all leading 1s as sign bits
The highest bit has an ordinary positive weight in an unsigned value. It has a negative weight in a fixed-width two’s-complement value. Check which convention applies.
Try It Yourself
- Find .
- Find .
- Multiply by using one shift.
Answers and Reasoning
- Add and to get .
- Each factor is one-half, so the product is one-quarter, or .
- Shift left twice to get , equal to decimal 36.
Frequently Asked Questions
What happens when you multiply by 10 in binary?
equals decimal 2. A left shift by one position gives the product if all bits can be stored.
Can binary multiplication give more digits than the factors?
Yes. For instance, gives . Save enough positions for the entire result.
How can you check a binary product quickly?
Convert both factors and the result to decimal for a second calculation. You can also use binary place values and confirm that each nonzero partial row starts in the position marked by the corresponding multiplier bit.
Conclusion
- Use the four one-bit rules and shift each row by place value.
- Add partial rows with binary carries.
- Restore fractional places and check word width or sign conventions when they apply.
Read More
Research Behind This Article
- McMaster University, 4D6 Lab Manual: Number Systems. McMaster Physics
- Douglas W. Jones, CS:2630 Notes, Chapter 9: Beyond Add and Subtract. University of Iowa
- University of Michigan, Binary Arithmetic. University of Michigan EECS
- Circuit Quest, Binary Multiplication by Hand. Circuit Quest