0

Need help on verifying my answer.

I was given a question which requires me to calculate output for following operations.

25;

S&M=00011001

1's Complement=11100110

2's Complement=11100111


-37;

S&M=10100110

1's Complement=11011001

2's Complement=11011010


-12;

S&M=10001100

1's Complement=11110011

2's Complement=11110100

So my questions and answers are provided below.

i)25+(-37)

Answer for 1's Complement="01000000"

Answer for 2's Complement="01000001"

ii)25+(-12)

Answer for 1's Complement="01011010"

Answer for 2's Complement="01011011"

Beta Tracks
  • 263
  • 2
  • 5
  • 14
  • 2
    What's your question? – Barmar Sep 11 '14 at 05:06
  • Positive numbers should be the same in SM, 1's complement, and 2's complement. Why do you have different values for `25`? – Barmar Sep 11 '14 at 05:07
  • I need help on verifying my answers as shown below. Owh, is it if it is a positive number,we would just use the binary number which is 00011001 for 25? – Beta Tracks Sep 11 '14 at 05:10
  • Because as the question was asking to calculate 1's & 2's complement. What i did was use the 1's complement of 25 and 1's complement of -37 – Beta Tracks Sep 11 '14 at 05:11
  • If so, the 1's complement output from the 25+(-37) is 11110010. Am I right? – Beta Tracks Sep 11 '14 at 05:13
  • Read the Wikipedia pages. 1's complement and 2's complement are different ways of representing negative numbers. With 1's complement you just invert all the bits from the corresponding positive number, with 2's complement you invert them and then add 1. – Barmar Sep 11 '14 at 05:13

0 Answers0