Shift Operators
w << n
shift the bit pattern as a whole to the left n bits. Fill the shift-in bits with 0.
w >> n
shift the bit pattern to the right n bits. Fill with zero for positive number. (0 or 1 for negative number).
if
w = 1111 0001 0000 1111
w << 2 becomes
1100 0100 0011 1100
Previous slide
Next slide
Back to first slide
View graphic version