1.2 Number Systems


1. Various number systems has been devised and used including:
a) Decimal number system,
b) Binary number system,
c) Octal Number system and
d) Hexadecimal number system.

2. We are most familiar with the decimal number system which contains ten different decimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9).

3. Number systems are classified according to their base value which is the number of unique digits that can be represented by the number system:
a) The decimal number system has base 10 as it contains 10 digits only "0", "1", "2", "3", "4", "5", "6", "7” ", "8” ", "9” " and "10”.
b) The binary number system has a base value of 2 with two digits allowed in the system which are
"0" and "1".
c) The octal number system has a base value of 8 and has 8 different digits "0", "1", "2", "3", "4", "5",
"6" and "7”.

1.2 Number Systems


d) The hexadecimal number system has a base of 16 with 16 distinct symbols which are "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", and "F".

CONVERSION BETWEEN NUMBER SYSTEMS
Conversion between different number systems is often required, e.g., it may be required to convert a decimal number to binary or octal or hexadecimal. As illustrated in Table 1.1, there is a direct correspondence between the octal system and the binary system, with three binary digits corresponding to one octal digit. Likewise, four binary digits translate directly into one hexadecimal digit.

1.2 Number Systems



Table 1.1: Base Conversion Table

1.2 Number Systems


Decimal-to-binary Conversion
1. Converting a decimal number to a binary number requires dividing the decimal number by 2 repeatedly until the quotient of zero is obtained.
2. Then, the column of the remainder for each division step is read in reverse order, i.e., from bottom to top order.
3. This method is called the ‘double-dabble’ method.
4. Example 1.1 shows how the ‘double-dabble’ method is used to convert from decimal to binary.
Example 1.1: Convert 3710 into a binary number.
Solution:

So, the converted binary number is 1001012.

1.2 Number Systems


Decimal-to-octal Conversion
1. Converting a decimal number to an octal number requires dividing the decimal number by 8 repeatedly, until the quotient of zero is obtained.
2. Then the column of the remainder for each division step is read in reverse order i.e., from bottom to top order.
3. This method is called the ‘octal-dabble’ method.
4. Example 1.2 illustrates the use of the ‘octal -dabble’ method to convert from decimal to octal.
Example 1.2: Convert 52410 into an octal number.
Solution:

So, the converted octal number is 10148.

1.2 Number Systems


Decimal-to-hexadecimal Conversion
In converting a number in decimal to a number in hexadecimal, the same steps are followed as in the previous two cases, dividing by 16 repeatedly until the quotient of zero is obtained.
This method is called the ‘hex-dabble’ method.
Example 1.3 illustrates the use of the ‘hex-dabble’ method.
Example 1.3: Convert 65510 into a hexadecimal number
Solution:

So, the converted binary number is 28F16

1.2 Number Systems


1. For the conversion of binary, octal, or hexadecimal numbers to decimal numbers,
It is required to keep in mind that the binary, octal and hexadecimal number systems are positional number systems;
This means that each of the digits in the number has a positional weight.
Conversion to decimal numbers including the use of positional weight in the conversion process is explained in the following examples:

Binary-to-decimal Conversion
Example 1.4: Convert 1001012 into a decimal number.
Solution:

The binary number: 1  0    0    1    0    1
Positional Weights: 5    4    3   2   1   0

The positional weights for each of the digits are written below each digit. The decimal equivalent number is given as:

1.2 Number Systems


1 x 25    +    0 x 24    +    0 x 23    +    1 x 22    +    0 x 21    +    1 x 20
       =    32    +    16    +    8    +    4    +    2    +    1
       = 6310

As shown in the above solution, it’s required to multiply each bit with its positional weight depending on the base of the number system.

Octal-to-decimal Conversion
Example 1.5: Convert 23768 into a decimal number.
Solution:
The octal number: 2    3    7    6
Positional Weights: 3    2    1    0
The positional weights for each of the digits are written below each digit. So, the decimal equivalent number is given as:
2 x 83    +    3 x 82    +    7 x 81    +    6 x 80
       =    1024    +    192    +    56    +    6
       = 127810


1.2 Number Systems


Hexadecimal-to-decimal Conversion
Example 1.6: Convert 23CA16 into a decimal number.
Solution:

The octal number: 1    3    C    A
Positional Weights: 3    2    1    0

The positional weights for each of the digits are written below each digit. So, the decimal equivalent number for 23CA16 is:

1 x 163    +    3 x 162    +    12 x 161    +    10 x 160
       = 4096    +    768    +    192    +    10
       = 506610


1.2 Number Systems


Conversion from a Binary to Octal Number and Vice Versa

1. To convert a binary number to its equivalent octal number,
a) It is required to start from the Least Significant Bit (LSB) to group three digits at a time and replace them by the decimal equivalent of those groups to get the final octal number.
b) Example 1.7 illustrates this conversion method.
Example 1.7: Convert 101110112 into an equivalent octal number.

So, the equivalent octal number is 2738.

Note that digit 0 was added to the third group in the Most Significant Bit (MSB) to complete the three digit group.


1.2 Number Systems


2. To convert an octal number into its equivalent binary number,
a) Each octal digit is converted into 3-bit-equivalent binary digits.
b) Example 1.8 illustrates the method of conversion from octal to binary number.
Example 1.8: Convert 5348 into an equivalent binary number.
Solution:

The octal number: 5    3    4
3 bits equivalent binary: 101    011    100

So, the equivalent binary number is 1010111002.

Conversion from a Binary to Hexadecimal Number and Vice Versa

1. To convert a binary number to its equivalent hexadecimal number,
a) It is required to start from the Least Significant Bit (LSB) to group four digits at a time and replace them by the decimal equivalent of those groups to get the final hexadecimal number.
b) Example 1.9 illustrates this conversion method.

1.2 Number Systems


Example 1.9: Convert 11101110112 into an equivalent hexadecimal number.
Solution:

The octal number: 5    3    4
3 bits equivalent binary: 101    011    100

The binary number: 11 1011 1011
Starting with LSB and grouping 4 bits: 0011    1011    1011
                                     Equivalent octal:    3    B    B

So, the equivalent hexadecimal number is 3BB16.
Note that the third group cannot be completed, since only two binary digits are left out in the third group, so we complete the group by adding two 0’s digit in the MSB side.


1.2 Number Systems


2. To convert the hexadecimal number into its equivalent binary number
a) Each hexadecimal digit is converted into 4-bit-equivalent binary digits.
b) Example 1.10 illustrates the method of conversion from hexadecimal to binary number.
Example 1.10: Convert 5DB16 into an equivalent binary number.
Solution:

The octal number: 5    D    B
4 bits equivalent binary: 0101    1101    1011

So, the equivalent binary number is 0101110110112.