Signed binary(1.4.1 c) Flashcards
Sign and magnitude
uses 0 to represent positive and 1 to represent negative
e.g -54 = 1011 0110
What does the leading bit in sign and magnitude represent?
the sign while the remaining bits represent the absolute sign
Sign and magnitude largest value
127 = 0111 1111
Sign and magnitude smallest value
-127 = 1111 1111
How many values are there in sign and magnitude?
254 values
Sign and magnitude oddities
1000 0000 and 0000 0000 both represent zero but one is negative and the other is positive
where some values are lost
Adding in sign and magnitude
doesn’t work properly
e.g -6 + 8 = -14
1000 0110 + 0000 1000 = 1000 1110
Twos complement
take the standard column value for a binary number and make the most significant bit negative
128 64 32 16 8 4 2 1
-128 64 32 16 8 4 2 1
Converting in twos complement
write the binary
flip the numbers
add 1
e.g. -27
27 = 0001 1011
flip = 1110 0100
add 1 = 0000 0001
-27 = 1110 0101
Which is used twos complement or sign and magnitude?
twos complement
easier to implement binary adding circuit