Decimal to 8-bit binary — encode the value with leading zeros if needed. Task: Convert 187₁₀ to an 8-bit binary representation.

Difficulty: Easy

Correct Answer: 10111011

Explanation:


Introduction / Context:
Encoding a decimal integer as an 8-bit binary pattern is common when writing to registers, configuring peripherals, or defining bit masks. The 8-bit form explicitly shows each bit from 2^7 to 2^0.


Given Data / Assumptions:

  • Decimal value: 187
  • Target width: 8 bits (MSB first)


Concept / Approach:
Decompose 187 into powers of two ≤ 128. Mark a 1 for each included power and 0 otherwise to build the 8-bit string. Alternatively, perform repeated division by 2 and pad to 8 bits.


Step-by-Step Solution:

Largest power ≤ 187 is 128 (2^7): remainder 59Next 64 (2^6): not used (0); remainder stays 59Use 32 (2^5): remainder 27Use 16 (2^4): remainder 11Use 8 (2^3): remainder 3Use 4 (2^2): not used (0); remainder 3Use 2 (2^1): remainder 1Use 1 (2^0): remainder 0Bits: 1 0 1 1 1 0 1 1 ⇒ 10111011


Verification / Alternative check:
Sum the active weights: 128 + 32 + 16 + 8 + 2 + 1 = 187. Also, a calculator check in binary mode will show 187 → 10111011₂.


Why Other Options Are Wrong:

  • 11011101, 10111101, 10111100, 10111010: each flips or misses one or more required bit positions.


Common Pitfalls:

  • Forgetting the 64’s place is 0 here, or misplacing the 4’s place (which is 0).


Final Answer:
10111011

Discussion & Comments

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