Binary Addition - 2's Compliment Representation

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
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: 591
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   Reactions: 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   Reactions: Marcin H