Binary conversion practice: convert the decimal number 224 to its 8-bit binary representation.

Difficulty: Easy

Correct Answer: 11100000

Explanation:


Introduction / Context:
Converting between decimal and binary is a foundational skill in computer science and networking. IP addressing, subnet masks, and many low-level operations rely on bitwise reasoning. Here we convert the decimal value 224 into an 8-bit binary string suitable for byte-oriented contexts (e.g., subnet masks such as 255.255.255.224).


Given Data / Assumptions:

  • We need an 8-bit representation (values 0–255).
  • Decimal input is 224.
  • Standard positional weights are 128, 64, 32, 16, 8, 4, 2, 1.


Concept / Approach:
Binary expansion expresses a number as a sum of powers of 2. Determine which place values are needed by subtracting the largest possible powers of 2 without making the running total negative. Place a 1 where a weight is used and a 0 where it is not.


Step-by-Step Solution:

Start with the highest weight: 128 fits into 224 → remainder 224 - 128 = 96 → bit pattern starts 1xxxxxxx.Next 64 fits into 96 → remainder 96 - 64 = 32 → pattern 11xxxxxx.Next 32 fits into 32 → remainder 32 - 32 = 0 → pattern 111xxxxx.Remaining weights (16, 8, 4, 2, 1) all exceed the remainder of 0 → bits are 0.Final 8-bit pattern: 11100000.


Verification / Alternative check:
Reconstruct from bits: 1128 + 164 + 132 + 016 + 08 + 04 + 02 + 01 = 224, confirming correctness.


Why Other Options Are Wrong:

11110000 = 240, not 224.00011110 = 30, not 224.00001111 = 15, not 224.None of the above: incorrect because 11100000 is correct.


Common Pitfalls:
Reversing bit order (LSB/MSB confusion) or stopping after setting the first few bits without confirming the remainder is zero.


Final Answer:
11100000.

More Questions from Networking

Discussion & Comments

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