Maker Pro
Maker Pro

Signed Binary Number

vick5821

Jan 22, 2012
700
Joined
Jan 22, 2012
Messages
700
Hey there,

I am rather confused about the signed binary number.

For sign-magnitude form, why is this 11010101 is representing -85 ? I do not understand . How to get it ?

1's Complement form : Positive number is 1's complement form are represented the same way as the positive sign-magnitude numbers while negative numbers are the 1's complement of the corresponding positive numbers . I do not get the meaning of this and why is it so ?

Please help

Thank you
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Sign-Magnitude means:
MSB=sign: 0=positive, 1=negative
All other bits are an unsigned positive integer.
Thus in your example:
11010101 = 1 1010101 = - 85
01010101 = 0 1010101 = +85
because 1010101 = 85 and the MSB is the sign.

Harald
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Note though, that this form of binary notation is rarely (if ever) used.

Consider:

1) zero
2) mathematical operations (how do you handle the sign bit?)

It's ugly.

BUT, you need to understand this before you try 2's compliment notation
 

vick5821

Jan 22, 2012
700
Joined
Jan 22, 2012
Messages
700
vick5821;1454707 1's Complement form : Positive number is 1's complement form are represented the same way as the positive sign-magnitude numbers while negative numbers are the 1's complement of the corresponding positive numbers . I do not get the meaning of this and why is it so ? Please help Thank you[/QUOTE said:
How about for this ?

Thank you
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
1's compliment means change all the 0s to 1s and the 1s to 0s

so the 1's compliment of

1101101100 is
0010010011

This also neatly flips the sign bit (if we determine the MSB is the sign) so it seems really easy.

edit: it "is so" because that's what we say. It's a convention. The bits mean nothing on their own we assign meaning to them. This is one way of assigning meaning.

You need to consider abstraction. There is no reason why one voltage is called 0 and another 1, but once we determine it to be so then we can abstract the nature of a circuit into one that manipulates 1s and 0's.

Likewise there is no reason that any one particular 1 is more significant than any other, but we apply a convention that in groups they have an order and one end is the "most significant" end, and the other is the "least significant".

Once we've applied that abstraction and we can deal with groups of these 1's and 0's as an ordered set, we can assign numerical values to them. Using binary seems appropriate and now we have a means of abstracting numbers.

But with that level of abstraction, we have only a way of expressing +ve numbers, so we need a way of saying "that's negative". There are many ways of doing that, and the way you're looking at is 1's compliment. The convention (or additional level of abstraction) says that a positive number will have the MSB = 0 and the rest of the number interpreted as a positive binary number. A negative number will have all bits inverted. This means the MSB is 1 and to get the value of the number you then need to invert the remaining bits so you can calculate the positive binary value (which you then negate)

There's no "why" in any of this. It's all "because we deem it to be thus"

As long as we all use the same abstractions we can communicate. If I pick a low voltage as 0 and a high voltage as 1, I cannot communicate with you if you pick a high voltage as 1 and a low voltage as 0. But neither of us are wrong, we're just not abstracting things the same way. At a higher level of abstraction, there is the difference between big-endian and little-endian representation of 2 byte integers and major CPU manufacturers do it differently.
 
Last edited:
Top