Adding Binary #s, (Sign and Magnitute Addition)

In summary, the conversation involves someone asking for help with understanding 8-bit 2's complement numbers and how to perform operations on them. They are specifically confused about how to handle "carry-outs" when adding numbers. The conversation also mentions checking for arithmetic overflow and converting to decimal sign and magnitude representation.
  • #1
shamieh
539
0
Can someone explain to me step by step what's going on here? The book acts like a 3rd grader should be able to just look at the model and be able to decipher what's going on, but this is very confusing material.

Perform the following operations involving eight-bit 2's complement numbers and indicate whether arithmetic overflow occurs. Check your answers by converting to decimal sign and magnitude representation.

a) 00110110
+ 01000101
_____________

How do I solve this? I know that these are both positive because they start with 0.

I also know that;
0 + 0 = 00
0 + 1 = 01
1 + 0 = 01
1 + 1 = 10

so I know how to add those together BUT I don't understand how to add the "carry-outs" like if I have:

01
+01
____

would I say

1 + 1 = 0 , carry the 1. Then say 0 + 0 = 00 + 1 = ? 001? I'm just confused on how we evaluate the numbers with the carry outs for this particular problem. Also, suppose I have an eight bit number and one is unsigned or -? (Starts with a 1). How will the solving process then change? I can't find any good examples on google, and my book is disorganized and all over the place with terrible examples that don't clarify anything, or show any steps. If anyone can point me in the direction of a good explanation or can explain that would be great.
 
Technology news on Phys.org
  • #2
shamieh said:
Can someone explain to me step by step what's going on here? The book acts like a 3rd grader should be able to just look at the model and be able to decipher what's going on, but this is very confusing material.

Perform the following operations involving eight-bit 2's complement numbers and indicate whether arithmetic overflow occurs. Check your answers by converting to decimal sign and magnitude representation.

a) 00110110
+ 01000101
_____________

How do I solve this? I know that these are both positive because they start with 0.

I also know that;
0 + 0 = 00
0 + 1 = 01
1 + 0 = 01
1 + 1 = 10

so I know how to add those together BUT I don't understand how to add the "carry-outs" like if I have:

01
+01
____

would I say

1 + 1 = 0 , carry the 1. Then say 0 + 0 = 00 + 1 = ? 001?

Close. Let me show you.
1+1=0, carry the 1.
0+0+1=1, no carry.

Code:
 01
+01
____
 10

a) 00110110
+ 01000101
_____________

0+1=1, no carry
1+0=1, no carry
1+1=1, carry 1
0+0+1=1, no carry

Code:
a)  00110110
  + 01000101
_____________
   ...1111

Perhaps you can finish it?
 

FAQ: Adding Binary #s, (Sign and Magnitute Addition)

What is the basic process for adding binary numbers in Sign and Magnitude format?

The basic process for adding binary numbers in Sign and Magnitude format is as follows:

1. Start by writing the two binary numbers one below the other, making sure to line up the decimal points.

2. Add the numbers in the far right column. If the sum is 0 or 1, write it down. If the sum is 2 or 3, write down 0 and carry 1 to the next column.

3. Repeat this process for each column, adding any carried 1s from the previous column.

4. If there is a 1 in the leftmost column, this indicates a negative number. Convert the remaining digits to their opposite values (0 becomes 1, 1 becomes 0) to find the magnitude. The final answer will be negative, represented by a negative sign in front of the magnitude.

What is the purpose of using Sign and Magnitude format for binary numbers?

Sign and Magnitude format is used for binary numbers in order to represent both positive and negative values. The first bit (leftmost) represents the sign, with 0 indicating a positive number and 1 indicating a negative number. The remaining bits represent the magnitude of the number.

How do you handle overflow when adding binary numbers in Sign and Magnitude format?

Overflow occurs when the result of adding two binary numbers in Sign and Magnitude format is too large to be represented with the given number of bits. To handle overflow, simply discard the leftmost bit and use the remaining bits as the final answer.

Can you add a binary number in Sign and Magnitude format to a binary number in Two's Complement format?

No, you cannot add a binary number in Sign and Magnitude format to a binary number in Two's Complement format. The two formats use different methods for representing negative numbers and therefore cannot be added together.

What are the limitations of using Sign and Magnitude format for binary numbers?

One limitation of using Sign and Magnitude format is that it can be confusing to work with, as the same number can have multiple representations (e.g. 0000 and 1000 both represent 0). Additionally, it is not efficient for performing arithmetic operations, as extra steps are required to determine the sign and magnitude of the final answer. Therefore, other formats such as Two's Complement are often preferred for practical use.

Similar threads

Replies
3
Views
1K
Replies
1
Views
873
Replies
17
Views
1K
Replies
1
Views
4K
Replies
17
Views
5K
Replies
2
Views
963
Back
Top