Difficulty: Easy
Correct Answer: 11110111
Explanation:
Introduction:
Converting a negative decimal integer to two’s-complement involves finding the binary of the positive magnitude, inverting all bits, and adding 1, constrained to the chosen word size. Here, we compute the 8-bit code for −9 and match it against the options provided.
Given Data / Assumptions:
Concept / Approach:
Two equivalent ways exist: (1) encode +9 into binary, invert and add 1; or (2) start from a candidate negative code and convert back to magnitude for confirmation. We will use method (1) to derive the correct 8-bit pattern.
Step-by-Step Solution:
Verification / Alternative check:
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
Discussion & Comments