Solving Binary Math Problems: Is it Correct?

  • Thread starter Thread starter naspek
  • Start date Start date
  • Tags Tags
    Binary
Click For Summary

Discussion Overview

The discussion revolves around solving binary math problems, specifically focusing on the interpretation of binary numbers in two's complement form. Participants explore how to add binary numbers, verify their results in decimal, and clarify misunderstandings related to two's complement representations.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant presents a solution to a binary addition problem and questions its correctness.
  • Several participants clarify that the problem requires interpreting binary numbers as two's complement rather than finding their two's complement.
  • There is confusion regarding the decimal representations of the binary numbers involved, particularly for 1001 and 0101.
  • Participants discuss the significance of the most significant bit (MSB) in determining the sign of the number in two's complement form.
  • One participant attempts to calculate the two's complement interpretations and expresses uncertainty about the results.
  • Another participant challenges the correctness of the interpretations provided, prompting further calculations and clarifications.
  • Participants engage in back-and-forth discussions to refine their understanding of the binary addition and its decimal verification.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the correct interpretations of the binary numbers at first, leading to multiple competing views. However, as the discussion progresses, some participants begin to align on the correct interpretations and calculations.

Contextual Notes

Some calculations and interpretations remain unresolved, particularly regarding the initial interpretations of 1001 and 1110 in two's complement form. There is also a dependency on participants' understanding of binary addition and decimal conversion processes.

Who May Find This Useful

Students or individuals studying binary arithmetic, two's complement representation, or those needing clarification on binary addition and its verification in decimal form may find this discussion beneficial.

naspek
Messages
176
Reaction score
0

Homework Statement


http://img593.imageshack.us/img593/3376/76384308.jpg


The Attempt at a Solution


i've got no problem with question a)
but..

i've got couple of question in question b)

my solution is.. 0111 + 1011 = 1 0010
is it correct?

how am i going to verify it in decimal..?
is it -1 + 5 = 4 ?
 
Last edited by a moderator:
Physics news on Phys.org
You're misinterpreting the problem. It's not asking you to find the two's complement of the given numbers; it wants you to interpret them as representing numbers in two's complement form. So 1001 will correspond to some negative number (it's not -1) and 0101 to some positive number. When you add them, you'll get another number that you should again interpret as the two's complement representation of some number. The problem wants you to verify that you indeed get the right answer.
 
vela said:
You're misinterpreting the problem. It's not asking you to find the two's complement of the given numbers; it wants you to interpret them as representing numbers in two's complement form. So 1001 will correspond to some negative number (it's not -1) and 0101 to some positive number. When you add them, you'll get another number that you should again interpret as the two's complement representation of some number. The problem wants you to verify that you indeed get the right answer.

hurmm.. kinda blur.. thanks for ur clarification..
ok.. here what i should do..

add them up.. i got the same answer as part a)...
which is 1110..
should i apply 2's complement on that number (1110)?

if I'm going to verify it using decimal..
i still got the same answer as part a).. right? :confused:
 
naspek said:
hurmm.. kinda blur.. thanks for ur clarification..
ok.. here what i should do..

add them up.. i got the same answer as part a)...
which is 1110..
should i apply 2's complement on that number (1110)?
No, you're supposed to interpret that number as already being in twos' complement form. Since the high bit is 1, it's a negative number. What's the number?
naspek said:
if I'm going to verify it using decimal..
i still got the same answer as part a).. right? :confused:
 
1. What is the two's complement interpretation of 1001?
2. What is the two's complement interpretation of 0101?
3. What is the two's complement interpretation of their sum, 1110?

Note I'm not asking you to find the two's complement of any of these four-bit numbers. I'm asking you what decimal number do they represent when interpreted as a number in two's complement form.

You may find this Wiki article helpful:

http://en.wikipedia.org/wiki/Sign_and_magnitude#Two.27s_complement
 
vela said:
1. What is the two's complement interpretation of 1001?
2. What is the two's complement interpretation of 0101?
3. What is the two's complement interpretation of their sum, 1110?

Note I'm not asking you to find the two's complement of any of these four-bit numbers. I'm asking you what decimal number do they represent when interpreted as a number in two's complement form.

You may find this Wiki article helpful:

http://en.wikipedia.org/wiki/Sign_and_magnitude#Two.27s_complement

1. What is the two's complement interpretation of 1001?
is it 1001 represent -1 in decimal?

2. What is the two's complement interpretation of 0101?
is it 0101 represent +5 in decimal?

3. What is the two's complement interpretation of their sum, 1110?
is it 1110 represent -6?

but.. it seems not correct..
 
Mark44 said:
No, you're supposed to interpret that number as already being in twos' complement form. Since the high bit is 1, it's a negative number. What's the number?

so.. 1110 = -6?
 
Your answer for 1. is incorrect and thus your answer for 3. is also incorrect. Can you show your working for 1. 2. and 3. in converting the binary number to decimal?
 
Zryn said:
Your answer for 1. is incorrect and thus your answer for 3. is also incorrect. Can you show your working for 1. 2. and 3. in converting the binary number to decimal?

2^3 , 2^2, 2^1, 2^0

so.. in 2's complement number..
left most bit 1111 is the sign for the binary number given right?

so.. when 1001 will equal to.. -1 x (2^0) = -1
is it correct?
 
  • #10
Ahh, now I see.

Indeed the MSB (Most Significant Bit - the left most one) is the sign, however it still retains its value. For example:

1000 0000 = -1 * (2^7) = -128
1001 0001 = -1 * (2^7) + 1 * (2^4) + 1 * (2^0) = -128 + 16 + 1 = -111
1111 1111 = -1 * (2^7) + ... + 1 * (2^0) = -128 + ... + 1 = -1
 
  • #11
Zryn said:
Ahh, now I see.

Indeed the MSB (Most Significant Bit - the left most one) is the sign, however it still retains its value. For example:

1000 0000 = -1 * (2^7) = -128
1001 0001 = -1 * (2^7) + 1 * (2^4) + 1 * (2^0) = -128 + 16 + 1 = -111
1111 1111 = -1 * (2^7) + ... + 1 * (2^0) = -128 + ... + 1 = -1

fuuhhh~~ now i understand it.. Thanks Zryn!

ok.. so..

1. What is the two's complement interpretation of 1001?
1001 = -9

2. What is the two's complement interpretation of 0101?
0101 still equal to +5 as my answer before..

3. What is the two's complement interpretation of their sum, 1110?
1110 = -14..

but.. how come -9 + 5 = -14?
it should be -4 right?
 
  • #12
You're closer, but 1. is still wrong, and 3. is wrong for the same reason.

When does -9 + 5 = -14?

And no, it should not be -4 :)

*Hint: Write the equivalent decimal numbers for each bit when you add the signed MSB to the LSB of 1001, what decimal number does each one represent, and what do they sum to? Next, assuming your binary addition is correct and the result is in fact 1110, go through the equivalent decimal number for each bit and then add them together and post what you get (i.e. the format for my previous 3 examples for the 8- bit signed numbers, so each and every calculation is written out in full)
 
Last edited:
  • #13
Zryn said:
You're closer, but 1. is still wrong, and 3. is wrong for the same reason.

When does -9 + 5 = -14?

And no, it should not be -4 :)

ok2! i got it..!

1001 = [-1 x (2^3)] + [1 x (2^0)]
...= -7
correct?

so..
2nd question still correct..

3rd question...

1110 = [-1 * 2^3] + [1 * 2^2] + [1 * 2^1]
...= -8 + 4 + 2
...= -2
correct ?
 
  • #14
Yep, spot on!

It was just some wonky addition (-8 + 1 = -9) that was throwing you off.
 
  • #15
Zryn said:
Yep, spot on!

It was just some wonky addition (-8 + 1 = -9) that was throwing you off.

geez! thank u very much guys! =)
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 3 ·
Replies
3
Views
1K