What Is a Logical Binary Shift?

A logical binary shift is the process of moving every bit in a binary number to the left or to the right by a specified number of places. It is one of the simplest operations a computer’s processor can perform, and it has a remarkably useful side effect: it multiplies or divides the number by a power of 2.

Here is the core idea in two sentences:

In both cases, any bits that are pushed off the end of the register are permanently lost. They do not wrap around — they simply disappear. This is an important detail that catches many students out in exams.

Think of it like a row of eight boxes on a conveyor belt. If you push the belt to the left by one position, everything moves one box to the left, a zero drops into the empty box on the right, and whatever was in the leftmost box falls off the edge and is gone forever.

Key Concept: Shifts and Multiplication A left shift by 1 = multiply by 2. A left shift by 2 = multiply by 4. A left shift by 3 = multiply by 8. In general, a left shift by n = multiply by 2n. Similarly, a right shift by n = integer divide by 2n. This works because binary is a base-2 system — shifting digits changes their place values by powers of 2, just as shifting digits in denary changes their place values by powers of 10.

Worked Examples

Let us work through several examples so you can see exactly what happens to the bits during a shift. Pay close attention to where the 0s are inserted and where bits fall off.

Example 1: Left Shift by 1

Starting number: 00001010 (10 in denary). Shift all bits one place to the left.

Left Shift by 1 — 00001010 (10)
  Before:  0 0 0 0 1 0 1 0     (10)
              ← ← ← ← ← ← ← ←   shift left by 1
  After:   0 0 0 1 0 1 0 0     (20)
                             ^
                         0 fills in

  Result: 10 × 2 = 20  ✓

Every bit moved one position to the left. A 0 filled the empty space on the right. The leftmost bit (0) fell off, but since it was already 0 this caused no problem. The denary value doubled from 10 to 20.

Example 2: Left Shift by 2

Starting number: 00000110 (6 in denary). Shift all bits two places to the left.

Left Shift by 2 — 00000110 (6)
  Before:  0 0 0 0 0 1 1 0     (6)
              ← ← ← ← ← ← ← ←   shift left by 2
  After:   0 0 0 1 1 0 0 0     (24)
                           ^ ^
                       0s fill in

  Result: 6 × 4 = 24  ✓
  (Left shift by 2 = multiply by 2² = multiply by 4)

Every bit jumped two positions to the left. Two 0s filled in on the right. The two leftmost bits (both 0) fell off harmlessly. The denary value went from 6 to 24 — that is 6 × 4, exactly as the rule predicts.

Example 3: Right Shift by 1

Starting number: 00010100 (20 in denary). Shift all bits one place to the right.

Right Shift by 1 — 00010100 (20)
  Before:  0 0 0 1 0 1 0 0     (20)
              → → → → → → → →   shift right by 1
  After:   0 0 0 0 1 0 1 0     (10)
           ^
       0 fills in

  Result: 20 ÷ 2 = 10  ✓

Every bit moved one position to the right. A 0 filled in on the left. The rightmost bit (0) fell off, and since it was 0 no data was lost. The denary value halved from 20 to 10.

Example 4: Right Shift by 3

Starting number: 01101000 (104 in denary). Shift all bits three places to the right.

Right Shift by 3 — 01101000 (104)
  Before:  0 1 1 0 1 0 0 0     (104)
              → → → → → → → →   shift right by 3
  After:   0 0 0 0 1 1 0 1     (13)
           ^ ^ ^
        0s fill in

  Result: 104 ÷ 8 = 13  ✓
  (Right shift by 3 = divide by 2³ = divide by 8)

Every bit moved three positions to the right. Three 0s filled in on the left. Three bits (0, 0, 0) fell off the right-hand side — all were 0 in this case, so no data was lost. The denary value went from 104 to 13 — that is 104 ÷ 8, exactly as the rule predicts.

When Things Go Wrong: Data Loss from a Left Shift

Now let us see what happens when a left shift pushes a significant bit (a 1) off the left-hand edge.

Left Shift by 1 — 11000000 (192) — DATA LOSS!
  Before:  1 1 0 0 0 0 0 0     (192)
              ← ← ← ← ← ← ← ←   shift left by 1
  After:   1 0 0 0 0 0 0 0     (128)
       ^                   ^
   1 fell off!          0 fills in

  Expected: 192 × 2 = 384
  Actual:   128              ✗ WRONG!
  The answer 384 does not fit in 8 bits.

The leftmost 1 was pushed off the edge and lost. The mathematically correct answer is 192 × 2 = 384, but 384 requires 9 bits to represent (110000000). Since we only have 8 bits, the 9th bit is gone and we are left with 10000000 = 128 — a completely wrong result. This is overflow caused by a left shift.

Try These on Paper:
  1. Left shift 00000101 (5) by 2. What do you get? (Expected: 5 × 4 = 20 = 00010100)
  2. Right shift 00110000 (48) by 2. What do you get? (Expected: 48 ÷ 4 = 12 = 00001100)
  3. Left shift 01100000 (96) by 2. Does data loss occur? (Yes! 96 × 4 = 384, which overflows 8 bits)
  4. Right shift 00000111 (7) by 1. What do you get? Is the result exactly 3.5? (You get 3 — the 0.5 is lost)
Key Concept: Why Shifts Are Used Shifting bits is the fastest mathematical operation a CPU can perform. It is significantly faster than multiplication or division because no actual arithmetic needs to happen — the processor simply moves the bits along the register. In games, graphics engines, and embedded systems where speed is critical, programmers often use shifts instead of multiplication. For example, instead of writing x * 8, a programmer might write x << 3 (left shift by 3), and the CPU executes it in a single clock cycle rather than several.

Shifts and Data Loss

Data loss is the most important pitfall to understand when working with binary shifts. There are two situations where it occurs, and both are commonly tested in exams.

1. Left Shift Overflow

When you shift bits to the left, the leftmost bits are pushed off the edge of the register. If any of those lost bits were 1s, the result will be incorrect. This is essentially the same kind of overflow error you learned about in binary addition — the correct answer simply does not fit in the available number of bits.

For example, in 8 bits, the number 192 (11000000) cannot be doubled by a left shift because 384 needs 9 bits. Any number larger than 127 will overflow if left-shifted by 1 in an 8-bit system. More generally, a left shift by n will overflow if the original number is greater than 255 ÷ 2n (for 8-bit unsigned numbers).

2. Right Shift Precision Loss

When you shift bits to the right, the rightmost bits fall off. If any of them were 1s, information is lost. This most commonly happens when you right-shift an odd number.

Consider the number 7 (00000111). If we right-shift by 1:

Right Shift by 1 — 00000111 (7) — Precision Loss
  Before:  0 0 0 0 0 1 1 1     (7)
              → → → → → → → →   shift right by 1
  After:   0 0 0 0 0 0 1 1     (3)
                             ^
                         1 fell off!

  Expected: 7 ÷ 2 = 3.5
  Actual:   3                (the .5 is lost)

  This is INTEGER division — the remainder is discarded.

The mathematically correct answer is 3.5, but binary integers cannot represent fractions. The rightmost 1 fell off and was lost, so the computer stores 3. This is not an error in the way overflow is — it is the expected behaviour of integer division — but it does mean that right shifting is only an exact division when the number is evenly divisible by 2n.

Summary of Data Loss Rules

Shift DirectionWhat Can Go WrongWhen It Happens
LeftOverflow — significant 1s pushed off the leftWhen the result exceeds the maximum value for the bit width (e.g. > 255 for 8 bits)
RightPrecision loss — significant 1s fall off the rightWhen the original number is odd, or more generally when any of the discarded bits are 1
Watch Out — Data Loss in Exams: If an exam question asks you to perform a binary shift, always check whether any 1-bits are lost. For a left shift, check whether any of the leftmost bits that will be shifted out are 1s. For a right shift, check the rightmost bits. If 1s are lost, you must state this and explain that the result is inaccurate. Examiners specifically set questions that cause data loss to test whether you understand this concept — do not fall into the trap of just writing the shifted answer without commenting on it.

Interactive Exercise 1: Left Shift Practice

Perform the left shift shown below. Enter the resulting 8-bit binary number.

Loading...
Score: 0 / 0

Interactive Exercise 2: Right Shift Practice

Perform the right shift shown below. Enter the resulting 8-bit binary number.

Loading...
Score: 0 / 0

Test Yourself

Click on each question to reveal the answer. Try to work it out on paper first — draw out the 8 boxes and physically move the bits!

Q1: Perform a left shift by 1 on the binary number 00010110 (22). Give the result in binary and denary.

Answer:

  Before:  0 0 0 1 0 1 1 0   (22)
  After:   0 0 1 0 1 1 0 0   (44)

Result: 00101100 = 44. Check: 22 × 2 = 44. Correct — no data loss.

Q2: Perform a right shift by 2 on the binary number 01100100 (100). Give the result in binary and denary.

Answer:

  Before:  0 1 1 0 0 1 0 0   (100)
  After:   0 0 0 1 1 0 0 1   (25)

Result: 00011001 = 25. Check: 100 ÷ 4 = 25. Correct — no data loss because the two rightmost bits were both 0.

Q3: Perform a left shift by 3 on the binary number 00000101 (5). What is the result and what denary multiplication does this represent?

Answer:

  Before:  0 0 0 0 0 1 0 1   (5)
  After:   0 0 1 0 1 0 0 0   (40)

Result: 00101000 = 40. A left shift by 3 is the same as multiplying by 23 = 8. Check: 5 × 8 = 40. Correct.

Q4: Perform a right shift by 1 on the binary number 00001011 (11). What is the result, and has any data been lost?

Answer:

  Before:  0 0 0 0 1 0 1 1   (11)
  After:   0 0 0 0 0 1 0 1   (5)

Result: 00000101 = 5. The mathematically correct answer is 11 ÷ 2 = 5.5, but the rightmost 1-bit fell off. The computer gives 5 — the 0.5 is lost. This is precision loss due to integer division.

Q5: Perform a left shift by 2 on the binary number 01100000 (96). What happens?

Answer:

  Before:  0 1 1 0 0 0 0 0   (96)
  After:   1 0 0 0 0 0 0 0   (128)

  Expected: 96 × 4 = 384
  Actual:   128  ✗ WRONG!

The correct answer is 96 × 4 = 384, but 384 cannot fit in 8 bits (it would need 9 bits: 110000000). The leftmost 1 was shifted out and lost, leaving 10000000 = 128. This is overflow — the result is incorrect because significant bits were lost during the shift.

Q6: Explain why a left shift by n places is equivalent to multiplying by 2n.

Answer: Binary is a base-2 number system, where each column has a place value that is twice the column to its right (1, 2, 4, 8, 16, 32, 64, 128). When you shift a bit one place to the left, you move it from its current column into the column with double the place value. For example, a 1 in the 8s column moves to the 16s column — its value doubles. Since every bit doubles in value, the entire number doubles. Shifting by 2 places doubles twice (× 4), by 3 places doubles three times (× 8), and so on. In general, shifting left by n places multiplies by 2n.

Q7: A programmer writes code that uses a left shift by 4 to multiply a variable by 16. Under what circumstances would this produce a wrong answer?

Answer: A left shift by 4 moves all bits four places to the left, meaning the four leftmost bits will be shifted out and lost. If any of those four bits are 1s, the result will be incorrect due to overflow. Specifically, for an 8-bit unsigned number, the shift will only give the correct answer if the original number is 15 or less (i.e. 255 ÷ 16 = 15, rounded down). Any value from 16 upwards, when multiplied by 16, exceeds 255 and cannot fit in 8 bits. For example, 16 × 16 = 256, which overflows. The programmer should ensure the variable’s value is small enough that the result fits within the bit width, or use a larger data type.

Key Vocabulary

Make sure you know all of these terms for your exam:

TermDefinition
Binary Shift The process of moving all bits in a binary number a specified number of places to the left or right. Empty positions are filled with 0s, and bits that move beyond the register are lost.
Left Shift A binary shift that moves all bits to the left by n places. Equivalent to multiplying the number by 2n. Zeros fill in on the right-hand side.
Right Shift A binary shift that moves all bits to the right by n places. Equivalent to integer division by 2n. Zeros fill in on the left-hand side.
Logical Shift A type of binary shift where the vacated positions are always filled with 0s, regardless of the direction of the shift. This is the type of shift studied at GCSE level (as opposed to arithmetic shifts, which preserve the sign bit).
Data Loss The permanent loss of information when bits containing 1s are shifted off the edge of the register. This causes the result to be inaccurate. It can occur in both left shifts (overflow) and right shifts (precision loss).
Overflow An error that occurs when the result of an operation is too large to fit in the available number of bits. In the context of shifts, overflow happens when a left shift pushes significant 1-bits off the left-hand end of the register.

Exam Tips

Exam Tip 1: Always Show Before and After When a question asks you to perform a binary shift, write out the binary number before the shift and the binary number after the shift, clearly labelled. Draw the 8-bit pattern both times. This makes your working crystal clear and earns you method marks even if you make a small error in the shifting. Some students also draw arrows to show the direction of the shift, which is an excellent habit.
Exam Tip 2: State the Multiplication or Division After performing the shift, always write a sentence explaining the denary effect. For example: “A left shift by 2 is equivalent to multiplying by 4. The original number was 6 and the result is 24, which confirms 6 × 4 = 24.” This demonstrates understanding beyond just moving bits, and examiners award marks for this explanation. It also serves as a useful check on your own answer.
Exam Tip 3: Spotting Data Loss If the question involves a left shift and the original number has 1s near the left-hand end of the byte, alarm bells should ring — there is a good chance those 1s will be shifted off the end. Similarly, if a right shift is applied to an odd number, the rightmost bit is a 1 and will be lost. Examiners deliberately set questions that cause data loss to see if you mention it. If you spot it, write something like: “The leftmost 1-bit was shifted out and lost, causing overflow. The stored result (128) is incorrect because the true answer (384) exceeds 255 and cannot be represented in 8 bits.”
Exam Tip 4: Know Your Powers of 2 Shift questions often require you to know the powers of 2 quickly. Memorise them: 21 = 2, 22 = 4, 23 = 8, 24 = 16, 25 = 32, 26 = 64, 27 = 128, 28 = 256. If a question says “left shift by 3,” you should immediately think “multiply by 8.” If it says “right shift by 2,” you should immediately think “divide by 4.” This quick mental lookup helps you verify your binary answer using denary arithmetic.

Past Paper Questions

Try these exam-style questions, then click to reveal the mark scheme answer.

Perform a left shift of 2 places on the binary number 00010110. State the denary value before and after the shift. [3] marks

Mark scheme:

  • Before: 00010110 = 22 in denary (1)
  • After shift: 01011000 (1)
  • = 88 in denary (multiplied by 4) (1)
Explain the effect of a right shift of 1 place on a binary number. [2] marks

Mark scheme:

  • Each bit moves one position to the right / the rightmost bit is lost (1)
  • The value is halved / divided by 2 (integer division) (1)
A binary number has a denary value of 40. What will its denary value be after a left shift of 3 places? [1] mark

Mark scheme:

320 (40 × 2³ = 40 × 8 = 320) (1)

Why Binary Shifts Matter

Binary shifts might seem like a simple mechanical process, but they are fundamental to how computers work at the hardware level. Here is why they matter beyond the exam:

Understanding shifts gives you a deeper insight into how computers think at the most fundamental level. Every multiplication, every pixel drawn on screen, and every encrypted message you send is built upon these simple bit-moving operations.

Video Resources

Further Reading