Section 6.7
Review Questions
Shifts
-
Match the kind of shift to a description of it or some clue that
identifies it:
logical shift no new bits are inserted
circular shift the sign bit is stuck
arithmetic shift some bits get lost or destroyed
answer...
logical shift ------------> some bits get lost or destroyed
circular shift ------------> no new bits are inserted
arithmetic shift ------------> the sign bit is stuck
-
What is another name for circular shift?
answer...
rotate
-
Which of the following actually does division by 2? Circle all
that might apply:
left logical left arithmetic left circular
right logical right arithmetic right circular
answer...
right logical and right arithmetic
-
Which of the following actually does multiplication by 2? Circle all
that might apply:
left logical left arithmetic left circular
right logical right arithmetic right circular
answer...
left logical and left arithmetic
-
Perform all the following shifts on the bit pattern 10100001:
1-bit left logical ______________________________
1-bit right logical ______________________________
1-bit left circular ______________________________
1-bit right circular ______________________________
1-bit left arithmetic ______________________________
1-bit right arithmetic ______________________________
answer...
original 10100001
1-bit left logical 01000010
1-bit right logical 01010000
1-bit left circular 01000011
1-bit right circular 11010000
1-bit left arithmetic 11000010
1-bit right arithmetic 10010000
-
What would happen to the sign of a negative number if you performed a
right logical shift on the number? (The number could be either 2's
complement or sign-magnitude.)
answer...
it would change to positive since the leftmost 1 would become 0