Difficulty: Medium
Correct Answer: 110001
Explanation:
Introduction / Context:
Binary subtraction is commonly performed by adding the two’s-complement of the subtrahend. This problem tests whether you can form the correct two’s-complement for a given decimal number using a fixed bit width and apply it to a subtraction example.
Given Data / Assumptions:
Concept / Approach:
To subtract B from A, compute A + (two’s-complement of B). The two’s-complement of B is formed by inverting all bits of B (with respect to the chosen width) and adding 1. Ensure the correct width to avoid sign or overflow mistakes.
Step-by-Step Solution:
Verification / Alternative check:
Decimal check: 43 − 15 = 28. Binary result 011100 is 28, confirming that 110001 was the correct two’s-complement to add.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
110001
Discussion & Comments