2's complement

Thread Starter

jstrike21

Joined Sep 24, 2009
104
I am supposed to find the decimal equivalent of 101110 in sign and magnitude, 1's complement, and 2's complement.

A.) Sign and magnitude
I have it as -(8+4+2)=-14
B.)1's compliment
it starts with a one so it is negative then I flip the digits so:
negative of 10001
=-(16+1)
=-17
C.)2's complement
Add 1 to the absolute value of the 1s complement then make it negative so:
=-18

Can I get some verification on this?
 
Last edited:

paone

Joined Dec 12, 2009
2
your number is 101110(-12)
for signed magnitude conversion in 1's and 2's comp first assume it as +12 =001110
then for 1's comp you have to change 1's to 0's and 0's to 1's including the sign bit.
therfore -12 in signed 1's comp equals to 110001
and -12 in 2's comp add 1 in lsb to 1's comp
-12=110011
decimal equivalent is easy you know.
 

Thread Starter

jstrike21

Joined Sep 24, 2009
104
for sign magnitude why isn't it:
101110
the first 1 means negative, then after that you are left with the 5bit number 01110 which is equal to 14, then put them together to get -14?
 

AlexR

Joined Jan 16, 2008
732
jstrike21:
You are indeed correct, one's compliment of a number is simply the bit-wise not of the number so 101110 becomes -010001 = -17

Two's complement is the bit-wise not plus 1 so 101110 becomes 010001 + 000001 = 010010 = -18

The number is however -14 in the "signed bit and magnitude" representation system where the msb is solely used to signify the sign of the number.
 
Last edited:
Top