1.3 Binary Shifts and Two’s Complement Flashcards
(14 cards)
What is the result of multiplying the binary number 0101 0101 1101 1101 by two?
1010 1011 1011 1010
To multiply a binary number by two, move all bits to the left and put a zero at the right.
How do you divide a binary number by 2?
Move the bits to the right and put a zero in the most significant bit
Dividing by 2 results in a loss of precision for non-integer results.
What happens to the fractional component when dividing an 8-bit binary number?
It is lost
Example: 45 ÷ 2 = 22.5 is represented as 22 in binary.
What is the effect of a logical left shift on a binary number?
Doubles the number
Example: 1000 (8) becomes 10000 (16) after a left shift.
What is the effect of a binary right shift on a number?
Halves the number and rounds down
Example: 1000 (8) becomes 100 (4) after a right shift.
What is the range of numbers that can be represented using 8-bit Two’s Complement?
-128 to 127
How is -15 represented in Two’s Complement?
1111 0001
First convert 15 to binary, then invert the bits and add 1.
What does the Two’s Complement representation 1011 0001 signify?
-79
What is the result of the left shift of 0110 1011?
1101 0110
What is the effect of a left shift on a binary number?
We double the number
What is the result of the right shift of 0110 1010?
0011 0101
What is the effect of a right shift on a binary number?
We halve the number
What happens during a further right shift?
We halve the number and round down, leading to a loss of precision
What is the Two’s Complement of 0110 1010 (106)?
10010110 (-106)