I have a practice question here and even though I'm pretty comfortable with Radix / Bit-shifting I just don't understand this question.
For an eight-bit integer x represented in two’s complement format, which of the following yields the value of 5x? Here, the overflow or underflow can be ignored in this multiplication.
a) Shift x to the left by 1 bit, then add the initial value of x to it.
b) Shift x to the left by 2 bits, then add the initial value of x to it.
c) Shift x to the right arithmetically by 1 bit, then subtract the initial value of x from it.
d) Shift x to the right arithmetically by 2 bits, then subtract the initial value of x from it.
So an eight bit integer would be something like (00011100)2 -> (+28)10
Two's complement format is negative base2 so it becomes (11100100)2 -> (-28)10
5x would be (+140)10 or (10001100)2.
I know how to perform <<, but I just don't understand the wording of this question.
Thanks
For an eight-bit integer x represented in two’s complement format, which of the following yields the value of 5x? Here, the overflow or underflow can be ignored in this multiplication.
a) Shift x to the left by 1 bit, then add the initial value of x to it.
b) Shift x to the left by 2 bits, then add the initial value of x to it.
c) Shift x to the right arithmetically by 1 bit, then subtract the initial value of x from it.
d) Shift x to the right arithmetically by 2 bits, then subtract the initial value of x from it.
So an eight bit integer would be something like (00011100)2 -> (+28)10
Two's complement format is negative base2 so it becomes (11100100)2 -> (-28)10
5x would be (+140)10 or (10001100)2.
I know how to perform <<, but I just don't understand the wording of this question.
Thanks
Last edited: