MHB Addition involving eight-bit 2's complement numbers and indicating overflow.

  • Thread starter Thread starter shamieh
  • Start date Start date
  • Tags Tags
    Addition Numbers
Click For Summary
The discussion centers on performing arithmetic operations with eight-bit 2's complement numbers, specifically the addition of two binary numbers: 00110110 and 01000101. The result of the addition is 01111011, which is confirmed to be correct. However, the explanation regarding overflow is clarified; while the sum does not result in overflow, the reasoning provided is inaccurate. Overflow occurs when the result exceeds the maximum representable value in 2's complement, which can happen when adding two positive numbers that exceed the limit. The key takeaway is that while the sum is correct and there is no overflow in this case, the rationale for determining overflow needs to be accurately understood.
shamieh
Messages
538
Reaction score
0
Perform the following operations involving eight bit 2's complement numbers and indicate whether arithmetic overflow occurs.

1.
00110110 + 01000101 = 01111011 Overflow: there is none because we are adding to positive numbers.

Did I do this correctly?
 
Technology news on Phys.org
The sum is correct, and there is indeed no overflow, but not because you are adding two positive numbers. When you add 1 to 01111111, there is an overflow.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 17 ·
Replies
17
Views
2K
Replies
1
Views
2K
Replies
3
Views
12K
  • · Replies 2 ·
Replies
2
Views
9K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K