Binary Shifts Flashcards
All 6 cards in this deck
What is the effect on a number's value of a left binary shift of places?
It multiplies the number by .
e.g. a shift left of 2 places multiplies by 4.What is the effect on a number's value of a right binary shift of places?
It divides the number by (any remainder is lost).
e.g. a shift right of 1 place halves the number.True or false? No data is ever lost when a binary shift is carried out.
False. Bits shifted off either end are lost and cannot be recovered.
What are the steps to carry out a left binary shift?
e.g. shift 00001011 two places left- Move every bit the given number of places to the left.
- Fill the empty places on the right with 0s.
- Result: 00101100 (11 becomes 44).
In what situation can a binary shift be used?
To multiply or divide a number by a power of two, such as 2, 4 or 8.
What are the steps to carry out a right binary shift?
e.g. shift 01101011 two places right- Move every bit the given number of places to the right.
- Fill the empty places on the left with 0s; bits moved off the right-hand end are lost.
- Result: 00011010 (107 becomes 26).