jaus tail said:
... But this is horrible. In exam I'd get stuck somewhere. There is so much to remember.
Yeah, I know how you feel. If you do it a lot, it will become easy like common arithmetic. But I don't. I'm no good at maths, so I just remember how the numbers work and use column values.
So for 8 bits, MSB is worth -128 and the other 7 bits, +64,+32 ..., +1. (Then you could just do the arith in denary if you like!)
But to think of the binary; say you had -108 for eg. That would be -128 +16 +4 or 1001 0100
Now if you want that divided by 2 (to get -54) you could have that as -64 +8 +2 because that is half of all the column values.
But in 8bit 2's comp only the MSB is negative. So we replace that -64 with -128 +64 and our result is then -128 +64 +8 +2 or 1100 1010
What you've done is to simply shift the 2's comp right 1 bit, as you might expect for div by 2, but keep the MSB at 1
Any time you have a 2's comp negative number, MSB is 1 and Rshift moves it to be half the value but positive instead of negative. So long as the MSB is replaced with another 1, the total of these two becomes half the MSB value but negative.
If the 2's comp is a positive number, MSB is 0 and R shifting it means it is still 0. If we keep the MSB as 0, then nothing has changed here, but all the positive values have moved down 1 bit and are half their value as required.
Once you've got your correct result, by whatever means, you can see how the bits move. Then it's easy to decide which shift operations do the job.
Remember they've mentioned the carry bit (which is often ignored), so that probably gets used here.