Skip to main content
Logo image

Dive Into Systems: Exercises

Section 4.4 Binary Integer Arithmetic

Checkpoint 4.4.1. Binary Addition.

    True or False: The process for adding binary numbers will differ based on whether the binary numbers represent a signed or unsigned number.
  • False
  • Correct!
  • True
  • Incorrect.

Checkpoint 4.4.2. Carryout.

Given the following additions of 4-bit binary numbers, where only the first bit in each number is specified and the others are unspecified (i.e., shown as ? instead of 0 or 1).

(a)

    What will be the carry out of the overall addition of the two binary numbers: 0??? + 0???
  • 0
  • Correct!
  • 1
  • Incorrect.
  • Could be 0 or 1
  • Incorrect.

(b)

    What will be the carry out of the overall addition of the two binary numbers: 0??? + 1???
  • Could be 0 or 1
  • Correct!
  • 1
  • Incorrect.
  • 0
  • Incorrect.

(c)

    What will be the carry out of the overall addition of the two binary numbers: 1??? + 1???
  • 1
  • Correct!
  • 0
  • Incorrect.
  • Could be 0 or 1
  • Incorrect.

Checkpoint 4.4.3. Carry Out.

    Which of the following best describes what happens when the overall carry out of N-bit binary addition is a 1?
  • The 1 value is discarded from the result.
  • Correct!
  • The number of bits used to store the result increases by 1, allowing the 1 value to be stored with the result.
  • Incorrect.
  • The number of bits used to store the result is doubled, where the 1 value is stored with the second n-bit part of the result, and its higher-order bits are set to 0 (e.g. 0001).
  • Incorrect.
  • None of the above.
  • Incorrect.

Checkpoint 4.4.4. Binary Subtraction.

(a)

    Which of the following best describes how binary subtraction works for unsigned operands? Assume the desired operation is X - Y?
  • The bits of Y are flipped, one is added, and the result is added to X.
  • Correct!
  • The bits of X are flipped, and the result is added to Y.
  • Incorrect.
  • The bits of Y are flipped, and the result is added to X.
  • Incorrect.
  • The bits of X are flipped, one is added, and the result is added to Y.
  • Incorrect.

(b)

    Which of the following best describes how binary subtraction works for signed (two’s complement) operands? Assume the desired operation is X - Y?
  • The bits of Y are flipped, one is added, and the result is added to X.
  • Correct!
  • The bits of X are flipped, and the result is added to Y.
  • Incorrect.
  • The bits of Y are flipped, and the result is added to X.
  • Incorrect.
  • The bits of X are flipped, one is added, and the result is added to Y.
  • Incorrect.

Checkpoint 4.4.5. Addition in 2’s Complement.

What is the binary result of the following addition operation: 1001 + 0101
Enter in binary:
What is the decimal result of this result?
If it is interpreted as a signed number:
If it is interpreted as an unsigned number:

Checkpoint 4.4.6. Addition in 2’s Complement.

What is the binary result of the following addition operation: 0011 + 0101
Enter in binary:
What is the decimal result of this result?
If it is interpreted as a signed number:
If it is interpreted as an unsigned number:

Checkpoint 4.4.7. Subtraction in 2’s Complement.

For each of the following statements, select whether they are True or False.

(a)

    Subtraction can be performed with a combination of negation and addition: a - b = a + (-b).
  • True
  • Correct!
  • False
  • Incorrect.

(b)

    Subtracting a negative number from a negative number uses the same procedure as subtracting a positive number from a negative number.
  • True
  • Correct!
  • False
  • Incorrect.

(c)

    Subtracting unsigned numbers uses the same procedure as subtracting two’s complement numbers.
  • True
  • Correct!
  • False
  • Incorrect.

Checkpoint 4.4.8. Subtraction in 2’s Complement.

What is the binary result of the following subtraction operation: 1001 - 0101
Enter in binary:
What is the decimal result of this result?
If it is interpreted as a signed number:
If it is interpreted as an unsigned number:

Checkpoint 4.4.9. Subtraction in 2’s Complement.

What is the binary result of the following subtraction operation: 1001 - 0101
Enter in binary:
What is the decimal result of this result?
If it is interpreted as a signed number:
If it is interpreted as an unsigned number: