Logic circuits

When adding two's complement numbers, which condition indicates that an overflow has occurred?

  1. AWhen the carry into the most significant bit differs from the carry out of the most significant bit
  2. BWhen the result is 0
  3. CWhen the sum of the least significant bits is 1
Show answer and explanation

Answer: A. When the carry into the most significant bit differs from the carry out of the most significant bit

In two's complement addition, overflow occurs when adding two positive numbers gives a negative result or adding two negative numbers gives a positive result. This can be detected when the carry into the most significant bit differs from the carry out of it (their XOR is 1).

  • A. Correct. Overflow is when the carries into and out of the MSB differ.
  • B. A result of 0 does not indicate overflow.
  • C. The least significant bit is irrelevant to overflow detection.
Practice this topic Back to topic

More Logic circuits questions

  1. How many states does a Johnson (twisted-ring) counter made of n flip-flops go through?
  2. What is a typical use of a linear feedback shift register (LFSR), which feeds the XOR of some outputs of a shift register back to its input?
  3. When several open-drain outputs are connected to one signal line with a pull-up resistor, how does the line behave?
  4. When is the output of a two-input NAND gate 0?
  5. According to De Morgan's laws, which expression is equal to NOT(A AND B)?