Decimal Number System
(base10)
This is the numbering
system that we have grown up with.
To understand the other
numbering systems (binary, octal, hexadecimal) we will start by recalling the
'rules' associated with the decimal (or base10) system.
With
the decimal numbering system, we use a base of 10.
This
means that we go up in increments of 10:
1
10
100
1000
etc…..
Example
Consider
the following decimal number:
136.25.
What
does this actually mean?
This
number means:
102 * 1 = 100.0101 * 3 = 30.0100 * 6 = 6.010-1 * 2 = 0.210-2 * 5 = 0.05 total = 136.25
Binary Number System
(base2)
With
the binary numbering system, we use a base of 2 instead of a base of 10.
This
means that we go up in increments of 2:
1
2
4
8
16
32
64
128
256
512
etc…..
Example:
Consider the binary number:
1101.01.
Again in its full form this means:
23 * 1 = 1000.0 (8 in decimal)22 * 1 = 100.0 (4 in decimal)21 * 0 = 00.0 (0 in decimal)20 * 1 = 1.0 (1 in decimal)2-1 * 0 = 0.0 (0.0 in decimal)2-2 * 1 = 0.01 (0.25 in decimal) total = 1101.01 (13.25 in decimal)
The
following shows the first integers and their binary equivalents (and how they
are derived):
decimal binary
0 0000 (0 * 23 + 0 * 22 + 0 * 21 + 0 * 20) 1 0001 (0 * 23 + 0 * 22 + 0 * 21 + 1 * 20) 2 0010 (0 * 23 + 0 * 22 + 1 * 21 + 0 * 20) 3 0011 (0 * 23 + 0 * 22 + 1 * 21 + 1 * 20) 4 0100 (0 * 23 + 1 * 22 + 0 * 21 + 0 * 20) 5 0101 (0 * 23 + 1 * 22 + 0 * 21 + 1 * 20) 6 0110 (0 * 23 + 1 * 22 + 1 * 21 + 0 * 20) 7 0111 (0 * 23 + 1 * 22 + 1 * 21 + 1 * 20) 8 1000 (1 * 23 + 0 * 22 + 0 * 21 + 0 * 20) 9 1001 (1 * 23 + 0 * 22 + 0 * 21 + 1 * 20)
Octal Number System
(base8)
With
the octal numbering system, we use a base of 8 instead of a base of 10 or
2.
As
it turns out, each octal "digit" will represent a group of 3 bits or
binary digits.
Example:
Consider the binary number
110101010
This 9 bit binary number can be
grouped into 3 groups of 3 bits:
110 101 010


6 5 2
This gives us the octal number:
6528
This octal number (and associated binary number) is a representation of the following decimal number: 42610
Hexadecimal Number System
(base16 or baseH)
Although
it is very convenient for computers to use 0 and 1 it is difficult for humans
to readily identify binary numbers.
Hexadecimal
(Hex) acts as an interim number system between binary and ourselves as
it is more recognizable yet easy to convert to and from binary.
With
the hexadecimal numbering system, we use a base of 16 instead of a base of 10,
8, or 2.
As
it turns out, each hexadecimal "digit" will represent a group of 4
bits or binary digits (1 byte can be expressed by two hexadecimal digits).
The
Hexadecimal system uses the following "digits"
Hexadecimal Digit Decimal Digit
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
A 10
B 11
C 12
D 13
E 14
F 15
Example:
Consider the binary number
100101110100
This 12 bit binary number can be
grouped into 3 groups of 4 bits:
1001 0111 0100
![]()
![]()
9 7 4
This gives us the hexadecimal number:
97416 = 974H
A table providing
decimal, binary, and hex equivalents for the first 16 integers is:
decimal binary Hex
0 0000 01 0001 12 0010 23 0011 34 0100 45 0101 56 0110 67 0111 78 1000 89 1001 910 1010 A11 1011 B12 1100 C13 1101 D14 1110 E15 1111 F
A
few further examples of binary and hexadecimal numbers follow:
0100 1100 0001 1111 = 4C1F16 = 4C1FH 1101 0110 1100 0000 = D6C016 = D6C0H