Hexadecimal Number Representations

Learn to represent numbers in a hexadecimal base system and why this number system is so useful.

Hexadecimal representation (base sixteen)

If we can count up to sixteen, twelve stones fit in one group, but we need more symbols:

A,B,C,D,E,A, B, C, D, E, and FF for ten, eleven, twelve, thirteen, fourteen, and fifteen, respectively.

Examples:

  • 12dec=C  12_{\text{dec}} = C\space\space in hexadecimal representation (notation)

  • 123dec=(7161+11160)dec=(7B)hex123_{\text{dec}} = (7*16^1 + 11*16^0)_{\text{dec}} = (7B)_{\text{hex}}

Formulas:

Using the summation symbol, we have this formula:

Ndec=i=0nai16iN_{\text{dec}}=\sum_{i=0}^n a_i*16^i

Why are hexadecimal numbers used?

Consider a number written in binary notation: 1100010100112110001010011_2. Its equivalent in decimal notation is 31553155. We can decompose the number with binary coefficients as follows:

3155dec=1211+1210+029+028+027+126+025+124+023+022+121+1203155_{\text{dec}} = 1*2^{11} + 1*2^{10} + 0*2^9 + 0*2^8 + 0*2^7 + 1*2^6 + 0*2^5 + 1*2^4 + 0*2^3 + 0*2^2 + 1*2^1 + 1*2^0

Get hands-on with 1200+ tech skills courses.