In: Computer Science
Represent the following numbers in binary 8-bit representation using singed magnitude, one's complement, two's complement, and excess-127 representations:
a) 48
b) -35
a. 48:
Binary number for 48 = 0011 0000
in signed magnitude system MSB (Most Significant Bit) is reserved for sign. If MSB is 1, then the number is negative otherwise positive.
Hence 48 in signed magnitude is 0011 0000
48 in 1's compliment is like flipping the bits of binary number which is 1100 1111
48 in 2's compliment is adding 1 to 1's compliment which is 1101 0000
48 in excess-127 is adding 127(0111 1111) to the 48 (0011 0000) which is 1010 1111
b. -35
35 in binary is 0010 0011
in signed magnitude system MSB (Most Significant Bit) is reserved for sign. If MSB is 1, then the number is negative otherwise positive.
35 in binary is 0010 0011
Hence -35 in signed magnitude is 1010 0011
-35 in 1's compliment is like flipping the bits of binary number which is 1101 1100
-35 in 2's compliment is adding 1 to 1's compliment which is 1101 1101
-35 in excess-127 is adding 127(0111 1111) to the -35 (1101 1101) which is 0101 1100