Bit Shifting Flashcards
Bit Shifting
Bits can either be shifted to the left or the right. When a binary number is shifted the denary number will change. It will change based on how much it moves, but as we shift to the left each time it multiplies by 2. If we shift to the right, then the number will divide by 2 each time. This does mean that if we have a number that has half or 0.5 at the end, it will be lost when shifting. For example if a binary number equals 5 then shifting this to the right by 1 will equal 2 not 2.5.
Shift 00011101 3 places to the left.
11101—
Shift 00111100 2 places to the right
–001111
Divide 00011101 by 2
00001110
Multiply 00011101 by 8
11101000
Shift 00011101 1 place to the right.
00001110