ALU 101 Carry and Overflow 2 — Questions and Answers
Question 1: Overflow in signed binary arithmetic occurs when:
- The result is negative
- The result cannot be represented in the given number of bits (Correct answer)
- A carry-out is generated
- Both operands have the same sign
Correct answer: The result cannot be represented in the given number of bits
Overflow occurs when the arithmetic result exceeds the range representable by the assigned number of bits in signed arithmetic.
Question 2: What does the ALU's carry flag (C flag) indicate?
- A signed overflow
- An unsigned carry-out or borrow from the most significant bit (Correct answer)
- A zero result
- A parity error
Correct answer: An unsigned carry-out or borrow from the most significant bit
The carry flag is set when there is a carry-out (addition) or borrow (subtraction) from the most significant bit in unsigned operations.
Question 3: Can overflow and carry both be set at the same time in a single ALU addition?
- No, they are mutually exclusive
- Yes, they can occur independently (Correct answer)
- Only in floating-point units
- Only in subtraction
Correct answer: Yes, they can occur independently
Carry and overflow are independent flags: carry relates to unsigned results exceeding bit width, while overflow relates to signed result range violation.
Question 4: Adding two positive signed numbers yields a negative result. This is an example of:
- Carry propagation
- Unsigned overflow
- Signed overflow (Correct answer)
- Arithmetic underflow
Correct answer: Signed overflow
When adding two positive numbers produces a negative result in signed arithmetic, it is a signed overflow because the result exceeded the positive range.
Question 5: In 4-bit two's complement, what is the result of 0111 + 0001?
- 1000 with overflow (Correct answer)
- 0111 with carry
- 1000 with no overflow
- 1001 with overflow
Correct answer: 1000 with overflow
0111 + 0001 = 1000 in binary; in 4-bit two's complement, 1000 = −8, so adding 7+1 overflowed the positive range.
Question 6: What hardware mechanism detects signed overflow in an ALU adder?
- XOR of the MSB carry-in and carry-out (Correct answer)
- AND of all carry bits
- Parity check on the result
- Comparing operand signs with the result sign
Correct answer: XOR of the MSB carry-in and carry-out
Signed overflow is detected by XOR-ing the carry into the most significant bit with the carry out of the most significant bit.
Overflow in signed binary arithmetic occurs when: