Difficulty: Easy
Correct Answer: Incorrect
Explanation:
Introduction / Context:Signed arithmetic in digital systems is typically implemented with 2's complement representation. Correct results require consistent bit width so that sign bits align and carries/borrows propagate properly.
Given Data / Assumptions:
Concept / Approach:When widths differ, you must sign-extend the smaller operand to the larger width, duplicating its sign bit into higher positions. Arithmetic is then performed at a single, common width. Saying “not necessary to have the same number of bits” is misleading; operations take place at one width after proper extension.
Step-by-Step Solution:
Identify operand widths n and m (assume n < m).Sign-extend the n-bit operand to m bits by repeating its MSB.Perform addition/subtraction at m bits.Evaluate overflow using sign-bit rules at width m.Verification / Alternative check:HDL synthesis and ISA specifications (e.g., sign-extension on load/extend instructions) formalize this requirement for correctness and overflow semantics.
Why Other Options Are Wrong:
Common Pitfalls:Zero-extending negative numbers (wrong) or ignoring width differences, causing sign errors and incorrect overflow flags.
Final Answer:Incorrect
Discussion & Comments