- Published on
Number Systems: Binary Number, Octal Number, Decimal Number and Hexa Decimal Number
Number system is just a method of representing numbers with the help of a set of Symbols and Rules. These symbols range from 0 to 9 and are termed as digit. We know that a number is a mathematical expression that helps to count or measure objects and it helps in performing various mathematical operations. Number System comprises of multiple types based on the number of digits.
Types of Number Systems
There are different types of number systems based on the base value and the number of allowed digits. The four common types of Number System are:
- Binary number system (Base - 2)
- Ocatal number system (Base - 8)
- Decimal number system (Base - 10)
- Hexa-Decimal number system (Base - 16)
We will study each of these systems one by one in detail.
Binary Number System (Base - 2)
Binary number system is also known as Base - 2 number system. Binary number system is used to represent a number in terms of two numbers only, 0 and 1. Binary number system is very useful in computer science and in electronics because it can be easily performed using just two states ON and OFF i.e. 1 and 0.
We can convert any system into binary number system and vice versa.
Example 1: Convert Decimal number to Binary number
Decimal number are represented in base 10, but the binary numbers are of base 2. Hence, to convert a decimal number to binary number, the base of that number is to be changed. Follow the example given below:
Convert 1310 to Binary number. Devide this number repeatedly by 2 and take the remainder until the quotient becomes 0.:
- When 13 is divided by 2, the quotient is 6 and the remainder is 1.
- When 6 is divided by 2, the quotient is 3 and the remainder is 0.
- When 3 is divided by 2, the quotient is 1 and the remainder is 1.
- When 1 is divided by 2, the quotient is 0 and the remainder is 1.
Write the remainders from bottom to top.
if you have floating point decimal number, you can follow the same procedure for integer part of this number and then Mulptiply the fractional part by 2 and add the result to the integer part.
From top to bottom, Write the integer part of the results to the fractional part of the number in base 2.
Example 2: Convert Octal number to Binary number
Convert of octal to binary number is a two step process. First, we need to convert octal number into its equivalent decimal number and then convert that decimal number into binary number.
- Take given Octal number.
- Find the number of digits in the decimal.
- If it has n digits, multiply each digit with 8n-1 where the digit is in the nth position.
- Add all the numbers obtained in step 2.
- The result is the decimal number equivalent to the given Octal number. Now we have to convert this decimal to binary number.
- Divide the decimal number with binary base 2 and find the remainder.
- Repeat the steps 6 until the quotient becomes 0.
- Write the remainders from bottom to top.
another short method is to convert Octal number to binary using the following steps:
- Step 1: Convert Octal number into its equivalent decimal values.
- Step 2: Write each digit of the Octal number separately.
- Step 3: Convert each digit into an equivalent group of 3 binary bits.
- Step 4: Combine these group to form the whole binary number.
Example 3: Convert Hexa-Decimal Number to Binary Number
To convert a hexadecimal number into equivalent binary number, follow the steps given here:
- Take given hexadecimal number.
- Find the number of digits in the decimal.
- If it has n digits, multiply each digit with 16n-1 where the digit is in the nth position.
- Add all the numbers obtained in step 2.
- The result is the decimal number equivalent to the given hexadecimal number. Now we have to convert this decimal to binary number.
- Divide the decimal number with binary base 2 and find the remainder.
- Repeat the steps 6 until the quotient becomes 0.
- Write the remainders from bottom to top.
Hence, from the above steps it is clear to convert any hexadecimal number into binary, i.e. first, we need to convert hexadecimal to decimal and then convert decimal to binary.
another short method is to convert hexadecimal to binary using the following steps:
- Step 1: Convert hexadecimal number into its equivalent decimal values.
- Step 2: Write each digit of the hexadecimal number separately.
- Step 3: Convert each digit into an equivalent group of 4 binary bits.
- Step 4: Combine these group to form the whole binary number.
Ocatal Number System (Base - 8)
Octal Number System is also known as Base - 8 number system. It uses digits from 0 to 7. Octal numbers are useful for the representation of UTF-8 Numbers. Octal numbers can be converted into decimal numbers and vice versa.
Example 1: Convert Binary Number to Octal Number
- Take the given binary number
- Multiply each digit by 2n-1 where the digit is in the nth position.
- The resultant is the equivalent decimal number of the given binary number.
- Divide the decimal number by 8 and find the remainder.
- Note the remainder.
- Repeat the steps 4 and 5 until the quotient becomes less then 8.
- Write the remainders from bottom to top.
- The resultant is the equivalent octal number of the given binary number.
Another method is to convert binary to octal using the following steps:
- Step 1: Convert binary number to decimal number equivalent values.
- Step 2: Write binary number separately into groups of 3 digits starting from right to left i.e. from LSB to MSB.
- Step 3: Add zeros prior to MSB to make it a proper group of three three digits(if required).
- Step 4: Now convert these group into their relevant octal equivalent.
Example 2: Convert Hexa-Decimal Number to Octal Number
- Note down the hexadecimal number.
- Count the number of digits and note down the number of digits in the number.
- Multiply each digit with 16n-1 where the digit is in the nth position.
- Add all the numbers after multiplication.
- The result is the decimal number equivalent to the given hexadecimal number. Now we have to convert this decimal to octal number.
- Divide the decimal number by 8 and find the remainder.
- Repeat the steps 6 until the quotient becomes 0.
- Write the remainders from bottom to top.
Decimal Number System (Base - 10)
A Decimal umber system is the number system that we use only on a daily basis based on the 10 digits. It uses digits from 0 to 9. Here, each digit in the number is at specific place value a product of different powers of 10. Here the place value is termed from right to left as first place value called units, second place value called tens, third place value called hundreds, fourth place value called thousands, fifth place value called millions and so on. Here units has the place value as 100, tens has the place value as 101, hundreds has the place value as 102, thousands has the place value as 103, millions has the place value as 104 and so on.
Example 1: Convert Binary Number to Decimal Number
Binary numbers are represented in base 2 but the decimal numbers are of base 10. Hence, to convert the binary number into a decimal number, the base of that number is to be changed. Follow the steps given below:
- Step 1: Mulptiply each digit of the Binary number with the place value of that digit, starting from right to left i.e. from LSB to MSB.
- Step 2: Add the result of this multiplication and the decimal number will be formed.
Hexa-Decimal Number System (Base - 16)
The word hexadecimal comes from Hexa meaning 6, and decimal meaning 10. So, in a hexadecimal number system, there are 16 digits from 0 to 9 and letters from A to F. The letters A to F are called as hexadecimal digits. 10 is represent as A, 11 as B, 12 as C, 13 as D, 14 as E and 15 as F. Hexadecimal Number are useful for handling memory address locations.
Example 1: Convert Binary Number to Hexa-Decimal Number
Binary numbers are represented in base 2 but the Hexadecimal numbers are of base 10. Hence, to convert the binary number into Hex number, the base of that number is to be changed. Follow the steps given below:
- Step 1: Devide the binary number into groups of four digits starting from right to left i.e. from LSB to MSB.
- Step 2: Convert each group into its equivalent hexadecimal equivalent.