• :00Days
  • :00Hours
  • :00Mins
  • 00Seconds
A new era for learning is coming soonSign up for free
Log In Start studying!

Select your language

Suggested languages for you:
Answers without the blur. Sign up and see all textbooks for free! Illustration

Q37E

Expert-verified
Discrete Mathematics and its Applications
Found in: Page 256
Discrete Mathematics and its Applications

Discrete Mathematics and its Applications

Book edition 7th
Author(s) Kenneth H. Rosen
Pages 808 pages
ISBN 9780073383095

Answers without the blur.

Just sign up for free and you're in.

Illustration

Short Answer

37. How is the one’s complement representation of the sum of two integers obtained from the one’s complement representations of these integers?

The answer is almost, but not quite, that to obtain the one’s complement representation of the sum of two numbers, we simply add the two strings representing these numbers using Algorithm 3. Instead, after performing this operation, there may be a carry out of the left-most column; in such a case, we then add 1 more to the answer.

See the step by step solution

Step by Step Solution

Step 1: We must assume that the sum actually represents a number in the appropriate range.

Assume that n bits are being used, so that numbers strictly between -2n-1 and 2n-1 can be represented. The answer is almost, but not quite, that to obtain the one’s complement representation of the sum of two numbers, we simply add the two strings representing these numbers using Algorithm 3. Instead, after performing this operation, there may be a carry out of the left-most column; in such a case, we then add 1 more to the answer. For example, suppose that n=4; then numbers from -7 to 7 can be represented. To add -5 and 3, we add role="math" localid="1668507124663" 1010 and 0011,obtaining 1101 ; there was no carry out of the left-most column. Since1101 is the one’s complement representation of -2, we have the correct answer. On the other hand, to add -4 and -3, we add 1011 and 1100, obtaining 1 .The 1 0111 that was carried out of the left-most column is instead added to 0111, yielding 1000,which is the one’s complement representation of-7. A proof that this method works entails considering the various cases determined by the signs and magnitudes of the addends.

Recommended explanations on Math Textbooks

94% of StudySmarter users get better grades.

Sign up for free
94% of StudySmarter users get better grades.