The set of symbols to express quantities as the basis of counting is referred to be a number system. There has been various number systems under human use for the purpose of counting and measurement. For instance decimal number system, octal number system, binary number system and hexadecimal number system have been most popular number systems which human beings have been utilizing for the purpose of counting and measurement.
Though a computer can process only binary numbers i.e. only 0 and 1, we give a brief account of each of the number system mentioned above. Inter conversion of these number systems would also be discussed in this chapter.
Decimal Number System
This is the most commonly used number system and which is very natural to man, hence very easy to use and remember. It consists of ten digits, i.e. from 0 to 9. As the total number of digits used in a number system is called its base or radix, hence base of radix of decimal number system is said to be ten.
Binary Number System
The base or radix of binary number is two, implying that there are only two digits 0 and 1 used in binary number system. This number system has become most popular system because of its use by the computers for processing data.
Octal Number System
This number system is consist of eight i.e. 0,1,2,3,4,5,6 and 7. Hence the base or the radix of octal number system is eight. Actually this number is a short hand version of binary numbers, Hence one octal represents three binary digits.
Hexadecimal Number System
Hexadecimal numbers are extensively used in microcomputers. As they are much shorter than binary numbers, hence easy to write and remember. They are also a short hand version of binary numbers. The hexadecimal also called Hex is equivalent to four binary digits. This number system consists of 0,1,2,3,4,5,6,7,8,9, A,B,C,D,E and F. The base of this number system is 16. The symbol A........F stand respectively for 10.....15.
Binary to Decimal Conversion
All the number system may be easily converted into other number systems. In order to convert binary numbers into decimal numbers we multiply each bit of a particular binary number with (n-1) power of 2.
Add all the resultant multiplied bits.
Example No. 1
To convert the binary number 10010 to a decimal number we proceed as follows:
100102 = (1 x 24) + (1 x 23) + (1 x 22) + (1 x 21) + (1 x 20)
= (1 x 16) + (0 x 8) + (0 x 4) + (1 x 2) + (0 x 1)
= 16 + 0 + 2 + 0
= 18
It should be kept in the mind that any number raised to the power 0 equals 1.
Example No. 2
Similarly in order to convert the binary number 110111 to a decimal number we may proceed as follows:
1101112 = (1 x 25) + (1 x 24) + (1 x 23) + (1 x 22) + (1 x 21) + (1 x 20)
= (1 x 32) + (1 x 16) + (1 x 8) + (1 x 4) + (1 x 2) + (1 x 1)
= 32 + 16 + 0 + 0 + 4 + 2 + 1
= 56
Example No. 3
If there is a period (.) in the binary number e.g. (1011.10). Then the conversion of such binary number can be illustrated as follows:
(10112) = (1 x 23) + (1 x 22) + (1 x 21) + (1 x 20)
= (1 x 8) + (0 x 4) + (1 x 2) + (1 x 1)
= 8 + 0 + 2 + 1
= 11
AND
(.102) = (1 x 2-4) + (1 x 2-2)
= (1 x 1/2) + (1 x 1/4)
= 1/2 + 0 = 0.5
Hence (1011.102) = 11.5
Decimal to Binary Conversion
A decimal number can easily be converted to a binary number. For this purpose we take following steps.
1. Divide the decimal number by 2 and note down the remainder.
2. Take the quotient and again divide by 2, then note down the remainder again.
3. Repeat the 2nd step unit you get 1 as the quotient.
4. The remainders in the reverse order would be our required binary number.
Example No. 4
For example in order to convert decimal number 15 to binary number. we may proceed as follows.
15/2 = 7 and the remainder is 1
7/2 = 3 and the remainder is 1
3/2 = 1 and the remainder is 1
1/2 = 0 and the remainder is 1
Hence the required binary number is 1111
Converting Decimal Fractions to Binary Numbers
The most simple method of converting fractional decimal numbers to binary number is repeated multiplication by two. In this method numbers to the right of the decimal point are repeatedly multiplied by 2 till we get a whole number. The product in fractions is assigned as 0 bit while in whole number it is assigned as 1 bit.
The process of converting a fractional decimal number to binary number would be explained by the following example.
Example No. 5
Let us suppose the we want to convert 0.125 in a binary numbers then proceed as follow.
0.125 x 2 = 0.250 it carries 0
0.250 x 2 = 0.500 it carries 0
0.500 x 2 = 1.00 it carries 1
Hence we can conclude that (0.125)10 = (0.001)2
Addition to Binary Numbers
In order to add binary number below given table should be kept in mind
0 + 0 = 0
0 + 1 + 1
1 = 0 = 1
1 + 1 = 0 with a carry of 1
The following example will illustrate the addition of binary numbers.
Example No.6
Add 1001 and 1010
1001 + 1010 = 11011
Subtraction of Binary Numbers
In order to subtract a binary number from another binary number you must keep the following table in your mind.
0 - 0 = 0
1 - 0 = 1
1 - 1 = 0
0 - 1 = 1 with a barrow of 1
The process of binary subtraction an be illustrated with the help of example given below
Example No. 7
For subtracting binary number 101 from 1001 we proceed as follows
1001 - 100.1 = 1.11
Octal to Decimal Conversion
For converting an octal number to a decimal number we use the same sort of polynomial as was used in the binary case. However in octal to decimal conversion the base or radix is 8 instead of 2.
The process of converting an octal number into a decimal number would be clarified with the help of following example.
Example No. 9
The Octal number 2134 can be converted into decimal number by proceeding as follows
(2134)8 = (2 x 83) + (2 x 82) + (2 x 81) + (2 x 80)
= (2 x 512) + (1 x 64) + (3 x 8) + (4 x 1)
= 1024 + 64 + 24 + 4
= 1116
Hence (2134)8 = (1116)10
Example No. 10
The octal number 1.123 can be converted to decimal number as follows
(1.123)8 = (1 x 80) + (1 x 8-1) + (1 x 8-2) + (1 x 8-3)
= (1 x 1) + (1 x 1/8) + (1 x 1/64) + (3 x 1/512)
= 1 + 1/8 + 2/64 + 3/512
= 1 83/512
Decimal to Octal Conversion
For converting decimal number to octal number. we apply a method of repeatedly dividing decimal by 8 and use each reminder as a digit in the octal number. The process of converting decimal to octal number may be illustrated by the following example.
Example No. 11
To convert the decimal number 429 to octal number we process as follows
429/8 = 53 Reminder is 5
53/8 = 6 Reminder is 5
6/8 = 0 Reminder is 6
Hence (429)8 = (655)10
Octal to Binary Conversion
As we have mentioned earlier that octal number system is a short hand version of binary numbers and one octal represents three binary digits as shown by the following table
Equivalent Octal and Binary Number
Octal 0
1
2
3
4
5
6
7
Binary
000
001
010
011
100
101
110
111
In order to convert an octal number to a binary number we just replace each octal digit with the appropriate three bits. This produce an be explained with the help of following example
Example No. 12
(25)8 = (010101)2
Because (2)8 = (010)2 and (5)8 = (101)2 as shown by the above table.
Comments :
Post a Comment
Note: Only a member of this blog may post a comment.