This article describes the number system and the conversion process between number systems. There are four number systems that can be used : decimal, binary, octal, and hexadecimal. The decimal system is certainly familiar because it is always used every day. For digital techniques used binary and hexadecimal number systems.
Decimal Numbers
Decimal numbers consist of 10 numeric symbols : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; The decimal system is often called the base 10 number. Because it consists of 10 digits. In the application, the value of a decimal number is determined by its position in the data as given in table 1 below
Table 1 : The value of the decimal number in its position
10^{3} | 10^{2} | 10^{1} | 10^{0} | 10^{-1} | 10^{-2} | 10^{-3} | |
= 1000 | = 100 | = 10 | = 1 | . | = 0.1 | = 0.01 | = 0.001 |
MSD | Decimal pont | LSD |
MSD = Most Significant Digit
LSD = Least Significant Digit
Examples:
123
1 = 100
2 = 20
3 = 10
Binary Numbers
In a binary system, there are two digit values 0 and 1, so it is often called the base number two. With these two values it can be used to represent all quantifiable quantities that can be expressed in decimal form or other number systems. The bit value is determined by the bit position in a binary data series, as given in Table 2 and the 4-bit Binary System is given in Table 3 below
Table 2 : The Value of bit positions in binary
2^{3} | 2^{2} | 2^{1} | 2^{0} | 2^{-1} | 2^{-2} | 2^{-3} | |
= 8 | = 4 | = 2 | = 1 | . | = 1/2 | = 1/4 | = 1/8 |
MSB | Binary Point | LSB |
MSB = Most Significant Bit
LSB = Least Significant Bit
Table 3 : 4 bit binary system
2^{3} | 2^{2} | 2^{1} | 2^{0 } | Decimal |
0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 1 |
0 | 0 | 1 | 0 | 2 |
0 | 0 | 1 | 1 | 3 |
0 | 1 | 0 | 0 | 4 |
0 | 1 | 0 | 1 | 5 |
0 | 1 | 1 | 0 | 6 |
0 | 1 | 1 | 1 | 7 |
1 | 0 | 0 | 0 | 8 |
1 | 0 | 0 | 1 | 9 |
1 | 0 | 1 | 0 | 10 (A) |
1 | 0 | 1 | 1 | 11 (B) |
1 | 1 | 0 | 0 | 12 (C) |
1 | 1 | 0 | 1 | 13 (D) |
1 | 1 | 1 | 0 | 14 (E) |
1 | 1 | 1 | 1 | 15 (F) |
Converting Binary to Decimal
Binary numbers can be converted to decimal form by summing the 1 bit values based on their position as given in Fig.
Examples:
^{1 1 0 1 1} _{2} (binary)
2^{4}+2^{3}+ 0 + 2^{1}+2^{0 }= 16 + 8 + 0 + 2 + 1
= 27_{10} (decimal)
and
1 0 1 1 0 1 0 1 _{2} (binary)
2^{7}+ 0 + 2^{5}+2^{4}+ 0 + 2^{2}+ 0 + 2^{0 }= 128 + 0 + 32 + 16 + 0 + 4 + 0 + 1
= 181_{10} (decimal)
Decimal to Binary Conversion
There are 2 methods:
(A) Reverse of the Binary to Decimal method
^{45} _{10 }= 32 + 0 + 8 + 4 +0 + 1
= 2^{5}+ 0 + 2^{3}+2^{2}+ 0 + 2^{0}
= 1 0 1 1 0 1_{2}
(B) repeated division
This method uses division by 2 repeatedly, the result is read from the result of the last division.
Example: conversion 25_{10} to binary 25/2
= 12 remainder 1 1 (LSB) 12/2
= 6 remainder 0 0
6/2 = 3 remainder 0 0
3/2 = 1 remainder 1 1
2.4
1/2 = 0 remainder 1 1 (MSB)
Result 25_{10 }= 11001_{2 }
Octal Numbers
Octal numbers are often called base 8 numbers because they have 8 digits, namely: 0,1,2,3,4,5,6,7 with values based on digit positions as given in Table.4.
Table 4 Value of octal number
8^{3} | 8^{2} | 8^{1} | 8^{0} | 8^{-1} | 8^{-2} | 8^{-3} | |
= 512 | = 64 | = 8 | = 1 | . | = 1/8 | = 1/64 | = 1/1212 |
MSD | Octal Point | LSD |
Convert Octal to Decimal
Example: 24.6_{8 }= (……..)_{10}
= 2 x (8^{1}) + 4 x (8^{0}) + 6 x (8^{-1})
= 20.75_{10}
Converting Binary to Octal
Octal Digits | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
Binary Equivalent | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
To convert a binary number to octal, each octal digit is given as a 3 bit binary number.
Example: 100 111 010_{2} = ………._{8 }
= (100) (111) (010)
= 4 7 2_{8}
2.5
Octal to Binary Conversion
The method is to use repeated division. This method divides the decimal number by 8 repeatedly and the result is read from the last division.
Example: Conversion says a 177_{10} to Octal and binary form
Convert to octal:
177/8 = 22 remainder 1 1 (LSB) 22/8 =
2 remainder 6 6
= 0 remainder 2 2 (MSB)
2/8Result 177_{10 }= 261_{8}
^{Convert to Binary }= 010 110 001_{2 }
Hexadecimal Numbers
The hexadecimal number system is a number system with 15 numeric symbols so it is often called the base 16 number system, namely: 0 to plus the letters A, B, C, D, E, and F.The digit position values are given in Table 6. .
Table 6. The position value of the hexadecimal number
16^{3} | 16^{2} | 16^{1} | 16^{0} | 16^{-1} | 16^{-2} | 16^{-3} | |
= 4096 | = 256 | = 16 | = 1 | . | = 1/16 | = 1/256 | = 1/4096 |
MSD | Hex Point | LSD |
Convert Hexadecimal to Decimal
Example:
2AF_{16} = ……_{10}.
2.6
= 2 x (16^{2}) + 10 x (16^{1}) + 15 x (16^{0})
= 687_{10 }
Repeating divisor: Convert decimal to hexadecimal
The method is the same in the decimal system but the divisor is 16. Example:
Convert 378_{10} to hexadecimal and binary:
378/16 = 23+ remainder 10 A (LSB) 23/16
= 1 + remainder 7 7
1/16 = 0 + remainder 1 1 (MSB)
Result 378_{10 }= 17A_{8}
Conversion to binary = 0001 0111 1010
Converting Hexadecimal to Binary
Each hexadecimal digit consists of 4 bits of binary digits as given in Table 7.
Table 7. Binary equivalent of the hexadecimal number
Hexadecimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
Binary equivalent | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 |
Hexadecimal | 8 | 9 | A (10) | B (11) | C (12) | D (13) | E (14) | F (15) ) |
Binary Equivalent | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
Converting Binary to Hexadecimal
Example:
1011 0010 1111_{2} = …. _{16}
2.7
= (1011) (0010) (1111)_{2}
= B 2 F_{16 }
Convert Hexadecimal to Binary
Example:
123E_{16 }^{=} …… 2
_{ }= 10001 0010 0011 1110_{2 }
Convert Hexadecimal to Octal
Steps:
1) Convert Hexadecimal to Binary form.
2) Arrange binary numbers in 3 bit form starting from LSB.
Example.
Convert 5A8_{16 }to Octal
Convert to the binary form
456_{16} = 0100 0101 0110 (binary)
Create in a 3 bit group.
Obtained = 010 001 010 110
= 2 1 2 3_{8 }
Conclusion
- There are 4 number systems : binary, octal, decimal, and hexa decimal.
- The four numbers can be converted to one another.
- Digital techniques using binary numbers