Binary Addition - 2's Compliment Representation

In summary, to solve these binary arithmetic problems, you need to first add the unsigned numbers normally. For the second part, where the assumption is that the numbers are represented in 2's complement, you just add the numbers as usual, but keep in mind that a 1 in the highest bit represents a negative number. The range for unsigned 8-bit numbers is 0 to 255, while for signed 8-bit numbers it is -128 to 127.
  • #1
Marcin H
306
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: 501
Physics news on Phys.org
  • #2
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
  • #3
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

Related to Binary Addition - 2's Compliment Representation

What is binary addition and how is it different from regular addition?

Binary addition is a mathematical operation used in computer science to add two binary numbers together. Unlike regular addition, which is done using the base 10 system, binary addition uses the base 2 system. This means that there are only two possible digits, 0 and 1, and any number larger than one must be represented using multiple digits.

What is the 2's compliment representation in binary addition?

The 2's compliment representation is a method used to represent negative numbers in binary form. It involves taking the binary representation of a positive number and flipping all the bits (changing 0s to 1s and 1s to 0s), then adding 1 to the result. This allows for a simple and efficient way to perform subtraction in binary form.

How do you perform binary addition using the 2's compliment representation?

To perform binary addition using the 2's compliment representation, first convert both numbers to their binary form. Then, align the numbers so that the least significant digits are on the right. Add the digits together, starting from the right and moving left. If the sum of two digits is greater than 1, carry over a 1 to the next column. Finally, if the result is larger than the number of bits being used, discard the extra bit. This will give you the correct answer in binary form.

What are some common mistakes when performing binary addition using the 2's compliment representation?

One common mistake is forgetting to add 1 to the final result when using the 2's compliment representation. This can result in an incorrect answer. Another mistake is forgetting to carry over a 1 when the sum of two digits is greater than 1. It is important to carefully check each step of the addition to ensure accuracy.

How is binary addition used in computer science?

Binary addition is used in computer science to perform mathematical operations, such as addition and subtraction, on binary numbers. It is also used in data storage and transfer, as all data in computers is represented in binary form. Additionally, binary addition is used in computer programming to perform logical operations, such as AND, OR, and XOR, which are essential for creating complex algorithms and programs.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
2K
Back
Top