Multiplication by shifting: 1011 × 8 — binary arithmetic
edge caseshifting is multiplying by 2ⁿ
Answer
00000001011000
Why this example is worth doing
Multiplying by a power of two is a left shift by the exponent, appending zeros. It is the cheapest operation in the whole set — a shift is just wiring, with no gates at all in a fixed-amount shifter — and it is why compilers replace multiplication by constants with shift-and-add sequences. The page notes the matching right shift for division and warns that arithmetic and logical right shifts differ for signed values.
Try your own input in the Binary arithmetic. Add, subtract, multiply and divide in binary with every carry and borrow shown.
How the answer is reached
0001011 x 0001000 (7-bit unsigned)
| operand | bits | hex | unsigned | signed |
|---|---|---|---|---|
| A | 0001011 | 0x0B | 11 | 11 |
| B | 0001000 | 0x08 | 8 | 8 |
Shift and add: one partial product per multiplier bit, each shifted left by its bit index. A 7 x 7 multiply needs 14 bits of product.
| bit index | multiplier bit | partial product | meaning |
|---|---|---|---|
| 0 | 0 | 00000000000000 | 0 (multiplier bit is 0) |
| 1 | 0 | 00000000000000 | 0 (multiplier bit is 0) |
| 2 | 0 | 00000000000000 | 0 (multiplier bit is 0) |
| 3 | 1 | 00000001011000 | |A| << 3 |
| 4 | 0 | 00000000000000 | 0 (multiplier bit is 0) |
| 5 | 0 | 00000000000000 | 0 (multiplier bit is 0) |
| 6 | 0 | 00000000000000 | 0 (multiplier bit is 0) |
sum of partial products00000001011000
product00000001011000 = 88