Source: https://people.cs.pitt.edu/~childers/CS0447/lectures/shift-operations.pdf