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

How do you subtract binary using two's complement method ie; 1111111-111=? without converting to our system and back?

2006-09-28 17:03:36 · 5 answers · asked by lipiggy425 1 in Science & Mathematics Mathematics

5 answers

just line them up like you would number in base 10 and subtract

1111111
0000111-
-----------
1111000

2006-09-28 17:11:42 · answer #1 · answered by Anonymous · 2 1

Answer number two (2) above is correct: arrange the numbers as you usually would for a subtraction problem and then subtract. I.e.

1111111
- 111
-----------
1111000

It only becomes a little "tricky" when you have to "borrow" from a higher column to subtract 1 from 0. E.g.

10
- 1
---
1

and

100
- 1
----
11

2006-09-29 00:22:10 · answer #2 · answered by language is a virus 6 · 0 1

Using two's complement, convert 0000111 to 1111000 (padding with 1's on the left), then add it to the original number.
Then add 1 to the result:

. 1111111 first number
+1111000 2's complement for 111
-------------
. 1110111 intermediate sum
+0000001 add 1
-------------
. 1111000 Result

Check:
127 - 7 = 120 (decimal)
1111000 (binary) = 120 (decimal)

2006-09-29 00:27:15 · answer #3 · answered by Tom-SJ 6 · 1 1

1111111
-0000111
________
1111000

2006-10-02 22:57:17 · answer #4 · answered by yupchagee 7 · 0 1

sorry

2006-09-29 00:11:18 · answer #5 · answered by Ashu 3 · 0 3

fedest.com, questions and answers