Question

In: Computer Science

Write -127 as 8 bit signed binary number both using 2'complement and sign/magnitude notation.

Write -127 as 8 bit signed binary number both using 2'complement and sign/magnitude notation.

Solutions

Expert Solution

1)
-127
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Divide 127 successively by 2 until the quotient is 0
   > 127/2 = 63, remainder is 1
   > 63/2 = 31, remainder is 1
   > 31/2 = 15, remainder is 1
   > 15/2 = 7, remainder is 1
   > 7/2 = 3, remainder is 1
   > 3/2 = 1, remainder is 1
   > 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 1111111
So, 127 of decimal is 1111111 in binary
So, 127 in normal binary is 01111111
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   01111111 is flipped to 10000000
Step 3:. Add 1 to above result
10000000 + 1 = 10000001
so, -127 in 2's complement binary is 10000001
Answer: 10000001

2)
-127
-------
This is negative. so, follow these steps to convert this to various binary formats.
Divide 127 successively by 2 until the quotient is 0
   > 127/2 = 63, remainder is 1
   > 63/2 = 31, remainder is 1
   > 31/2 = 15, remainder is 1
   > 15/2 = 7, remainder is 1
   > 7/2 = 3, remainder is 1
   > 3/2 = 1, remainder is 1
   > 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 1111111
So, 127 of decimal is 1111111 in binary
So, 127 in normal binary format is 01111111
sign-magnitude:
-----------------
set 1 as left most bit, since this number is negative.
so, 01111111 becomes 11111111
Answer: 11111111



Related Solutions

convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain...
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain all the steps and details.
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain...
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain all the steps and details.
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain...
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain all the steps and details.
convert -97 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain...
convert -97 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127. Please be careful and explain all the steps and details.
Show the decimal integer 79 in 8-bit sign magnitude, one's complement, two's complement and excess-127 respectively...
Show the decimal integer 79 in 8-bit sign magnitude, one's complement, two's complement and excess-127 respectively in the given order, separated by comma.
Show the decimal integer -126 in 8-bit sign magnitude, one's complement, two's complement and excess-127 respectively...
Show the decimal integer -126 in 8-bit sign magnitude, one's complement, two's complement and excess-127 respectively in the given order, separated by comma.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT