Quiz Entry - updated: 2026.07.07
How does unsigned integer encoding work?
Each bit contributes its positional weight 2^i; the value is the sum of 2^i over every bit that's 1. Range: 0 to 2^w − 1.
For w-bit unsigned integer with bits [x_{w-1}, ..., x_1, x_0]:
B2U(X) = Σ(x_i × 2^i) for i from 0 to w-1
Example (4 bits):
Binary: 1011
Value: 1×2³ + 0×2² + 1×2¹ + 1×2⁰
= 8 + 0 + 2 + 1 = 11
Range: 0 to 2^w - 1
- 8-bit: 0 to 255
- 16-bit: 0 to 65,535
- 32-bit: 0 to 4,294,967,295