Adding binary numbers (overflow)

  • Thread starter Thread starter leonne
  • Start date Start date
  • Tags Tags
    Binary Numbers
Click For Summary
SUMMARY

The discussion focuses on the concept of overflow in binary addition, specifically when adding the binary numbers 1101 and 1010. The correct result of this addition is 0111, which equals 7 in decimal, due to the overflow that occurs when the sum exceeds the four-bit limit of a register. Overflow occurs when the leftmost digit is dropped, leading to an incorrect representation of the sum. The confusion arises from different examples where overflow is not explicitly mentioned, highlighting the importance of understanding the limitations of binary representation in computing.

PREREQUISITES
  • Understanding of binary number representation
  • Familiarity with binary addition techniques
  • Knowledge of computer registers and their limitations
  • Basic concepts of overflow in arithmetic operations
NEXT STEPS
  • Study the concept of binary addition and its rules
  • Learn about overflow in binary arithmetic and its implications
  • Explore how different data types in programming languages handle overflow
  • Investigate the behavior of binary operations in various computer architectures
USEFUL FOR

Students learning computer science, software developers working with low-level programming, and anyone interested in understanding binary arithmetic and overflow in digital systems.

leonne
Messages
163
Reaction score
0

Homework Statement


Hey, i don't really understand what they mean when its overflow when u add or subtract binary numbers like
1101
+
1010



Homework Equations





The Attempt at a Solution


I thought the answer is 10111 but they get +7 I know the+ is cause of the 1 in front but don't know why the answer is 7 and not 10111

I was thinking that the answer has more digits than the original but it seems not true from other examples
thanks
 
Physics news on Phys.org
The assumption here is that you only have four digits to contain the answer, like in a register on a computer. It can't hold 10111. Something has to go. The adder you are talking about will apparently just drop the leftmost fifth digit 1. That's called overflow. So the register will contain the incorrect answer 0111=7. Overflow isn't a good thing.
 
hey um i kind of thought of that, but why is 1110+1010 =11000 not overflow? or is it? In the book example for adding it shows this but says nothing about overflow and why is 0101+0110=1011 a overflow? Is it because there is a 0 in the beginning so you would only count 3 digits?
thanks
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K