In digital electronics, the number system is used for representing the information. The number system has different bases and the most common of them are the decimal , binary , octal , and hexadecimal . The base or radix of the number system is the total number of the digit used in the number system.
Types of Number Systems Some of the important types of number system are: 1. Decimal Number System 2. Binary Number System 3. Octal Number System 4. Hexadecimal Number System .
THE DECIMAL NUMBER SYSTEM The number system is having digit 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; this number system is known as a decimal number system because total ten digits are involved. The base of the decimal number system is 10.
THE BINARY NUMBER SYSTEM The modern computers do not process decimal number; they work with another number system known as a binary number system which uses only two digits 0 and1.The base of binary number system is 2 because it has only two digit 0 and 1.The digital electronic equipments are works on the binary number system and hence the decimal number system is converted into binary system.
THE OCTAL NUMBERS The base of a number system is equal to the number of digits used, i.e., for decimal number system the base is ten while for the binary system the base is two . The octal system has the base of eight as it uses eight digits 0, 1, 2, 3, 4, 5, 6, 7.
All these digits from 0 to 7 have the same physical meaning as by decimal symbols, the next digit in the octal number is represented by 10, 11, 12, which are equivalent to decimal digits 8, 9, 10 respectively. In this way, the octal number 20 will represent the decimal digit and subsequently, 21, 22, 23.. Octal numbers will represent the decimal number digit 17, 18, 19… etc. and so on.
Hexadecimal Numbers These numbers are used extensively in microprocessor work. The hexadecimal number system has a base of 16, and hence it consists of the following sixteen number of digits. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
The size of the hexadecimal is much shorter than the binary number which makes them easy to write and remember. Let 0000 to 000F representing hexadecimal numbers from zero to fifteen, then 0010, 0011, 0012, …etc. Will represent sixteen, seventeen, eighteen… etc. till 001F which represent thirty open and so on.
Steps for Decimal to Binary Conversion Divide the decimal number which is to be converted by two which is the base of the binary number. 2. The remainder which is obtained from step 1 is the least significant bit of the new binary number.
3. Divide the quotient which is obtained from the step 2 and the remainder obtained from this is the second least significant bit of the binary number. 4. Repeat the process until the quotient remains zero.
5. The last remainder obtained from the division is the most significant bit of the binary number. Hence arrange the number from most significant bit to the least significant bit (i.e., from bottom to top).
EXAMPLES: Convert the following decimals to binary 1.) 25 10
To convert decimal to octal , we have to learn about both the number systems first. A number with base 8 is the octal number and a number with base 10 is the decimal number.
Here we will convert a decimal number to an equivalent octal number. It is the same as converting any decimal number to binary or decimal to hexadecimal .
In decimal to binary, we divide the number by 2 , in decimal to hexadecimal we divide the number by 16 . In case of decimal to octal, we divide the number by 8 and write the remainders in the reverse order to get the equivalent octal number.
STEPS IN CONVERTING DECIMAL NUMBERS TO OCTAL 1. Write the given decimal number 2. If the given decimal number is less than 8 the octal number is the same. 3. If the decimal number is greater than 7 then divide the number by 8 .
4. Note the remainder, we get after division 5 . Repeat step 3 and 4 with the quotient till it is less than 8 6 . Now , write the remainders in reverse order (bottom to top) 7 . The resultant is the equivalent octal number to the given decimal number .
2.) Convert 52 10 to octal . 52 ÷ 8 = 6 remainder 4 6 ÷ 8 = 0 remainder 6 ( Arrange the remainder from bottom to top) Therefore , (52) 10 = (64) 8
Converting Decimal to Hexadecimal
STEPS: 1. Take decimal number as dividend. 2. Divide this number by 16 (16 is base of hexadecimal so divisor here ).
STEPS: 3. Store the remainder in an array (it will be: 0 to 15 because of divisor 16, replace 10, 11, 12, 13, 14, 15 by A, B, C, D, E, F respectively).
4. Repeat the above two steps until the number is greater than zero. 5. Print the array in reverse order (which will be equivalent hexadecimal number of given decimal number).
Example 1: Convert decimal number 540 into hexadecimal number . 540 ÷16 = 33 remainder 12 33 ÷ 16 = 2 remainder 1 2 ÷ 16 = 0 remainder 2 0 ÷ 16 = 0 remainder 0 ( write from bottom to top) 540 10 = 021C 16 or 21C 16 ( Remember that 12 = C in hexadecimal)
Example 2 : Convert decimal number 8 60 into hexadecimal number . 8 60 ÷16 = 53 remainder 12 5 3 ÷ 16 = 3 remainder 5 3 ÷ 16 = 0 remainder 3 0 ÷ 16 = 0 remainder 0 ( write from bottom to top) 860 10 = 035C 16 or 35C 16 ( Remember that 12 = C in hexadecimal)