Can someone explain 2s complement to me?
I need to know the 2s complement of the following 0 0000101 1101111000.
thanks
Printable View
Can someone explain 2s complement to me?
I need to know the 2s complement of the following 0 0000101 1101111000.
thanks
Hello, sjenkins!
Quote:
Can someone explain 2s complement to me?
I need to know the 2s complement of the following: 0 0000101 1101111000.
We need a lot more information . . . but I'll take a wild guess . . .
The "2s complement" is found by subtracting each digit from 2.
The 2-complement ofis
The 2-complement ofis
The 2-complement ofis
Yes, it is binary, I'm sorry I didn't say that in the original post. I thought I had but I guess not.
So, if a number is 1011011 the complement is 0100101 right?
But what if it ends in a 0 like 1011010, is the complement 0100100?
If we have a 8-bit representation of a number, for example 1001 0011. To find det complement you just flip the bits and add 1:
0110 1100 + 1 = 0110 1101.
Example: calculate 123 - 3 (8-bits representation)
123 = 0111 1011
3 = 0000 0011
Complement of 3: 1111 1100 + 1 = 1111 1101
Just add 123 with the complement of 3:
0111 1011 + 1111 1101 = 1 0111 1000
You see that we now have an overflow of 1 bit. We just remove the one bit to the left and get: 0111 1000 = 120
Hope this helps.