Base Number Systems

Each number system employs a number of different digits which is called the base of the number system.

We  learn to count at school but most people take it for granted why we have only the following numbers:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Using the numbers above, we can create any number that we care to. If we count, there are 10 digits in the number sequence above. We call this the base or radix of the number system.

Some Commonly used number systems

Decimal                           Base = 10
Binary                             Base = 2
Octal                               Base = 8
Hexadecimal (Hex)           Base = 16

Decimal Number System  

Base          10

Digits         0, 1, 2, 3, 4, 5, 6, 7, 8, 9
e.g.            747510

The magnitude represented by a digit is decided by the position of the digit within the number.

7475 picture

For example the digit 7 in the left-most position of 7475 counts for 7000 and the digit 7 in the second position from the right counts for 70.

Binary Number System

Base          2
Digits         0, 1
e.g.            11102

1110 picture

The digit 1 in the third position from the right represents the value 4 and the digit 1 in the fourth position from the right represents the value 8.

Octal Number System

Base         8
Digits        0, 1, 2, 3, 4, 5, 6, 7
e.g.           16238

1623 picture

The digit 2 in the second position from the right represents the value 16 and the digit 1 in the fourth position from the right represents the value 512.

Hexadecimal Number System

Base         16
Digits        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
e.g.           2F4D 16


2f4d picture

The digit F in the third position from the right represents the value 3840 and the digit D in the first position from the right represents the value 1.


Binary Codes

A binary code is a group of n bits that assume up to 2n distinct combinations of 1’s and 0’s with each combination representing one element of the set that is being coded.

  BCD     – Binary Coded Decimal
 ASCII     – American Standard Code for Information Interchange

BCD – Binary Coded Decimal

When the decimal numbers are represented in BCD, each decimal digit is represented by the equivalent BCD code.

Example.  BCD Representation of Decimal 6349

   6          3           4          9
0110     0011     0100     1001

Decimal       BCD
Number     Number   
     0           0000
     1           0001
     2           0010
     3           0011
     4           0100
     5           0101
     6           0110
     7           0111
     8           1000
     9           1001

ASCII
Number  ASCII       

0    0110000
1    0110001
2    0110010
3    0110011
4    0110100
5    0110101
6    0110110
7    0110111
8    0111000
9    0111001
Letter    ASCII
A    1000001
B    1000010
C    1000011
D    1000100
E    1000101
F    1000110
G    1000111
H    1001000
I    1001001
J    1001010
K    1001011
L    1001100
M    1001101
N    1001110
O    1001111
P    1010000
Q    1010001
R    1010010
S    1010011
T    1010100
U    1010101
V    1010110
W    1010111
X    1011000
Y    1011001
Z    1011010


Hexadecimal to Decimal

Hexadecimal number  B4F
Convert B4F to Decimal

BF4= 11 x 162 + 4 x 161 + 15 x 160
           =11 x 256  + 4 x 16 + 15
          = 2, 816 + 64 + 15= 289510


Decimal to Hexadecimal

Convert decimal number 20385 to hexadecimal.

16 ) 20385  remainder  =  1        1’s       place
16 ) 1274   remainder  =  10       16 ’s     place
16 ) 79       remainder  =  15       162 ’s  place
16 ) 4         remainder  =  4         163 ’s  place

            2038510 =4FA116

DECIMAL     HEXADECIMAL
0                                 0
1                                 1
2                                 2
3                                 3
4                                 4
5                                 5
6                                 6
7                                 7
8                                 8
9                                 9
10                               A
11                               B
12                               C
13                               D
14                               E
15                               F