Binary subtraction question using 2's complement method and an 8 BIT

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
xod_s
Messages
8
Reaction score
0

Homework Statement



00001101 bin
* 00001000 bin
-----------------------------------

Homework Equations



It's a binary subtraction question using 2's complement method and an 8 BIT register.There's no equation than,I guess.

The Attempt at a Solution



11111111 <--1's "carried over"
00001101 bin
* 00001000 bin
-----------------------------------
11111111
1111101
+ 1
--------------------------------------
110
000000000 +
------------------------------------
11111111
00000110
+ 00001101
--------------------------------------
11111001

00000110 <----inversion of previous numberI did all this but on my answer sheet it says that the answer is 00000101.Why is this?.
 
Physics news on Phys.org
xod_s said:

Homework Statement



00001101 bin
* 00001000 bin
-----------------------------------


Homework Equations



It's a binary subtraction question using 2's complement method and an 8 BIT register.There's no equation than,I guess.

The Attempt at a Solution



11111111 <--1's "carried over"
00001101 bin
* 00001000 bin
-----------------------------------
11111111
1111101
+ 1
--------------------------------------
110
000000000 +
------------------------------------
11111111
00000110
+ 00001101
--------------------------------------
11111001

00000110 <----inversion of previous number


I did all this but on my answer sheet it says that the answer is 00000101.Why is this?.
It's not clear to me what you're doing here. When you want to calculate A-B, you find the two's complement of B and then add it to A. In this problem, that means you want to find the two's complement of 00001000, and then add that to 00001101.