- Assume a bit vector x=[xw−1,xw−2,…,x0]
- Then, the unsigned integer encoded by x is given by, where the symbol B2Uw means binary to unsigned, w-bit word size
B2Uw(x)≐i=0∑w−1xi2i
Examples
B2U4([0001]=0⋅23+0⋅22+0⋅21+1⋅20=0+0+0+1=1B2U4([0101])=0⋅23+1⋅22+0⋅21+1⋅20=0+4+0+1=5
Visual help

Range of values
- If we have a bit vector x of word length, w bits.
- The least value that can be represented is given by x=[00⋯00], which represents the integer 0.
- The maximum value can be represented by x=[11⋯11] which represents the integer:
UMaxw=i=0∑w−12i=2w−1
Example
Sources