## Number System - a Definition:

A Number system can be understood as an ordered set of specific symbols to represent the quantitative behavior or property of any system. So far you might have heard of Binary, Decimal & Hexadecimal number system. A single quantity can be represented in all of these systems. The only difference between these number systems is radix or base or the count of digits. We know that to represent a number we need symbolic representation known as digits. The total no of distinct digits in any number system is known as the radix or the base of that number system.

A common question can arise that we can have many values for radix and thus many no. of the Number system, so why are we using binary or decimal or hexadecimal the most. Why not any other system? If we try to understand it we can see that the decimal number system has the base 10 so in this system, the no of digits is perfect to be represented on our ten fingers. That is why we are using the decimal number system for such a long time. Talking about binary, with the age of computers it became a necessity to understand binary as computers can operate on binary digits only. To create a link between binary and decimal, hexadecimal was introduced. The minimum bits in binary required to denote the decimal is 4 but with 4 bits we can denote 16 different digits and this is how hexadecimal came in the picture. Using 4 bits to denote 10 digits was the waste of the other 6 digits and this loss in memory efficiency as well as computation. With the help of Hexadecimal numbers, we can represent larger digits with fewer digits.

### The Decimal Number System:

The decimal number system is the number system with radix(base) equal to 10. In any number system, there are two things face value and place value. Consider a number 245, we can write this number in the weighted form as:

245 = (2 x 100) + (4 x 10) + (5 x 1) In the above example, we multiply the face value 2 with the weight of the place, which is 100 to give the place value as 100.

### The Hexadecimal Number System:

As the name suggests, this number system is based on base 16 system. In this number system, we have 16 distinct digits, which are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. This number system is preferred for most of the computer storage and programming because it is the perfect fit between decimal and binary number systems.

## How to convert Hexadecimal Numbers into Decimal Numbers:

Let's take 7846F as Hexadecimal and convert it into a decimal by going through the following steps:

**Step 1: ** Mark the index to each digit in the hexadecimal number.

Hexadecimal | 7 8 4 6 F |

Index | 4 3 2 1 0 |

**Step 2: ** Replace the digits with decimal equivalent values.

Hexadecimal value in Decimal | 7 8 4 6 15 |

Index | 4 3 2 1 0 |

The correct mapping between digits and decimal values is the following one:

A | B | C | D | E | F |

10 | 11 | 12 | 13 | 14 | 15 |

**Step 3: ** Now multiply each digit of the hexadecimal number with 16 raised to the power of their respective index to get the place value in decimal.

Place value of F = 15 x 1 = 15

Place value of 6 = 6 x 16 = 64

Place value of 4 = 4 x 16 x 16 = 1024

Place value of 8 = 8 x 16 x 16 x 16 = 32768

Place value of 7 = 7 x 16 x 16 x 16 x 16 = 458752

**Step 4: **Now add all the place values to get the decimal equivalent.

Decimal equivalent = 458752 + 32768 + 1024 + 64 + 15 = 492623

## Conversion of Decimal to Hexadecimal:

Let's take 462 as a decimal number and convert it into Hexadecimal value by using the following steps:

**Step 1: ** Divide the given decimal number with 16 and note the value of remainder and quotient.

462 = (28 x 16) + 14

**Step 2: **Convert the remainder from decimal digit into Hexadecimal digit and this Hexadecimal digit is the first digit of our Hexadecimal number.

Decimal 14 = E in Hexadecimal

**Step 3: **Repeat first and second step on the quotient calculated in the last step until you get quotient less than 16.

28 = (1 x 16) + 12

Decimal 12 = C in Hexadecimal

1 = (0 x 16) + 1

Decimal 1 = 1 in Hexadecimal

**Step 4: ** Now after all this process we have three remainders. The first remainder is the first digit of the Hexadecimal number and the last remainder is the most significant bit of our Hexadecimal number, thus the Hexadecimal formed in this case is:
The hexadecimal value of Decimal 462 is 1CE