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

AI Thread Summary
The discussion revolves around a binary subtraction problem using the 2's complement method with an 8-bit register. The user attempted to subtract the binary number 00001000 from 00001101 but arrived at an incorrect result of 00000110. The correct approach involves finding the 2's complement of 00001000 and adding it to 00001101. The expected answer is 00000101, which highlights the importance of correctly applying the 2's complement method in binary subtraction. The clarification emphasizes the need to correctly compute the 2's complement before performing the addition.
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.
 
Back
Top