4.1.9

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

1Components of a Computer

2Software & Software Development

3Exchanging Data

4Data Types, Data Structures & Algorithms

5Legal, Moral, Cultural & Ethical Issues

6Elements of Computational Thinking

6.1Thinking Abstractly

6.2Thinking Ahead

6.3Thinking Procedurally

6.4Thinking Logically

6.5Thinking Concurrently

7Problem Solving & Programming

8Algorithms

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium