Subtracting unsigned binary numbers using two methods

In summary, when subtracting unsigned binary numbers using 8-bit representation, there are two methods that can be used: binary subtraction and 2's complement. In binary subtraction, the numbers are subtracted digit by digit, with any necessary borrow or carry operations. In 2's complement, the second number is converted to its 2's complement form (by finding its 1's complement and adding 1), and then added to the first number. The resulting sum will be the correct subtraction result. However, when converting to 2's complement, it is important to use the correct number of bits for the representation, as this can affect the result.
  • #1
Fatima Hasan
319
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
  • #2
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.
 
  • #3
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
 
  • #4
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?
 
  • #5
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
 

FAQ: Subtracting unsigned binary numbers using two methods

1. How do you subtract unsigned binary numbers using the traditional method?

In the traditional method of subtracting unsigned binary numbers, you start by aligning the numbers vertically, with the larger number on top and the smaller number on the bottom. Then, you subtract each column starting from the right, just like in traditional arithmetic. If the result is negative, you borrow 1 from the next column to the left and add 2 to the current column. Finally, write the result below the column and continue until all columns have been subtracted.

2. What is the benefit of using the traditional method to subtract binary numbers?

The traditional method is beneficial because it closely resembles the process of subtracting numbers in traditional arithmetic. This makes it easier for individuals to understand and apply the concept of subtracting binary numbers, especially for beginners.

3. What is the alternative method for subtracting unsigned binary numbers?

The alternative method for subtracting unsigned binary numbers is the one's complement method. This method involves finding the one's complement of the subtrahend (the number being subtracted) and adding it to the minuend (the number being subtracted from). The one's complement of a binary number can be found by flipping all the bits (changing 0s to 1s and 1s to 0s). The result of the addition will be the same as subtracting using the traditional method.

4. Can you explain the concept of borrowing in binary subtraction?

In binary subtraction, borrowing occurs when the minuend (the number being subtracted from) is smaller than the subtrahend (the number being subtracted). This means that there is not enough to subtract from the current column, so you need to borrow 1 from the next column to the left. This is equivalent to adding 2 to the current column in binary, which allows you to continue the subtraction process. Borrowing is necessary to ensure that the result is accurate and follows the rules of binary subtraction.

5. Is there a limit to the number of columns in binary subtraction?

There is no limit to the number of columns in binary subtraction. However, it is important to ensure that the numbers being subtracted have the same number of digits to avoid any errors. If one number has more digits than the other, you can add leading zeros to make them equal in length before subtracting. Additionally, you may need to continue borrowing from columns to the left if the numbers being subtracted are very large, but there is no limit to this process.

Similar threads

Replies
2
Views
2K
Replies
5
Views
1K
Replies
2
Views
2K
Replies
1
Views
2K
Replies
3
Views
1K
Replies
8
Views
2K
Replies
1
Views
2K
Back
Top