Number Theory
    35 min read
    September 2026

    Positional Notation and Base Conversion: An Algebraic Approach

    The successive-division algorithm converts between arbitrary bases without ever passing through base ten: a rigorous algebraic proof, with worked examples of native long division in non-decimal bases.

    7. An application: bytes, binary, and hexadecimal

    Base ten admits, as such, no privileged mathematical role: by Theorem 2.1, every integer b≥2 provides an equally legitimate positional system. The choice of base ten is a cultural convention, plausibly tied to the number of fingers on human hands, not an algebraic property of the number 10.

    An immediate application of this principle, particularly natural in computing, is conversion between base 2 (binary) and base 16 (hexadecimal) for a byte.

    Example 7.1

    The byte (10110110)2 admits, by Definition 1.1, the value

    1⋅128+0⋅64+1⋅32+1⋅16+0⋅8+1⋅4+1⋅2+0⋅1=128+32+16+4+2=182.1\cdot128+0\cdot64+1\cdot32+1\cdot16+0\cdot8+1\cdot4+1\cdot2+0\cdot1 = 128+32+16+4+2 = 182.

    Direct conversion of 182 into base 16.

    182=11⋅16+6 ⇒ d0=6,182 = 11\cdot16+6 \ \Rightarrow\ d_0=6,11=0⋅16+11 ⇒ d1=11=(B)16, N2=0: we stop.11 = 0\cdot16+11 \ \Rightarrow\ d_1=11=(\text{B})_{16},\ N_2=0:\ \text{we stop.}

    (10110110)₂ = (B6)₁₆

    Check: 11·16+6=176+6=182. ✓

    The shortcut commonly used to convert between binary and hexadecimal -- grouping binary digits four at a time -- is not an isolated trick: it is itself a special case of Theorem 2.1, and deserves a formal algebraic proof, not just a numerical illustration.

    Proposition 7.1 (grouping into blocks of 4)

    Let N=(bn⋯b₁b₀)2=∑i=0nbi2i be a number written in base 2, with 0≤bi<2, and suppose the number of binary digits n+1 is a multiple of 4, i.e. n+1=4m for some integer m≥1. Then

    N=∑k=0m−1ck 16k,ck:=∑j=03b4k+j 2j,N=\sum_{k=0}^{m-1}c_k\,16^k, \qquad c_k:=\sum_{j=0}^{3}b_{4k+j}\,2^j,

    and each ck satisfies 0≤ck≤15: the ck are thus exactly the hexadecimal digits of N.

    Proof. Every index i∈{0,…,n}={0,…,4m-1} can be written uniquely as i=4k+j with k=⌊i/4⌋∈{0,…,m-1} and j=i mod 4∈{0,1,2,3} -- itself an instance of Euclidean division by 4 (Theorem 2.1). Rewriting the sum with this change of index:N=∑i=0nbi2i=∑k=0m−1∑j=03b4k+j 24k+j=∑k=0m−1(∑j=03b4k+j2j)24k=∑k=0m−1ck 16k,N=\sum_{i=0}^{n}b_i2^i=\sum_{k=0}^{m-1}\sum_{j=0}^{3}b_{4k+j}\,2^{4k+j}=\sum_{k=0}^{m-1}\left(\sum_{j=0}^{3}b_{4k+j}2^j\right)2^{4k}=\sum_{k=0}^{m-1}c_k\,16^k,where we collected 24k=(2⁴)k=16k and set ck:=∑j=03b4k+j2j.

    It remains to show 0≤ck≤15. Since bi∈{0,1} for every i, we have ck=b4k+2b4k+1+4b4k+2+8b4k+3≤1+2+4+8=15 (the maximum is reached when all four bits of the block equal 1), and clearly ck≥0: each ck is thus an admissible digit in base 16 (Definition 1.1). By Theorem 2.1 (uniqueness), since N=∑ck16k is a positional representation of N in base 16 with admissible digits, it is necessarily the only representation of N in base 16: the ck are thus exactly its hexadecimal digits, and not some equivalent but different writing of the canonical one.

    ∎

    Note (binary digit counts not a multiple of 4)

    If N has a number of binary digits that is not a multiple of 4, one pads its binary representation with non-significant leading zeros until reaching a multiple of 4: an extra 0 digit in the most significant position contributes 0·2i=0 to the sum in Definition 1.1, so it does not change the value of N, and it makes Proposition 7.1 applicable. The byte in Example 7.1 already has 8=4·2 digits, a multiple of 4: no padding is needed. It would be needed, for instance, to convert the number (101)2 alone (three digits): one would first write it as (0101)2, a complete block.

    Application to Example 7.1. The byte N=(10110110)2 has bits (from b₇ to b₀) 1,0,1,1,0,1,1,0, so n+1=8=4·2, m=2, no padding needed. By Proposition 7.1:

    block k=0 (b3b2b1b0=0110):c0=b0⋅1+b1⋅2+b2⋅4+b3⋅8=0+2+4+0=6,\text{block }k=0\ (b_3b_2b_1b_0=0110):\quad c_0=b_0\cdot1+b_1\cdot2+b_2\cdot4+b_3\cdot8=0+2+4+0=6,block k=1 (b7b6b5b4=1011):c1=b4⋅1+b5⋅2+b6⋅4+b7⋅8=1+2+0+8=11.\text{block }k=1\ (b_7b_6b_5b_4=1011):\quad c_1=b_4\cdot1+b_5\cdot2+b_6\cdot4+b_7\cdot8=1+2+0+8=11.

    Hence N=c₁·16+c₀=11·16+6, i.e., writing 11 with the hexadecimal symbol B: N=(B6)16 -- the same result found in Example 7.1 by successive division, now justified in general by Proposition 7.1, and not merely verified case by case.

    In the opposite direction, (2F)16=2·16+15=47, which in binary is (00101111)2(check: 32+8+4+2+1=47 ✓; by the same shortcut: 2→0010, F=15→1111).

    The whole framework developed in this article -- from Definition 1.1 to Theorem 2.1, down to the direct method of Section 3 -- shows that converting between arbitrary bases never requires base ten as an intermediate stop: base ten remains one among infinitely many equally legitimate choices, rooted historically in the anatomy of the human hand rather than in any distinctive mathematical property.

    Comments

    Loading comments...

    Won't be published: only used for contact and moderation.

    0/3000 characters

    Anti-spam check in progress…

    © 2026 keenonmaths.org. Empowering mathematical minds worldwide.

    Educational articles are distributed under a Creative Commons BY-NC-ND 4.0 license.