Number System: Learn definition, types like Binary, Octal, Decimal, Hexadecimal and conversion formula here!
A number system is a way of expressing numbers through writing. The number system is a mathematical language for consistently representing numbers in a particular set using digits or other symbols. It represents the arithmetic and algebraic structure of the figures and gives a unique representation for each number.
Numbers are used for counting/ checking/labelling objects and performing various arithmetic calculations. Examples of numbers in mathematics are natural numbers, whole numbers, rational and irrational numbers, prime and composite numbers, etc.
In this article, we will learn about the different types of number systems like binary, octal, decimal, hexadecimal, and their interconversion with solved examples.
What is a Number System?
The number system can be understood as a system of writing or expressing numbers in different forms and vice versa. For example binary, decimal, etc. The Hindu–Arabic numeral system is the most widely used, allowing any number to be represented using a combination of 10 fundamental numeric symbols known as digits. It is used in linear algebra, calculus, general mathematics, physics, etc.
History of Numbers and Number Systems
The Egyptians were the first to establish a ciphered number system, and the Greeks were the next to map their counting numerals onto the Ionian and Doric alphabets. Roman numerals, which used combinations of letters from the Roman alphabet, were popular in Europe until the late 14th century when the superior Hindu–Arabic numeral system expanded, and the Hindu–Arabic numeral system is still the most widely used system for representing numbers today.
Number System Definition
A number system presents a unique representation of numbers. It also allows users to perform arithmetic operations like addition, subtraction, and division which play an essential role in computer applications and digital domains. Learn about the basics of the number system, conversion, and implementation.
Types of Number Systems
The four common types of Number systems are
- Decimal Number System: Has base 10.
- Binary Number System: Has base 2.
- Octal Number System: Has base 8.
- Hexadecimal Number System: Has base 16.
Decimal Number System
The decimal number system, which we use every day, uses numbers 0 through 9, i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Because there are 10 numbers in this number system, the decimal number system’s base number is 10. Any number that is represented without a base has a base of 10. Each value has a power of ten place value, meaning that the digit in the tens place is 10 times bigger than the digit in the one’s place. When we get to 9, we make the rightmost number 0 and add 1 to the left, resulting in 10. We continue to move ahead and so on.
For example, the decimal number 8379 consists of the digit 9 in the unit’s or one’s position, 7 in the tens position, 3 in the hundreds position, and 8 in the thousands position. Its value can be formulated as
\((8\times1000)+ (3\times100)+ (7\times10)+ (9\times1)\)
\((8\times10^3)+ (3\times10^2)+ (7\times10^1)+ (9\times10^0)\)
\(8000 + 300 + 70 + 9\)
\(8379\)
Binary Number System
The binary number system is a Base-2 numbering system that follows the same mathematical rules as the widely used decimal or base-10 system. Instead of using powers of ten (\(10^n\)), such as 1, 10, 100, 1000, binary numbers use powers of two (\(2^n\)), effectively doubling the value of each succeeding bit as it advances, such as 1, 2, 4, 8, 16, 32, and so on.
The binary number system is used by computers to modify and store all of their data, including numbers, words, films, photos, and music. 1 + 1 = 10 since the number “2” does not exist in this system. In 1854, British mathematician George Boole published important work outlining an algebraic logic system based on the binary system, which became known as Boolean algebra.
Octal Number System
The Octal Number System is a number system with an eight-digit base with digits ranging from 0 to 7 i.e., 0, 1, 2, 3, 4, 5, 6, and 7. The term octal is used to describe numbers with an eight-digit base. Octal numbers have a wide range of uses and significance, including in computers and digital numbering systems.
Octal numbers have a wide range of applications and significance, including use in computers and digital numbering systems. When queried by ground radar, aeroplane transponders broadcast a “squawk” code, which is expressed as a four-octal-digit number. On the radar screen, this code is used to identify different aircraft.
Learn the various concepts of the Binomial Theorem here.
Hexadecimal Number System
Hexadecimal is made up of two words: ‘Hexa’ and ‘deci’, where ‘Hexa’ means six and ‘deci’ indicates ten. The hexadecimal number system is a 16-digit representation of integers 0 through 9 and letters A through F. To put it another way, the first 9 digits or numerals are represented as numbers, while the next 6 digits are represented as symbols from A to F. The hexadecimal number system is extremely similar to the decimal number system, which has a base of nine. After nine numbers, the tenth digit is represented by a symbol: 10 as A, 11 as B, 12 as C, 13 as D, 14 as E, and 15 as F.
The Base16 transfer encoding uses the hexadecimal system to divide each byte of plaintext into two 4-bit values and two hexadecimal digits. Because they give a human-friendly representation of binary-coded data, hexadecimal numbers are widely employed by software engineers and system designers. Four bits (binary digits) are represented by each hexadecimal digit, also known as a nibble (or nybble).
Number System Chart
Here’s a handy table that shows the values of various numbers in the four number systems.
Decimal | Binary | Octal | Hexa |
1 | 1 | 1 | 1 |
2 | 10 | 2 | 0 |
3 | 11 | 3 | 2 |
4 | 100 | 4 | 3 |
5 | 101 | 5 | 4 |
6 | 110 | 6 | 5 |
7 | 111 | 7 | 6 |
8 | 1000 | 10 | 7 |
9 | 1001 | 11 | 8 |
10 | 1010 | 12 | 9 |
11 | 1011 | 13 | A |
12 | 1100 | 14 | B |
13 | 1101 | 15 | C |
14 | 1110 | 16 | D |
15 | 1111 | 17 | E |
16 | 10000 | 20 | F |
17 | 10001 | 21 | 10 |
18 | 10010 | 22 | 11 |
19 | 10011 | 23 | 12 |
20 | 10100 | 24 | 13 |
Summary
Here’s the summary of what we just learned about the four number systems
S.No. | Number System with Description |
1 | Binary Number System The base is 2. Digits used : 0, 1 |
2 | Octal Number System The base is 8. Digits used : 0 to 7 |
3 | Hexadecimal Number System The Base is 16. Digits used: 0 to 9, Letters used: A- F |
With a clear knowledge of the numbers system, let’s proceed towards the conversion of one form to another.
Conversion in Number System
The number systems decimal, binary, octal, and hexadecimal are all positional value number systems. To convert a binary, octal, or hexadecimal number to a decimal number, just multiply each digit by its positional value. We’ll learn how to convert between various number systems in this section.
Decimal to Binary
By repeatedly dividing a number by two and recording the result, decimal values can be transformed into binary. Steps to be followed:
Conversion of Integer Decimal Numbers to Binary
- Divide the number by 2.
- Get the integer quotient for the next iteration.
- Get the remainder for the binary digit.
- Repeat the above steps until the quotient is equal to 0.
Solved Example
Let’s convert 29 to Binary
We repeatedly divide 29 by 2 till we get 0 reminders.
Dividend | Divisor | Reminder |
2 | 29 | 1 |
2 | 14 | 0 |
2 | 7 | 1 |
2 | 3 | 1 |
2 | 1 | 1 |
2 | 0 | — |
We read the reminder in reverse order. So \(29_{10} = 10111_{2}\)
Next is the conversion of the fraction part.
Conversion of Fractional Decimal Numbers to Binary
A fraction is made of a whole part and a decimal part. For the conversion of the whole part to binary follow the same steps as mentioned above. For the fractional part, follow the steps below:
- Multiply two to the fractional part of the decimal number.
- The whole part of the product is our binary equivalent.
- Step 1 is repeated using only the fractional part of the decimal value, followed by step 2.
- The binary number is found for some significant digits.
Also, read about Relations and Functions here.
Solved Example
Let’s convert 29.188 in Binary to 5 significant digits. We have already converted 29 to binary above. Let’s work on the fractional part.
— | Binary |
0.188 x 2 = 0.376 | 0 |
0.376 x 2 = 0.752 | 0 |
0.752 x 2 = 1.504 | 1 |
0.504 x 2 = 1.008 | 1 |
0.008 x 2 = 0.016 | 0 |
We have reached 5 significant digits. So we stop here. So \(43.188_{10} = 101011.00110_{2}\)
Decimal to Octal
By repeatedly dividing a number by 8 and recording the result, decimal values can be transformed into octal. Steps to be followed:
Conversion of Integer Decimal Numbers to Octal
- Divide the number by 2.
- Get the integer quotient for the next iteration.
- Get the remainder for the octal digit.
- Repeat the above steps until the quotient is equal to 0.
Solved Example
— | Quotient | Reminder |
43/8 | 5 | 3 |
5/8 | 0 | 5 |
We read the reminder in reverse order. So \(43_{10} = 53_{8}\)
Next is the conversion of the fraction part.
Note: The dividend (here given decimal number) is the number to be divided, the divisor (here base of octal, i.e., 8) is the number to be divided by, and the quotient (remaining divided decimal number) is the outcome of the division.
Conversion of Fractional Decimal Numbers to Octal
If the decimal fractional component is M, multiply it by 8 because the octal number system’s base is 8. For the fractional part, follow the steps below:
- Multiply 8 to the fractional part of the decimal number.
- The whole part of the product is our octal equivalent.
- Step 1 is repeated using only the fractional part of the decimal value, followed by step 2.
- The octal number is found for some significant digits.
Solved Example
Let’s convert 43.188 in Octal to 5 significant digits. We have already converted 43 to octal above. Let’s work on the fractional part.
— | Octal |
0.188 x 8 = 1.504 | 1 |
0.504 x 8 = 4.032 | 4 |
0.32 x 8 = 2.56 | 2 |
0.56 x 8 = 4.48 | 4 |
0.48 x 8 = 3.84 | 3 |
We have reached 5 significant digits. So we stop here. So \(43_{10} = 53.14243_{8}\)
Decimal to Hexadecimal
By repeatedly dividing a number by 16 and recording the result, decimal values can be transformed into hexadecimal. Steps to be followed:
Conversion of Integer Decimal Numbers to Hexadecimal
- Divide the number by 16.
- Get the integer quotient for the next iteration.
- Get the remainder for the hexadecimal digit.
- Repeat the above steps until the quotient is equal to 0.
Solved Example
Let’s convert 765 to Hexadecimal
We repeatedly divide 765 by 16 till we get 0 reminders.
— | — | Reminder |
16 | 765 | E |
16 | 56 | 8 |
16 | 3 | 3 |
16 | 0 | — |
We read the reminder in reverse order. So \(765_{10} = 38E_{2}\)
Next is the conversion of the fraction part.
Conversion of Fractional Decimal Numbers to Hexadecimal
If the decimal fractional component is M, multiply it by 16 because the hexadecimal number system’s base is 16. For the fractional part, follow the steps below:
- Multiply 16 to the fractional part of the decimal number.
- The whole part of the product is our hexadecimal equivalent.
- Step 1 is repeated using only the fractional part of the decimal value, followed by step 2.
- The hexadecimal number is found for some significant digits.
Solved Example
Let’s convert 765.565 in Hexadecimal to 5 significant digits. We have already converted 765 to Hexadecimal above. Let’s work on the fractional part.
— | Hexadecimal |
0.565 x 16 = 9.04 | 9 |
0.04 x 16 = 0.64 | 0 |
0.64 x 16 = 10.24 | 10 = A |
0.24 x 16 = 3.84 | 3 |
0.84 x 16 = 13.44 | 13 = D |
We have reached 5 significant digits. So we stop here. So \(765.565_{10} = 90A3D_{2}\)
Know more about Sequences and Series here.
Binary to Decimal Conversion
To convert a binary number to a decimal number, follow the steps below:
- Count the number of digits in the binary number.
- Starting from the left start multiply the first digit of the binary number by 2 raised to the power of the number of digits.
- Decrease the exponent as you move to the left.
- Add all the digits together.
Here’s the general formula to convert a binary number to a decimal number.
decimal=\(b_n\times2^n+b_{n-1}\times2^{n-1}+b_{n-2}\times2^{n-2}+…\)
Solved Example
Let’s convert \(111001_2\) to decimal.
\(111001_2 = 1\times2^5+1\times2^4+1\times2^3+0\times2^2+0\times2^1+1\times2^0 = 5710\)
Binary to Hexadecimal Conversion
There is no direct method to convert Binary to Hexadecimal. We first convert the binary number to decimal and then convert the decimal number to binary by using the steps we learned above.
The second method to convert Binary to Hexadecimal is by grouping the numbers in a series of 4 from left to right and using the conversion table to convert them to hexadecimal.
Solved Example
Let’s convert \((11111111)_2\) to hexadecimal.
\(= (11111111)_2\)
\(= (1111)(1111)\)
\(= (15)(15)\)
\(= (ff)_16\)
Learn more about Lines of Regression here.
Binary to Octal Conversion
Just like binary to hexadecimal conversion, there is no direct method to convert from binary to octal. We again rely on binary to decimal and decimal to octal. Both of these methods have been already discussed.
The second method is the grouping method. Much like we did in the case of hexadecimal we group the binary numbers in a series of three from left to right. Then we use the conversion chart to convert it into an octal number.
Solved Example
Let’s convert \((101010101)_2\) to octal
\(= (101010101)_2\)
\(= (101)(010)(101)\)
\(= (525)_8\)
Octal to Decimal Conversion
To convert a number from octal to decimal, follow these steps:
- Count the number of digits.
- Starting from the left multiply the octal number by 8 raised to the power of the number of digits in the octal number.
- Decrease the exponent as you move to the left.
- Add all the digits together.
Here’s the general formula to convert an octal number to a decimal number.
decimal=\(o_n\times8^n+o_{n-1}\times8^{n-1}+o_{n-2}\times8^{n-2}+…\)
Solved Example
Let’s convert \(16512_8\) to decimal.
\(16512_8 = 1\times8^4+6\times8^3+5\times8^2+1\times8^1+0\times8^0 = 7498\)
Octal to Binary Conversion
It takes two steps to convert an octal number to a binary number. We must first convert the given octal number to its decimal counterpart, then convert the decimal to binary. We have already learnt about those processes.
Octal to Hexadecimal Conversion
We can convert octal to hexadecimal by two indirect methods. The first method involves converting the octal number to a decimal number and then we convert the decimal number to hexadecimal. The second is to convert the octal number to binary and then convert it to hexadecimal. Since there is no direct method to convert octal to binary we avoid the second method. Both of these methods are discussed in the sections above.
Hexadecimal to Decimal Conversion
To convert a number from hexadecimal to decimal, follow these steps:
- Count the number of digits.
- Convert the alphabets into equivalent numbers as shown in the Number System Table above.
- Starting from the left multiply the hexadecimal number by 16 raised to the power of the number of digits in the hexadecimal number.
- Decrease the exponent as you move to the left.
- Add all the digits together.
Here’s the general formula to convert an octal number to a decimal number.
decimal=\(h_n\times16^n+h_{n-1}\times16^{n-1}+h_{n-2}\times16^{n-2}+…\)
Solved Example
Let’s convert \(A37E_{16}\) to decimal.
\(A37E_{16} = A\times16^3+3\times16^2+7\times16^1+E\times16^0 \)
\(A37E_{16} = 10\times16^3+3\times16^2+7\times16^1+14\times16^0 \)
\(= 41854\)
Hexadecimal to Binary Conversion
To convert the hexadecimal number into binary no direct method exists. We use the intermediate of the decimal number system by converting hexadecimal to decimal as shown above and then converting the decimal to binary as discussed in previous sections.
Hexadecimal to Octal Conversion
We again do not have a direct method to convert from hexadecimal to octal and resolve to the use of decimal system by converting hexadecimal to decimal as shown above and then convert the decimal to octal as discussed in previous sections.
Learn about Sum of Squares of First n Natural Numbers & Decimals in Daily Life
Solved Examples on Number System
Here are some solved examples on number system to help you for practice.
Solved Example 1: Convert 43.01 to binary till 7 significant digits.
Solution: First lets consider the whole number part. We repeatedly divide 43 by 2 till we get 0 remainder.
Dividend | Divisor | Reminder |
2 | 43 | 1 |
2 | 21 | 0 |
2 | 10 | 1 |
2 | 5 | 0 |
2 | 2 | 1 |
2 | 1 | 1 |
2 | 0 | — |
Now for the fractional part of .01 we start multiplying it by 2.
– | Binary |
0.1 x 2 = 0.2 | 0 |
0.2 x 2 = 0.4 | 0 |
0.4 x 2 = 0.8 | 0 |
0.8 x 2 = 1.6 | 1 |
0.6 x 2 = 1.2 | 1 |
0.2 x 2 = 0.4 | 0 |
0.4 x 2 = 0.8 | 0 |
So \(43.01_{10} = 101011.0001100_{2}\)
Solved Example 2: Convert 473.05 to binary till 5 significant digits.
Solution:
First let’s consider the whole number part. We repeatedly divide 473 by 8 till we get a quotient of 0.
— | Quotient | Reminder |
473/8 | 5 | 1 |
59/8 | 7 | 3 |
7/8 | 0 | 7 |
Now for the fractional part of .05 we start multiplying it by 8.
— | Octal |
0.5 x 8 = 0.2 | 0 |
0.40 x 8 = 3.20 | 3 |
0.20 x 8 = 1.60 | 1 |
0.60 x 8 = 4.80 | 4 |
0.80 x 8= 6.4 | 6 |
So \(473.05_{10} = 731.03146_{2}\)
Number System FAQs
Binary Number System: Has base 2.
Octal Number System: Has base 8.
Hexadecimal Number System: Has base 16.