Difficulty: Easy
Correct Answer: 157, 0x9D
Explanation:
Introduction / Context:
Converting between binary, decimal, and hexadecimal is a foundational digital-logic and networking skill. Administrators, electronics engineers, and programmers often translate IP masks, register values, and flags across these bases. Here we convert the binary pattern 10011101 to both decimal and hexadecimal.
Given Data / Assumptions:
Concept / Approach:
To convert binary to decimal, sum the weights of all 1 bits. To convert binary to hexadecimal, group bits into 4-bit nibbles and map each nibble to a hex symbol (0–9, A–F). These methods are deterministic and avoid mistakes caused by mental arithmetic shortcuts.
Step-by-Step Solution:
Verification / Alternative check:
Reverse check: 0x9D = 9 * 16 + 13 = 144 + 13 = 157 decimal; 157 in binary is indeed 10011101. Both paths agree.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting to use correct bit weights; mis-grouping nibbles from the left; mixing decimal digits with hex symbols (e.g., treating D as 10 instead of 13).
Final Answer:
157, 0x9D
Discussion & Comments