Subtracting unsigned binary numbers using two methods

AI Thread Summary
The discussion focuses on subtracting unsigned binary numbers using two methods: binary subtraction and 2's complement. The initial attempt at binary subtraction yielded an incorrect result, prompting a review of the 2's complement method. It was clarified that the 8-bit representation of -0000 1011 should be 1111 0101, not 0000 0101. The correct addition of 1111 0101 and 0001 0101 in 8-bit arithmetic results in 0000 1010. The thread emphasizes the importance of maintaining proper bit representation in binary operations.
Fatima Hasan
Messages
315
Reaction score
14

Homework Statement


Using 8 bit representation , subtract the unsigned binary numbers shown by each of the following methods ;
101012 - 10112
1) Binary subtraction
2) 2's complement

Homework Equations


-

The Attempt at a Solution


Using binary subtraction :
101012 - 10112 = 0000 10102
Using 2's complement :
101012 + ( - 10112 )
10112 → 1's complement = 01002
01002 +1 = 01012
101012 + 1012 = 0001 10102

I didn't get the same answer , can anyone tell me where is my mistake ?
 
Physics news on Phys.org
Fatima Hasan said:
Using 8 bit representation...

Your 8-bit 2's complement representation of -0000 1011 should have 8 bits. That representation is NOT 0000 0101.
 
RPinPA said:
Your 8-bit 2's complement representation of -0000 1011 should have 8 bits. That representation is NOT 0000 0101.
0000 1011 → 1's complement = 1111 0100
2's complement = 1111 0100 + 1 = 1111 01012
 
So this is what you had:
Fatima Hasan said:
##10101_2 + 0101_2##

OK, so now you know that second number should be 1111 0101. And your first number is 0001 0101.

What happens when you add 1111 0101 and 0001 0101 in 8-bit arithmetic?
 
RPinPA said:
OK, so now you know that second number should be 1111 0101. And your first number is 0001 0101.

What happens when you add 1111 0101 and 0001 0101 in 8-bit arithmetic?
11111 0101 + 0001 0101 = 1 0000 1010 = 0000 10102
 
Back
Top