Difficulty: Easy
Correct Answer: 00110010
Explanation:
Introduction / Context:
Moving between decimal arithmetic and fixed-width binary encodings is a common task in programming and embedded systems. This exercise reinforces how to add decimal numbers and then correctly encode the result as an 8-bit binary value, taking care with leading zeros for fixed-width formats used in registers and memory.
Given Data / Assumptions:
Concept / Approach:
First, perform the base-10 addition. Next, convert the decimal result to binary using positional weights or successive division by 2. Finally, represent the binary value using eight bits by adding leading zeros if the natural binary length is less than 8 bits.
Step-by-Step Solution:
Verification / Alternative check:
Convert back: 00110010₂ = 32 + 16 + 2 = 50, matching the decimal sum. Hex check: 0x32 equals 50 decimal, further confirming the result.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting to pad to 8 bits, misplacing the binary point, or mis-summing powers of two. Always double-check by reconverting to decimal or cross-checking with hexadecimal.
Final Answer:
00110010
Discussion & Comments