Skip to content

Visaulizing Bitshifting

The first time you saw ">>" or "<<" in a programming language, you probably wondered WTF is this? Or at least I did. The concept is actually quite simple, but it's hard to grasp at first. Visaualizing it helps and allowing to play around with it helps a lot.

Visaulizing Bitshifting Example (PHP-GLFW VG)

Run this example:

php examples/vg/fun_bitshifting.php

Controls:

  • Click on a bit to toggle it
  • Click on the << and >> buttons to shift the bits
  • Click on the button on the top to set the number to a constant