Difficulty: Easy
Correct Answer: 2
Explanation:
Introduction / Context:
Memory and register sizing problems are routine in digital design. The key steps are finding the minimum number of bits required for a given unsigned value, then converting that bit count to whole bytes (8-bit groups). Here we size storage for the decimal value 2875.
Given Data / Assumptions:
Concept / Approach:
Compute n = floor(log2(N)) + 1 to get the minimal bit length, or bound N between powers of two. Then compute bytes = ceil(n / 8). This ensures there is enough capacity without wasted fractional bytes.
Step-by-Step Solution:
Find surrounding powers of two: 2^11 = 2048, 2^12 = 4096.Since 2048 ≤ 2875 ≤ 4095, the value requires 12 bits.Translate to bytes: ceil(12 / 8) = ceil(1.5) = 2 bytes.Therefore, two bytes suffice to store 2875 in binary.
Verification / Alternative check:
Direct conversion to binary (optional) will produce a 12-bit pattern, reaffirming that 16-bit (2-byte) storage is the nearest whole-byte capacity.
Why Other Options Are Wrong:
3, 4, 5: These provide more space than needed. 3 bytes would cover up to 24 bits (overkill for a 12-bit value).
Common Pitfalls:
Using 8 bits per byte incorrectly or adding an unnecessary sign bit; forgetting to round up to the next whole byte after computing the bit length.
Final Answer:
2
Discussion & Comments