Bitwise Operations

Overview

Link to Experience: Bitwise Operations

Topics: computer science, bits, bitwise operations, logic

Grades: 9-12

Standards:

Duration to complete: 10-15 minutes

Learning outcome: Students will understand how different bitwise operations change bits. These operations include NOT, AND, OR, and XOR. They will apply this knowledge to solve challenges with multiple operations combined.

In the Classroom

Pre-Experience (Things to Look Out For):

  • How are numbers represented as bits?

  • What is the biggest number 4 bits can represent?

  • How do bits relate to on-and-off switches?

Post-Experience (Things to Think About):

  • What operation gives the complement bit?

  • What does XOR do? What might it be useful for?

  • If you wanted to find out bits that were the same in two operands, what bit operation would you use?

  • If you wanted to find if there is any 1 in any of the two operands, what bit operation would you use?

Previous
Previous

Binary Search Tree

Next
Next

Density