|||

Y10 AU – P6 – Binary Shifts

Accessibility Settings
  • DIN
  • Objectives
  • Logical Shifts Explained
  • Activity 1
  • Arithmetic Shifts Explained
  • Activity 2
  • Plenary

⏱️ Do It Now

Copy this title into a new OneNote document:

Y10 AU – P6 – Binary Shifts

Copy this activity into the OneNote document and complete it:

⏱️ Do It Now:

(1) Complete 10 two’s compliment conversions and paste the result below
Two’s Complement Practice



(2) Complete 10 hexadecimal conversions and paste the result below
Denary → Binary → Hex — Nibbles Copy Checker

🎯 Learning Objectives

(1) We will learn what binary shifts are, and why they are carried out

(2) We will learn how to carry out a logical shift

(3) We will learn how to carry out an arithmetic shift

  • Tab 1
  • Tab 2
  • Tab 3

What are binary shifts?

  • A binary shift moves all the bits in a binary number left or right by a specified number of positions.
  • Bits can move left (←)
  • Bits can move right (→)
  • New positions are filled with 0s

  • Computers use binary shifts because they are much faster than performing multiplication and division calculations.
  • Used by processors to manipulate data efficiently
  • Requires very little hardware circuitry
  • Useful when working with powers of 2

1
0
1
1
0
0
0
1
0
1
1
0

A binary shift simply moves every bit one position left or right.

Logical binary shift operations

  • A binary shift left of one bit moves all the bits one place to the left

• The vacant bit spaces are filled with zeros

0
0
1
1
1
1
0
0
0
1
1
1
1
0
0
0
  • Looking at the table above, what effect does a shift left of one place have on the binary value?

• What effect would a shift right of two places have?

Effects of logical shifts

  • Logical shifts can very quickly multiply or divide a binary number by a factor of two
  • Left shifts multiply
  • Right shifts divide
  • A loss of accuracy can occur if 1 bits are removed:
  • 22 / 4 is not exactly 5
0 0 0 1 0 1 1 0
0 0 0 0 0 1 0 1

⌨️ Activity 1 – Carry Out Logical Shifts

Let’s try some logical shifts

Complete 10 of these and paste the result into OneNote: Binary Shift Practice

Make sure you include the title “Activity 1 – Logical Shifts”

⌨️ Activity 2 – Arithmetic Shifts

  • Tab 1
  • Tab 2
  • Tab 3
  • Tab 4

Logical shifts with negative numbers

  • A logical right shift can be performed with a negative number such as -106
  • What is the problem with doing this?
1001 0110
0100 1011
-106
?

Error occurs

  • A logical right shift can be performed with a negative number such as -106
  • What is the problem with doing this?
1001 0110
0100 1011
-106
75
  • The result should be half the original – e.g. -106/2 = -53

Arithmetic right shifts

  • Instead we use an arithmetic right shift
  • The first sign bit is copied down and across
1 0 0 1 0 1 1 0
1 1 0 0 1 0 1 1
-106
-53

Arithmetic left shifts

  • Arithmetic left shifts are the same as for logical shifts
  • A zero is used to fill the right-most bit
1 1 1 0 1 0 1 0
1 1 0 1 0 1 0 0
-22
-44

⌨️ Activity 2 – Carry Out Arithmetic Shifts

Let’s try some logical shifts

Complete 10 of these and paste the result into OneNote: Arithmetic Shift Practice

Make sure you include the title “Activity 2 – Arithmetic Shifts”

🎓 Plenary

In OneNote:

(1) Explain the benefits for computers in carrying out binary shifts. In this explanation, outline what the limitations are.

(2) Produce an example of a logical shift (you only need to do either a left or right shift). Show what happens before and after, with annotation

(3) Explain why arithmetic shifts are needed. Provide an example of a right arithmetic shift carried out on a negative binary number.