Numeral Systems

n - can start from negative number if the number has a fraction part.

N+1 - the number of digits

Binary Numeral System - Base-2

Binary numbers uses only 0 and 1 digits.

B denotes binary prefix.

Examples:

101012 = 10101B = 1×2 4 +0×2 3 +1×2 2 +0×2 1 +1×2 0 = 16+4+1= 21

101112 = 10111B = 1×2 4 +0×2 3 +1×2 2 +1×2 1 +1×2 0 = 16+4+2+1= 23

1000112 = 100011B = 1×2 5 +0×2 4 +0×2 3 +0×2 2 +1×2 1 +1×2 0 =32+2+1= 35

Octal Numeral System - Base-8

Octal numbers uses digits from 0..7.

Examples:

278 = 2×8 1 +7×8 0 = 16+7 = 23

308 = 3×8 1 +0×8 0 = 24

43078 = 4×8 3 +3×8 2 +0×8 1 +7×8 0 = 2247

Decimal Numeral System - Base-10

Decimal numbers uses digits from 0..9.

These are the regular numbers that we use.

Example:

253810 = 2×10 3 +5×10 2 +3×10 1 +8×10 0

Hexadecimal Numeral System - Base-16

Hex numbers uses digits from 0..9 and A..F.

H denotes hex prefix.

Examples:

2816 = 28H = 2×16 1 +8×16 0 = 40

2F16 = 2FH = 2×16 1 +15×16 0 = 47

BC1216 = BC12H = 11×16 3 +12×16 2 +1×16 1 +2×16 0 = 48146

Numeral systems conversion table

See also