Digital systems and number bases: What are the decimal and hexadecimal equivalents of the 8-bit binary value 10011101?

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:

  • An 8-bit binary number: 10011101.
  • Weights of bits from left (most significant) to right (least significant): 128, 64, 32, 16, 8, 4, 2, 1.
  • Hexadecimal groups bits in nibbles (4 bits each).


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:

Write the bit weights: 1 0 0 1 1 1 0 1 corresponds to 128 64 32 16 8 4 2 1.Identify 1 bits: positions 128, 16, 8, 4, and 1 are set.Compute decimal: 128 + 16 + 8 + 4 + 1 = 157.Group into nibbles: 1001 1101.Map nibbles to hex: 1001 = 9, 1101 = D, so hexadecimal is 0x9D.


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:

  • 155, 0x9B: 0x9B = 155 decimal, not 157.
  • 159, 0x9F: 0x9F = 159 decimal, different set bits (adds +2).
  • 185, 0xB9: 0xB9 = 185 decimal; high nibble B (1011) does not match 1001.
  • 145, 0x91: 0x91 = 145 decimal; too small by 12.


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

No comments yet. Be the first to comment!
Join Discussion