1.2.26

Binary Shifts

Test yourself

Binary Shifts

A binary shift is a technique for performing multiplication or division on a binary number.

Illustrative background for Binary shiftIllustrative background for Binary shift ?? "content

Binary shift

  • In a binary shift, each digit is moved one column to the left or the right.
  • Extra 0 bits are added to the start or end of the binary number to fill any missing spaces.
Illustrative background for Left binary shiftIllustrative background for Left binary shift ?? "content

Left binary shift

  • In a left binary shift, each digit is moved one place to the left.
    • This has the effect of multiplying the number by two.
  • You must take care, when performing a left shift, that there is no overflow error (where we run out of space to store the last digit of the number).
Illustrative background for Right binary shiftIllustrative background for Right binary shift ?? "content

Right binary shift

  • In a right binary shift, each digit is moved one place to the right.
    • This has the effect of dividing the number by two.
  • You must take care when performing a right shift that no data is shifted off the right hand side. This can cause a loss of accuracy.

Jump to other topics

1Computer Systems

1.1Systems Architecture

1.2Memory & Storage

1.3Computer Networks, Connections & Protocols

1.4Network Security

1.5Systems Software

1.6Ethical, Legal, Cultural & Environmental Concern

2Computational Thinking, Algorithms and Programming

2.1Algorithms

2.2Programming Fundamentals

2.3Producing Robust Programs

2.4Boolean Logic

2.5Programming Languages & IDEs

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson