Calling all EE's!

blustori

Senior member
Mar 2, 2005
753
0
0
Hi I have a question. Lets say we have two numbers A and B with B being in compliment form. If I were to subtract A-B would I first have to take the compliment of B and then add or do I just subtract them directly? This is confusing. The notation is if you want to do A - B, then its the same as adding A + B with B being in compliment form.
 

Merlyn3D

Platinum Member
Sep 15, 2001
2,148
0
0
um....you know there's 1's compliment then there's 2's compliment, and please try explaining it clearer, no one understands what you're saying
 

blustori

Senior member
Mar 2, 2005
753
0
0
Here let me make an example although I'm pretty sure I understand now. Lets say A = unsigned 0101 and B = signed 1001 with B already in 1's compliment form. Now if I were to do B - A, based on the notation, I would have to take the compliment of B and add it to A (same thing as B - A). My question was do you subtract directly or do you take the compliment of B when it is already in its compliment form and then add? Based on my thoughts, I am now very sure you ignore that B was in 1's compliment form and take the compliment of it anyway. Feel free to prove me wrong.
 

crystal

Platinum Member
Nov 5, 1999
2,424
0
76
If I have to guess,

A - B = A + B

As for which compliment, you would have to convert B to B correctly.



P.S. Don't blame me if this is worng.