Number Systems and Conversion
Different Types of Number System and Conversion with Examples– in this article you will learn about number conversion in detail. The following four numbers system are most commonly used in all digital circuits.
Decimal Number System
We come across this kind of number system in our day-to-day activities. Its base or radix tends to be 10, which means that this kind of number system reflects numbers through the use of 10 different symbols (that’s to say a total of 10 numbers from 0 to 9)
Binary Number System
Its base is two that’s only two different symbols or digits are used in this kind of a system
Octal Number System
Its base is 8, that’s eight different symbols (ranging between 0 – 7) are used in this system for the purpose of counting
Hexadecimal Number System
The base number of this type of system is 16 that’s 16 different symbols (from 0-15) are used in this system
Decimal Number System
The decimal Number System is a number system with which a common man is most frequently acquainted and which is the most widely used and easily comprehensible system prevalent throughout the world. First of all, human beings make use of ten figures for counting items, denoting numbers, and keeping an account of different quantities, and this simple mechanism is the base of this system.
Base or Radix
The base or radix of a decimal system is 10, which means that this system consists of 10 symbols or digits from 0 to 9. Under this system, specific quantities are reflected through writing numbers from 0 to 9 by means of different methods or styles. Through this system, even an illiterate person can easily be made to understand the quantities of different things. This system is deeply engrossed in our day-to-day affairs due to being simple and easily understandable. It has to be kept in mind that digital numbers are used to represent those quantities, which remain outside the digital system.
The absolute value of each decimal digit is fixed; however, its position value or weight is determined with respect to its position or place amongst the overall numbers. (In other words, every digit in a number has a definite value with respect to its position or place and the overall value of any quantity is assessed through the digits and their positions) For example, the position value of 3 in 3000 overall numbers is not the same as in 300 (that’s the position value of 3 in 3000 and 300 cannot be equal). Further, the position value of every 4 in the number 4444 is totally different, as has been displayed in the table
|Four Thousand||Four Hundred||Forty||Four|
Similarly, the decimal number 2573 can also be mentioned as follows by means of breaking or bifurcating it;
Remember that 3 is the least significant digit (LSD) whereas 2 is the most significant digit (MSD) in this number. Moreover, in order to ascertain the total value of any number, every digit in the number is multiplied and added with respect to its position value (i.e. unit, decade, hundred, thousand etc.) or position weight.
The example given above represents an integer or whole number (e.g. 4444 and 2573). However, sometimes it becomes necessary to denote a whole number in its fractional form as well apart from its representation as a whole integer. For example, the decimal point in the number 2573.469 inter- bifurcates whole number 2573 and the fraction .469. This number can also be mentioned as follows:
Thus, decimal fractions are fractional numbers the weight position of which is determined according to the negative power of 10, which starts from 10-1 and gets decreasing from left to right i.e.
0.1=1/10=10-1, 0.01=1/100=10-2, 0.001=1/1000=10-3
Further, powers are being numbered in such a manner that numbers towards the left of decimal digit start from 100, while the fractional numbers towards the right of decimal point start with 10-1 (that’s to say the whole number is found towards the left of the decimal point, and its weight is expressed generally as unity, tens, hundreds and thousands, whereas the fractional part of this number is located towards the right of this decimal point and its weight is represented as 1/10, 1/100 and 1/1000 etc.) Remember that sum of whole digits obtained from the multiplication of a digit with its position weight, reflects the total value of that particular decimal number.
Binary Number System
Modern digital electronics is related to circuits, which consist of just two possible states. A number system that comprises two states, is known as a binary number system (bi means two). The binary system of numbers is capable of just two numbers (i.e. zero or 1) and it is being broadly used in digital electronics these days. As this system consists of only two digits or bits, therefore it is simple, relatively easy, and less complicated as compared to a decimal system. However, most people remain unfamiliar with the system and that’s the reason they find it a bit difficult. (Remember that a digit may simply be termed as a bit in a binary system). By means of arranging the two binary numbers or bits (0 and 1) being used in the binary number system, any decimal number can be represented through this system. It needs to be kept in mind that a binary number system has greater advantages as compared to a decimal number system. Because, any electronic component or electronic circuit, which has just two states or levels, is obviously simple, more speedy, cheap, and more reliable than the one which has ten states or levels. That’s the reason when digital components and circuits are being fabricated, the binary system is preferred as a result of its numerous merits. The bit 1 in any digital system signifies a digital transistor (or a transistor which fully conducts), an “on” light, and energized relay, and a specifically oriented magnet. On the contrary, bit 0 reveals a cut-off transistor, an off light, a non-energized relay, or an inversely fixed magnet.
Base or Radix
We know that number of digits in a particular number system can be determined through its base, by means of which different quantities can be expressed. The base of a binary system is 2 as the different numbers under this form of numbering system are represented either by 0 or1 (or in other words just two digits 0 and 1 are used in this type of system). All binary numbers are found in the shape of a string of 0s and 1s. For example, 10, 101, and 1011, etc., the reading procedure of which is as follows (remember that this procedure of reading the binary numbers is completely different from the process of decimal numbers reading)
10 … one-zero
101 … one- zero- one
1011 … one- zero- one- one
In order to make a distinction between the decimal numbers and binary numbers (so that they could be easily identified) 10 is mentioned below the decimal numbers while 2 is written under the binary numbers i.e.
1010 10110 547210 … Decimal Numbers
102 1012 1100012 … Binary Numbers
It is evident from the aforementioned example that figures or digits mentioned below the decimal or binary numbers, are in fact decimal by themselves. Furthermore, it also has to be kept in mind that as the base of the binary numbers is small, therefore they require relatively more space for the purpose of counting.
The position or place of 0 and 1 in a binary number reflects its weight or value in that particular number, just similar to the position of a decimal digit signifies a digit or its bit’s value. The weight in a binary number depends on the power of 2 (that’s the position value of every bit is determined according to some power of 2). In order to determine the overall value of any number, every digit in the number is multiplied by its position value and then summed up together.
Similar to a decimal system, the position of every digit or bit in the binary system has a specific weight, therefore the weight of every position under this system increases from the right to the left. The weight of every position is double the weight of the number lying towards its right i.e.
1=20, 2=21, 4=22 and 8=23 etc.
Remember that in order to ascertain the value of quantity represented through any number, every bit is multiplied by its position value or its position weight and subsequently they are added together. For instance, the binary number 110101 can also be mentioned as follows:
1101012= (1×25) +(1×24) +(0x23) +(1×22) +(0x21) +(1×20)
The binary fractional numbers can also be presented by putting bits or digits towards the right of the binary point, just similar to placing fractional decimal digits towards the right of a decimal point in the decimal number system. In the case of a binary fractional number, the bit towards the leftist side, the weight of which is approximately 2-1=0.5, is termed as the most significant bit. These fractional weights tend to subside from the left to right direction by means of putting a negative power of 2 above every bit. The weighting structure of a binary is as below:
2n-1 … 23 22 21 20 Binary Point 2-1 2-2 … 2-2 … 2-n
Here, n means the number of bits from the binary points. Thus, the weights of all the bits towards left side of the binary point consist of a positive power of 2. However, weights of all the bits lying towards the right of the binary point, consist of fractional weights or negative power of 2 (that’s weights of fractional numbers in fractional binary numbers are set according to the minus power of 2). In the table (1.1), an 8-bit binary whole number and a 6-bit binary fractional number have been represented by a power of 2 (plus and minus) along with equivalent decimal weights. The table clearly indicates that weight gets doubled for every positive power of 2, whereas weight gets half for each negative power of 2.
Table (1.1) Binary Weights
Positive Powers of Two (Whole Numbers) Negative Powers of Two (Fractional Numbers)
For example, binary fraction 0.1101 may be represented as follows:
0.1101= (1×2-1) + (1×2-2) + (0x2-3) + (1×2-4)
For further explanation, a 7-bit binary number 1101.011 has been illustrated via figure (1.4) along with the position value or position weight of every bit.
Figure (1.4) 7-bit binary number along with the position value (or weight) of each bit.
The power of each binary number as illustrated in the above figure surges by a power of 2 towards the left of the binary point starting from the position value 20 to 23. Whereas, the position value declines towards the right of the binary point, starting from 2-1 to 2-3. It is visible from the figure that the weight of the 4th bit towards the left of the binary point is maximum (that its value is maximum), therefore it is known as an MSB (Most Significant Bit). Similarly, the value of the 3rd bit lying towards the right of the binary point, is minimum. It is therefore called LSB (Least Significant Bit).
The decimal number of aforementioned binary numbers can be determined as follows:
1101.0112= (1×23) + (1×22) + (0x21) + (1×20) + (0x2-1) + (1×2-2) + (1×2-3)
= 8+4+0+1+0+1/4+1/8= 13.37510
Conversion between Binary & Decimal Number System
While working on the digital circuits and components, a need is often felt about the conversion of binary numbers into decimal numbers and decimal numbers to binary numbers. Therefore, it is imperative that the process of inter-conversion be understood completely, which has been elaborated as follows:
Binary to Decimal Number Conversion
The following technique must be adopted for the conversion of a given whole number (integer) into its equivalent decimal numbers.
I). First of all, write down the binary number i.e. write the entire bits of a binary number in one row.
II). Write down 1, 2, 4, 8, 16, etc. from right to the left, exactly beneath the bits.
III). Cross out the decimal weights below 0 bits, because when a digit is multiplied with zero, its value also turns out to be zero.
IV). Add up the remnant weights. The number arrived at as such, would be an equivalent decimal number.
V). In case of conversion from a binary fraction to decimal fraction, the same binary technique is being employed, except that the following weights are being used for different bit positions.
2-1 2-2 2-3 2-4
½ ¼ 1/8 1/16
Example 1). Convert 110012 to its equivalent decimal number
The four steps involved in the conversion as under:
Step 1. 1 1 0 0 1
Step 2. 16 8 4 2 1
Step 3. 16 8 0 0 1
Step 4. 16 + 8 +1 = 25
Thus, 11011 = 2510 (Ans)
Different decimals and equivalent binary numbers, have been given in the table (1.2)
Example 2). Convert the binary fraction 0.101 to its decimal equivalent
Step.1 0 1 0 1
Step.2 ½ ¼ 1/8
Step.3 ½ 0 1/8
Step.4 ½ + 1/8 = 4+1/8 = 5/8 =
Thus, 0.101= 0.62510 (Ans)
Example.3: Find the decimal equivalent of the 6-bit binary number 101.1012.
1 0 1 . 1 0 1
4 2 1 . ½ ¼ 1/8
4 0 1 . ½ 0 1/8
4 + 0 + 1 . ½ + 0 + 1/8
5+1/2+ 1/8= 5+5+ 4+1/8 = 5+5/8 = 5.6254
101.1010 = 5.62510 (Ans)
Decimal to Binary Number Conversion
The most convenient technique being employed for the conversion of whole decimal numbers or integers to binary numbers, has been to divide the decimal number repeatedly by 2. The digits which are left behind as a result of this division process (referred to as remainders) should be noted side by side. Finally, write down remainders in a reverse order side by side or from bottom to the top. It should be inculcated in mind that this mechanism adopted for conversion from decimal to binary is known as “Double-Dabble Method” or “Divided-by-Two” method.
Example. 4 Convert (3010) into its binary equivalent
All the remainders are our binary answers
:. (3010) = (11110)2
Example.5 Convert (25)10 into binary
25/2 = 12 + remainder of 1
12/2 = 6 + remainder of 0
6/2 = 3 + remainder of 0
3/2 = 1 + remainder of 1
½ = 0 + remainder of 1
Reading the remainders from bottom to top, we get
2510 = 110012 (Ans)
Decimal Fraction to Binary Number Conversion
Under such type of a scenario, the multiply-by-two rule is being employed instead of dividing the number by 2. That sum total or carry of every 2-bit receivable by means of multiplying the same by 2, is noted down properly. Afterward, we get a desired binary fraction by writing these carriers in a forward direction (or from top to bottom) in a row. Remember that in case, the integer position (that’s towards the left side of the decimal point) is zero, we will have to consider the carrying value as zero (0) as well.
Example. 6 Convert 0.812510 into its binary equivalent
0.8125×2=1.625=6.25 with a carry of 1
0.625×2=1.25=0.25 with a carry of 1
0.25×2=0.5=0.5 with a carry of 0
0.50×2=1.0=0.0 with a carry of 1
Remember that we have included the binary point in answer at our own.
Example.7 Convert 25.62510 into its binary equivalent
|a). Integer||a). Fraction|
Thus, 2510= 110012 0.62510=0.1012
Taking into consideration the whole number, we have 25.62510=110012 (Ans)
Octal Number System and Conversion:
As compared to a binary or hexadecimal, the octal system is comparatively rarely used in computers and microprocessors. However, just like a hexadecimal system, the octal system is also an easy method for the expression of binary numbers and codes.
Octal means 8. Thus, an octal number as the name suggests is a summation or total of 8 digits i.e.
0, 1, 2, 3, 4, 5, 6, 7
The largest digit in an octal system is 7, which is equivalent to (1112) in terms of binary. It means that the largest of octal numbers consists of 3-bits. In case there is some urgency to count above 7, we have to initiate a new column for the purpose under the octal system.
i.e. 10, 11, 12, 13, 14, 15, 16, 17, 20, 21
The counting in an octal system is carried out in way which is quite analogous to the decimal system, except that its digits 8 and 9 are not used (i.e. 8, 9 digits are crossed out in octal system of counting). In order to distinguish between octal number from a decimal number or hexadecimal number, 8 has always to be mentioned with an octal number e.g. 158 etc. it needs to be remembered here that all digits ranging from 0-7 in an octal system, have the same physical significance, which they have in the decimal number system (i.e. by 2 we mean 2 and by 5 we mean 5).
In other words, the base of an octal number system is 8, which implies that system has 8 specific counting digits or alternatively, 8 digits are used under this type of a system (0-7). The significance of a decimal type digit’s system and that of an octal type system is precisely same.
Under the octal system, the positive value or the weight position of every digits, can be demonstrated via different powers of 8, as has been shown below:
83 82 81 80 . 8-1 8-2 8-3
For example, the decimal octal point of an octal 352 is as under:
3 5 2 . 0
82 81 80
64 8 1 =3×64+5×8+2×1=23410
One of the greatest advantages of an octal system is that its numbers are one-third (1/3) in length as compared to binary numbers. Therefore, from the viewpoint of a computer operator, it is quite easy for an operator to control or handle the input-output data of a digital computer in a situation of octal numbers. Moreover, the generated prints are more comprehensive and as such also tend to be readable. Further, conversion from binary to octal and octal to binary may be carried out quite quickly and effortlessly.
Octal to Decimal Number Conversion
Example. 8 Convert the actual 127.24 into the decimal equivalent number
Decimal to Octal Number Conversion
Example.9 Convert 17510 into octal equivalent
175+8=21 with 7 remainder
21+8=2 with 5 remainder
2+8=0 with 2 remainder
Taking the remainder in the reverse order, we get 2578.
Thus, 17510=2578 (Ans)
Example.10 Convert decimal fraction 0.15 into its octal equivalent
0.15×8=1.20=0.20 with a carry of 1
0.20×8=1.60=0.60 with a carry of 1
0.60×8=4.80=0.80 with a carry of 4 etc.
Taking the carriers in the forward direction,
Thus, 0.1510=0.1148 … (Ans)
Binary to Octal Number Conversion
The simplest of techniques being adopted for the conversion from binary to octal numbers, is known as “binary-triple method”. According to this method, a binary number is arranged within a probable group of 3-bits beginning from its octal point, then every group is converted into its equivalent octal number. Remember that zeros (0s) can be added to the incomplete group if necessary, through forming numerous groups of 3-bits each.
Example.11 Convert binary number 1011.01101 into its octal.
Start at the binary point and working both ways, separate the bits into groups of three when necessary. Add zeros (0s) to complete the outside groups. Then convert each group of 3 into its binary equivalent.
1011.01101→ 001 011.011 010
↓ ↓ ↓ ↓
1 3 3 2
Thus, 1011.011012=13.328 … (Ans)
Octal to Binary Number Conversion
This method of conversion from octal to binary is entirely different from the one being used for the conversion of binary to octal. That’s every digit of a given octal number is converted into an equivalent binary triplet. It is worth remembering here that a number of digits in octal numbers is one-third (1/3) of the digits in an equivalent binary number.
Example. 12 Convert 758 and 74.5628 into their binary equivalents.
(i) 7 5
Thus, 758 = 1111012 … (Ans)
(ii) 7 4. 5 6 2
↓ ↓ ↓ ↓ ↓
111 100. 101 110 010
74.5628=111100.1011100102 … (Ans)
Hexadecimal Number System and Conversion:
A hexadecimal number system as its name suggests, comprises 16 digits, due to this very reason it is called a hexadecimal system. The first ten digits from 0 to 9 in this system are decimal whereas, the remaining 6 digits (i.e. 10 – 15) are denoted by capital alphabets characters (A to F). The largest number in hexadecimal tends to be F=15 which is equivalent in binary to 11112. It clearly replicates, that it consists of a total of four bits. Thus, whenever binary numbers are required to be converted to hexadecimal numbers, we form groups of 4-bits each (as each hexadecimal digit represents a four-digit binary number). In table 1.3, hexadecimal digits have been represented via corresponding decimal and binary digits.
As this system is easy and comparatively short as compared to other number systems, therefore it is enormously used in microprocessor tasks (or computer field). Suppose we have binary word 101000100101. As this word has been generated in computers’ language, therefore it is quite hard to read and write its values. In the hexadecimal system, this word is equivalent to (A25)16, which can be read, written or spoken relatively easily. That’s the reason, hexadecimal system is being broadly used in day-to-day computer technology. After reaching F, for further counting purposes 2-digits combination method is used in hexadecimal system. Under this method, the second digit (i.e. 1) is combined with the first digit (i.e. 0) in order to make it 10, which represents 16 in decimal. Exactly in the similar fashion, second digit is combined with the third one and so on. This has been illustrated vide table 1.4
In short, the hexadecimal system has the following characteristics
1). This system consists of a base of 16 (which means that the system consists of 10 arithmetic digits (i.e. 0 to 9) and 6 alphabetic characters (A to F), thus, the system consists of total of 16 digits)
2). In the case of integers (whole numbers), the weight of every digit is expressed in ascending power form, whereas, in the case of fractions, it is expressed as descending power of 16
3). As compared to binary numbers, hexadecimal numbers are relatively short
4). These numbers can be read, written and memorize quickly
5). In case required, these numbers can easily be converted to binary through a slight application of mind
6). It is quite convenient to work with hexadecimal type numbers as compared to its equivalent binary numbers. By means of an easy conversion technique, the hexadecimal system is widely used for articulating binary numbers in programming print-outs and displays.
Binary to Hexadecimal Number Conversion
The method used for the conversion of binary numbers to hexadecimal numbers is really an easy one. For this purpose, first of all, given binary number is being divided into 4-bit groups starting from the rightmost bit. If necessary, we can also include 0s as well for completing the 4-bit group. After this, as per detail provided in the table 1.3, every 4-bit binary group is converted to its equivalent hexadecimal value. The number so attained, will be a complete hexadecimal number.
Example. 13 Convert the following binary numbers into hexadecimal
a). 100011002 b)10110101112
a). 1000 1100 (b) 0010 1101 0111
↓ ↓ ↓ ↓ ↓
8 C 2 D 7
Thus, 100011002 = 8C16 10110101112 = 2D716 … (Ans)
Note: Here two 0s have been added to complete the 4-bit groups
Hexadecimal to Binary Number Conversion
The procedure adopted for the conversion of hexadecimal to binary is absolutely opposite to the method being employed for the conversion of binary to hexadecimal (as mentioned above). Thus, in order to convert hexadecimal to binary, every hexadecimal symbol or digit is converted into an equivalent 4-bit binary. This has been illustrated vide the following example.
Example. 14 Determine the binary numbers for the following hexadecimal numbers
(a). 23A16 (b). 10A416
a). 2 3 A
↓ ↓ ↓
0010 0011 1010 Thus, A16= 0010001110102 (Ans)
b). 1 0 A 4
0001 0000 1010
10A416 = 10000101001002 (Ans)
Note; In part b, MSB (maximum significant bit) is understood to have three zeros preceding it, thus forming a 4- bit group.
Decimal to Hexadecimal Number Conversion
There are two methods that are being used for the conversion of decimal numbers to hexadecimal. In the first method, after conversion from decimal to binary (according to the procedure mentioned above by a table), the same binary is then converted to hexadecimal. The second method is called hex-dabble, which is exactly analogous to the double-dabble method (according to this method, a given decimal number is divided continuously by 2) with the only exception being that here we divide a decimal number continuously by 16 instead of 2. As the second method is comparatively easy and short than the first method, therefore the second method is mostly being utilized for attaining most of the objectives. This has been illustrated with the help of an example given below:
Example. 15 Convert decimal 1983 into hexadecimal
1983/16 = 123+15 → F
123/16 = 7+11 → B
7/16 = 0+7 → 7
Hence 198310= 7BF16 … (Ans)
Hexadecimal to Decimal Number Conversion
Two methods are being resorted to for conversion from hexadecimal to decimal numbers. According to the first method, a given hexadecimal number is converted into binary and then this binary is converted to a decimal number. In the second method, the value of every hexadecimal digit is multiplied by its weight for the conversion of a hexadecimal number to its equivalent decimal (i.e. 16). Thereafter, hexadecimal digits and all of their weighted multiplied values are added together in order to arrive at an equivalent decimal number. It should be remembered that weights of the hexadecimal numbers increase by a power of 16 from right to left.
Example. 16 Convert 1C16 hexadecimal number to decimal
0001 1100 = (24x1) + (23x1) + (22x1) + (0x21) + (020)
= 22 + 23 + 22 = 16 + 8 + 4 = 2810 (Ans)
Example. 17 Convert F6D9 to decimal.
F6D9 = F (163) + 6 (162) + D (161) + 9 (160)
= 15×163 + 6×162 + 13×161 + 9×160
= 61440 + 1536 + 208 + 9
= 6319310 … (Ans)