GCSE Link: 3.03 (Binary Arithmetic)
You should already know how to add binary numbers from GCSE. You should also already know how to multiply a binary number by a power of two using shifts, but now we're going to learn how to multiply a binary number by any number.
The way we would do this is we would split the second number into powers of two, then multiply the first number by each power of two (using shifts), then sum the results of each multiplication.
Let's take an example. We'll use 19 × 13.
100112 × 11012.
1s in the 20, 22, and
23 columns. This means that
13 = 20 + 22 + 23.
<< to denote left-shift.) 10011<<0 == 00010011 10011<<2 == 01001100 10011<<3 == 10011000
0 0 0 1 0 0 1 1
0 1 0 0 1 1 0 0
+ 1 0 0 1 1 0 0 0
-----------------
1 1 1 1 0 1 1 1
1 1
Perform the calculation
110102 × 10012 in binary.
Step 1: 110102 × 10012
Step 2: 23 + 20
Step 3: 11010000, 00011010
Step 4: 11101010
Step 5: 26 × 9 = 234 ✓