Binary Addition - 2's Compliment Representation

Click For Summary
The discussion focuses on the process of binary addition using 2's complement representation. It clarifies that if a binary number starts with a 1, it indicates a negative value in signed representation, but for unsigned numbers, the addition remains straightforward. Participants emphasize that all numbers should be treated as unsigned for the initial parts of the problems, and the addition method is the same regardless of whether the numbers are signed or unsigned. The key takeaway is that the addition of unsigned and 2's complement numbers yields the same result, differing only in how overflow is detected. Understanding these distinctions is crucial for correctly solving binary arithmetic problems.
Marcin H
Messages
306
Reaction score
6

Homework Statement


Screen Shot 2016-09-06 at 7.27.10 PM.png


Homework Equations


Binary Arithmetic

The Attempt at a Solution


Is this the right way to do these problems? If I see a binary 1 at the beginning of the binary number do I just do the 2's compliment of that and add them? I am not too sure what it means by assume numbers are represented in 2's compliment. How do I add them exactly?

New Doc 22_1 (1).jpg
 

Attachments

  • New Doc 22_1.jpg
    New Doc 22_1.jpg
    17.6 KB · Views: 566
Physics news on Phys.org
Marcin H said:

Homework Statement


View attachment 105541

Homework Equations


Binary Arithmetic

The Attempt at a Solution


Is this the right way to do these problems?
You did the 2nd part of problem 1. You still need to do the first part of this problem, and both parts of the other four problems.

Marcin H said:
If I see a binary 1 at the beginning of the binary number do I just do the 2's compliment of that and add them? I am not too sure what it means by assume numbers are represented in 2's compliment. How do I add them exactly?
For the 1st parts of the five problems, the assumption is that they are all unsigned numbers, so you would add them as you normally would binary numbers. As an aside, 8-bit unsigned numbers have a range of 0 through 255 in base 10. Signed 8-bit numbers have a range of -128 through 127, base 10.

For the 2nd parts, the assumption is that they are unsigned numbers. A number with a 1 in the highest bit represents a negative number. If the highest bit is 0, the number is positive or maybe zero.
Marcin H said:
 
  • Like
Likes Marcin H
Marcin H said:
If I see a binary 1 at the beginning of the binary number do I just do the 2's compliment of that and add them?
You just add the numbers. The actual addition of unsigned and 2's complement numbers produces the same result, with the only difference in the detection of a carry for unsigned numbers or overflow for signed numbers.
 
  • Like
Likes Marcin H

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
2K
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K