- Foundation
- About 12 min
- 5 practice questions
Doubling, halving and shifting bits
See how adding a 0 on the right multiplies by the base, how dropping the last bit halves a number, and use the last bits to test even numbers and multiples of 4.
If something looks wrong, please tell us.
In decimal, adding a zero on the right multiplies a number by ten: 45 becomes 450. Every positional system behaves in the same way. Adding a zero on the right of a binary number multiplies it by two, and removing the last bit divides it by two. Computers use this fact constantly, and it gives exam-day shortcuts.
Shifting left and right
Moving all the bits one place to the left, and filling the empty place with 0, is called a left shift. It doubles the number. A right shift moves all bits one place to the right and drops the last bit. It halves the number, ignoring any remainder. The dropped bit is exactly that remainder: if it was 1, the original number was odd.
| Operation | Binary | Decimal | Effect |
|---|---|---|---|
| Start | 101 | 5 | - |
| Left shift once | 1010 | 10 | Doubled |
| Left shift twice | 10100 | 20 | Multiplied by 4 |
| Right shift once from 1101 | 110 | 6 | 13 halved, remainder 1 dropped |
Shifting left by n places multiplies by 2 to the power n. Shifting right by n places divides by 2 to the power n and discards the remainder. The same rule holds in other bases with the base replacing 2: adding a 0 on the right multiplies an octal number by 8 and a hexadecimal number by 16.
Reading the last bits
- If the last bit of a binary number is 0 the number is even; if it is 1 the number is odd.
- If the last two bits are 00 the number is a multiple of 4.
- If the last three bits are 000 the number is a multiple of 8.
- A binary number made of all 1s, with n bits, equals 2 to the power n minus 1.
Worked examples
Example 1. Multiply the binary number 101100 by 2 without converting. Add a zero at the right: 1011000. Check: 101100 is 32 + 8 + 4 = 44, and 1011000 is 64 + 16 + 8 = 88, which is 44 × 2.
Example 2. Is 101100 divisible by 4? Its last two bits are 00, so yes. Dropping those two bits gives 1011, which is 11, so the number is 4 × 11 = 44.
Example 3. The hexadecimal number 1F is 31 in decimal. What is 1F0? Adding a zero multiplies by 16, so 1F0 = 31 × 16 = 496. Check with place values: 1 × 256 + 15 × 16 + 0 = 256 + 240 = 496.
Example 4. Find 13 × 4 using shifts only. 13 is 1101 in binary. Two left shifts append two zeros: 110100. Its value is 32 + 16 + 4 = 52, and 13 × 4 = 52, so the shortcut agrees with ordinary multiplication. Computers use exactly this idea because shifting bits is much faster than general multiplication.
A zero added on the right multiplies by the base. A bit dropped from the right divides by 2 and keeps the remainder.
Key takeaways. Shifts are multiplication and division by powers of the base. The last bit tells you odd or even. These facts allow quick checks: when you double a number, its binary form simply gains a 0 at the end.
Check your understanding
-
1. What is the result of shifting the binary number 101 one place to the left?
- 10
- 110
- 1010
- 1001
Show answer
Answer: C. A left shift adds a 0 on the right: 1010, which is 10, double 5.
-
2. The binary number 11010 is shifted one place to the right. What is the result?
- 1101
- 110100
- 1010
- 11
Show answer
Answer: A. Dropping the last bit gives 1101, which is 13. The original 11010 is 26, and 26 divided by 2 is 13.
-
3. Which binary number is certainly a multiple of 4?
- 10110
- 11001
- 10101
- 11100
Show answer
Answer: D. A multiple of 4 ends with 00. Only 11100 does. It equals 28 = 4 × 7.
-
4. The hexadecimal number 2A is 42 in decimal. What is 2A0 in decimal?
- 420
- 672
- 840
- 462
Show answer
Answer: B. Adding a 0 on the right multiplies by 16: 42 × 16 = 672.
-
5. A right shift by one place drops a last bit of 1. What does this tell you about the original number?
- It was even
- It was a multiple of 4
- It was zero
- It was odd
Show answer
Answer: D. The dropped bit is the remainder after dividing by 2. A remainder of 1 means the number was odd.
Sign in to keep track of the lessons you finish.