A binary shift moves every bit in a number left or right by a set number of places. Shifting left multiplies the value by a power of two; shifting right divides it. This is a fast, hardware-native operation used in graphics, audio processing, and low-level programming that every GCSE Computer Science student needs to master.

What is a binary shift and why does it matter?

Think of the digits in a denary (base-10) number. If you write 47 and shift every digit one place to the left, adding a zero on the right, you get 470 — exactly ten times the original. Binary works the same way, except the base is 2 rather than 10. Each place to the left multiplies by 2; each place to the right divides by 2.

Hardware can perform a shift in a single clock cycle, whereas multiplication requires multiple cycles. This speed advantage is why compilers often replace n × 4 with a two-place left shift internally.

How does a left shift work?

In a left shift, every bit moves left by the specified number of places. Bits that fall off the left edge are lost, and zeros are inserted on the right.

Step-by-step: shift 00001101 (decimal 13) left by 2 places

  1. Write the original 8-bit value: 0 0 0 0 1 1 0 1
  2. Move every bit two positions to the left.
  3. Two zeros fall off the left; insert two zeros on the right.
  4. Result: 0 0 1 1 0 1 0 0

Verify: 00110100 = 32 + 16 + 4 = 52 = 13 × 4 = 13 × 2². ✓

Each place you shift left multiplies the value by 2. Shifting left by n places multiplies by 2ⁿ — provided no significant bits are lost off the left edge.

How does a right shift work?

In a right shift, every bit moves right. Bits that fall off the right edge are discarded, and bits are inserted on the left.

Step-by-step: shift 00110100 (decimal 52) right by 2 places

  1. Write the original value: 0 0 1 1 0 1 0 0
  2. Move every bit two positions to the right.
  3. Two zeros fall off the right (lost).
  4. Insert two zeros on the left.
  5. Result: 0 0 0 0 1 1 0 1

Verify: 00001101 = 8 + 4 + 1 = 13 = 52 ÷ 4 = 52 ÷ 2². ✓

Right shifting is equivalent to integer division by 2ⁿ — any remainder is simply discarded.

What is the difference between a logical shift and an arithmetic shift?

This distinction matters for negative numbers stored in two's complement.

Shift type Direction What fills the vacated bits Preserves sign?
Logical left Left Zeros on the right N/A
Logical right Right Zeros on the left No — sign bit overwritten
Arithmetic right Right Copy of the sign bit (leftmost bit) Yes

A logical right shift always inserts zeros on the left. If the number is negative (sign bit = 1), this changes it to a positive value — not what you want when dividing a negative number.

An arithmetic right shift copies the sign bit into the vacated positions, preserving the sign of the number. So –16 shifted right by 1 gives –8, not a large positive number.

At GCSE level, exam questions typically use unsigned (positive) numbers, so the logical shift is usually all you need — but knowing the distinction earns extension marks.

What happens when bits are lost in a shift?

When significant bits are pushed off the edge of the register, information is permanently lost — this is called overflow (on a left shift) or loss of precision (on a right shift).

Example of overflow:

Binary Denary
Original value 01100000 96
Shift left by 2 10000000 128 → incorrect!

96 × 4 should be 384, but in an 8-bit register the result wraps around incorrectly. The high bits that contained the value were pushed out. This is why checking whether a shift will overflow is important in real programs.

Shift operations: a summary table

Operation Example (8 bits) Effect
Left shift by 1 0000101000010100 × 2 (10 → 20)
Left shift by 2 0000101000101000 × 4 (10 → 40)
Right shift by 1 0001010000001010 ÷ 2 (20 → 10)
Right shift by 2 0001010000000101 ÷ 4 (20 → 5)
Right shift (odd) 0000101100000101 ÷ 2, remainder lost (11 → 5)

Frequently asked questions

What is the AQA GCSE formula for a binary shift?

AQA expects you to know that a left shift of n places multiplies the value by 2ⁿ, and a right shift of n places performs integer division by 2ⁿ. You should also be able to perform a shift on a given 8-bit or 16-bit value, showing the bit pattern before and after. The specification uses the phrase "shift operations" in section 3.3, so expect this to appear in the data representation questions.

Why would a programmer use a shift instead of multiplication?

On most processors, a single bit-shift instruction executes in one clock cycle, while integer multiplication can take several cycles. For powers of two, a shift is therefore faster and uses less energy. Modern compilers automatically replace x * 4 with x << 2 during optimisation. Students do not need to perform this optimisation by hand, but understanding why it works shows deeper knowledge of how hardware operates.

Can a shift move bits off the end of the register?

Yes. If you shift a value far enough, bits fall off the edge of the register and are permanently lost. In an 8-bit register, shifting left by 8 or more places always produces zero. On a left shift, if a 1-bit is pushed off the most significant end, the result is numerically incorrect — this is integer overflow. Real programs check for this by comparing the result to the original value or by testing a carry flag in the processor status register.

Is there a difference between multiplying by 4 and shifting left by 2?

For unsigned integers in a register that is large enough to hold the result, the outcomes are identical. The difference is speed and implementation: the shift is typically one processor instruction, while multiplication uses a dedicated multiply unit and takes more cycles. In two's complement signed numbers, shifting and multiplying are still equivalent as long as no overflow occurs. If overflow does occur, the shift and the multiplication can produce different wrong answers depending on how the processor handles each.


Professor Turing guides you through binary shifts — and every other GCSE data representation topic — with live worked examples at aitutors.me.