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

I am working on some problems for one of my classes and I have to convert 2's complement binary to decimal and I am wondering if I did it right.
so the 2 complement binary is 0110, so I know it's a positive number because of the leading term. Then I inverted it, making it 1001 and add 1 getting 1010 and I get 10, but the prof.'s answer says it's 6, but I don't know why, and I don't know where I messed up, or if he did.
Thanks

2007-02-04 05:17:55 · 5 answers · asked by 123SP 1 in Science & Mathematics Engineering

5 answers

Basically your mistake is that you complemented the number (inverted it & added 1). This number is a positive number in the first place, so you shouldn't go through the complement process. You only do that for negative numbers.

For example suppose that your number was 1110. The MSB (the digit all the way to the left) is 1, so this is a negative number. Now knowing that it is negative, you complement it
(1110--->invert--->0001--->plus 1---->0010 = 2). So the number you're looking at is negative two ( -2).

2007-02-04 07:16:57 · answer #1 · answered by rezaf_2000 3 · 0 0

to convert into binary you divide by 2 into the number and the
remainder is the binary. As you probably know..

6/2=3 zero binary
3/2=1.5 one binary
1/2=.5 one binary
0/2=0 zero binary

so the 6 dec-->2 binary is equal to 0110

if you want -6 you invert the binary making it 1001 and add 1
gives you 1010. you do this procedure if you want the negative of the binary number.

2007-02-04 17:05:29 · answer #2 · answered by jon d 3 · 0 0

0110 Binary equals 6 decimal since the MSB (left most bit) is a zero.

1 - 1
2 - 10
3 - 11
4 - 100
5 - 101
6 - 110
7 - 111
8 - 1000
9 - 1001
10 - 1010
11 - 1011
12 - 1100
13 - 1101
14 - 1110
15 - 1111

2007-02-04 13:32:26 · answer #3 · answered by Anonymous · 0 0

0110 = 6
Are u sure u didn't misunderstand the question or the answer?

2007-02-04 13:27:54 · answer #4 · answered by chocolateknight69 3 · 0 0

www.mc.edu/campus/users/bennet/cs110/tc/tctod.html

2007-02-04 13:27:50 · answer #5 · answered by mjh3056 2 · 0 0

fedest.com, questions and answers