Binary adding/subtracting, am i doing this right?

  • Thread starter Thread starter mr_coffee
  • Start date Start date
  • Tags Tags
    Binary
Click For Summary
SUMMARY

The discussion focuses on performing binary subtraction using the two's complement method. The user correctly identifies the two's complement of the subtrahend (1111) as 0001, leading to the addition of 10110 and 0001, resulting in 10111. However, the user mistakenly believes that the final answer should be in 4 bits, while the correct interpretation retains the leading zero, yielding 0111. Additionally, the user queries the result of subtracting 101000 from 101, which leads to confusion over the output from a binary calculator.

PREREQUISITES
  • Understanding of binary number representation
  • Knowledge of two's complement method for binary subtraction
  • Familiarity with binary addition rules
  • Experience using binary calculators or conversion tools
NEXT STEPS
  • Study the two's complement method in detail
  • Practice binary addition and subtraction with various bit lengths
  • Explore binary calculators and their functionalities
  • Learn about overflow in binary arithmetic
USEFUL FOR

Students preparing for exams in computer science, individuals learning binary arithmetic, and anyone interested in digital logic design.

mr_coffee
Messages
1,613
Reaction score
1
Hello everyone, I'm alittle confused, we have an exam tomarrow and i want to make sure I'm doing this right. I'm suppose to do the following:
Perform the indicated subtraction with the following unsigned binary numbers by taking the 2's compliment of the subtrahend.
so for one of them:
10110 - 1111
I take the 2's compliment of 1111 which is:
1's compliment: 0000
2's compliment: 0000 + 1 = 0001
now i add 0001 to 10110
10110
+0001
=
10111

now since I'm only adding a 4 bit number to a 5 bit number my final answer will only still be in 4 bits right? so it would be
0111 as the final answer right?
I used a binary calculator and it said the answer is 111, but i think it just wasn't programmed to included the 0 infront.
 
Physics news on Phys.org
Also what would
101 - 101000 equal? the calculaotr came out with a huge number:
1111111111111111111111111111111111111111111111111111111111011101when i take the 2's compliment of 101000 and add it to 101 i get: 011101
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
8K
  • · Replies 2 ·
Replies
2
Views
13K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
3
Views
4K