English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

how to calculate two's complement of a decimal no. more than 2 digits. like -238.
binary equivalent of 238 is 11101110 but on finding 2's complement of -238 which comes out to be 00010010 should an extra 1 be added for the sign.
please can you help me in this problem.
actually i think this question should not come under this category but still can you help me?

2006-10-14 19:38:30 · 1 answers · asked by Anonymous in Education & Reference Homework Help

1 answers

You have to consider that 238 is a positive number, therefore the first digit is the sign. The number you have shown as 238 starts with a "1" and is a negative number. The signed binary equivalent of 238 is 011101110; the two's complement is 100010001 + 1 = 100010010, which is a negative number.

238 = 011101110
-238 = 100010010

Therefore the two's complement of -238 is one's complement of 100010010 plus 1 = 011101101 + 1 = 011101110

2006-10-14 20:36:45 · answer #1 · answered by gp4rts 7 · 0 0

fedest.com, questions and answers