4)What will be the output when the computer performs arithmetic left shift operation on the bit pattern11010101 which is stored in two’s complement format?Verify that if you multiply the original number in decimal by 2 you get your final answer in decimal. Show your work?
Given input is 11010101 which is in 2's complement so take 2's complement of this input to get original input so scan input from right to left upto first 1 then change 0 to 1 and 1 to 0 so we get 00101011 which decimal equivalent 43.
Given input is 11010101 here as per instructions given we have to
perform arithmetic shift left for that shift all bit 1 position
left so we have empty space at LSB position put 0 at LSB so result
is 10101010 which is in 2's complement so take 2's complement of
this input to get original input so scan input from right to left
upto first 1 then change 0 to 1 and 1 to 0 so we get 01010110 which
decimal equivalent 86 which is multiply original number by 2 in
decimal.
Thus when we perform arithmetic shift left then it's result in
decimal is multiply the original number in decimal by 2.
If any point you have any doubt feel free ask me.
Get Answers For Free
Most questions answered within 1 hours.