## What is the number system ?

The number system is a way of representing numerical values. It is a set of rules, symbols and processes that allow us to count, measure, and calculate numerical quantities. The most common number systems are the decimal system, which uses the digits 0-9, and the binary system, which uses only 0 and 1. Other number systems include octal, hexadecimal, and Roman numerals. Each number system has its own unique properties and applications, and is used in various fields such as mathematics, computer science, engineering, and physics.

## Popular number systems

There are many different number systems, but some of the most common ones are:

• Decimal number system: Also known as base-10 system, this is the number system most commonly used in everyday life. It uses 10 symbols (0-9) and positions to represent numbers. Each position represents a power of 10, so the value of a digit depends on its position in the number. For example, in the number 123, the digit 3 represents the ones place, the digit 2 represents the tens place, and the digit 1 represents the hundreds place.
• Binary number system: Also known as base-2 system, this is the number system used by computers to represent and manipulate data. It uses two symbols (0 and 1) and positions to represent numbers. Each position represents a power of 2, so the value of a digit depends on its position in the number. For example, in the binary number 1101, the digit 1 represents the 2^3 (8) place, the digit 1 represents the 2^2 (4) place, the digit 0 represents the 2^1 (2) place, and the digit 1 represents the 2^0 (1) place.
• Hexadecimal number system: Also known as base-16 system, this is a number system commonly used in computer programming and digital electronics. It uses 16 symbols (0-9 and A-F) and positions to represent numbers. Each position represents a power of 16, so the value of a digit depends on its position in the number. For example, in the hexadecimal number A7F, the digit F represents the 16^0 (1) place, the digit 7 represents the 16^1 (16) place, and the digit A represents the 16^2 (256) place.

There are also other number systems, such as octal (base-8), which is used in some computer programming applications, and Roman numerals, which were used in ancient times for counting and arithmetic.

## Example to convert decimal to binary

To convert a decimal number to binary, you can follow these steps:

1. Divide the decimal number by 2.
2. Write down the integer quotient and the remainder.
3. Repeat the process with the integer quotient until the quotient is 0.
4. Write the remainders in reverse order (the last remainder becomes the first digit).

For example, let's convert the decimal number 25 to binary:

1. 25 divided by 2 is 12 with a remainder of 1. Write down: 1
2. 12 divided by 2 is 6 with a remainder of 0. Write down: 0
3. 6 divided by 2 is 3 with a remainder of 0. Write down: 0
4. 3 divided by 2 is 1 with a remainder of 1. Write down: 1
5. 1 divided by 2 is 0 with a remainder of 1. Write down: 1

The remainders in reverse order are: 11001. Therefore, the decimal number 25 in binary is 11001.

## Example to convert fractional decimal to binary

To convert a decimal fraction to binary, you can follow these steps:

1. Multiply the decimal fraction by 2.
2. Write down the integer part of the result as the next binary digit.
3. If the fractional part is not 0, repeat the process with the fractional part until the fractional part becomes 0 or you reach the desired number of binary digits.
4. Write the binary digits in order.

For example, let's convert the decimal fraction 0.625 to binary:

1. 0.625 x 2 = 1.25. The integer part is 1, so write down: 0.1
2. 0.25 x 2 = 0.5. The integer part is 0, so write down: 0
3. 0.5 x 2 = 1.0. The integer part is 1, so write down: 1

The binary representation of 0.625 is 0.101

## Example to convert binary to decimal

To convert a binary number to a decimal number, you can follow these steps:

1. Write down the binary number.
2. Starting from the rightmost digit, assign each digit a power of 2, starting with 2^0 for the rightmost digit, 2^1 for the next digit to the left, 2^2 for the next, and so on.
3. Multiply each digit by its corresponding power of 2.
4. Add up the results of the multiplication to get the decimal equivalent.

For example, let's convert the binary number 11011 to decimal:

1. Write down the binary number: 11011
2. Assign powers of 2 to each digit: 2^0, 2^1, 2^2, 2^3, 2^4
3. Multiply each digit by its corresponding power of 2:
4. ``````
1 * 2^0 = 1
1 * 2^1 = 2
0 * 2^2 = 0
1 * 2^3 = 8
1 * 2^4 = 16
``````
5. Add up the results: 1 + 2 + 0 + 8 + 16 = 27

Therefore, the binary number 11011 in decimal is 27.

## Example to convert binary to hexadecimal.

To convert a binary number to a hexadecimal number, you can follow these steps:

• 1. Divide the binary number into groups of 4 digits, starting from the rightmost digit. Add leading zeros to the left if necessary.
• 2. Write down the hexadecimal equivalent of each 4-digit binary group using the following table:
``````
0000    0
0001    1
0010    2
0011    3
0100    4
0101    5
0110    6
0111    7
1000    8
1001    9
1010    A
1011    B
1100    C
1101    D
1110    E
1111    F
``````

For example, let's convert the binary number 10110110 to hexadecimal:

• Divide the binary number into groups of 4 digits: 1011 0110
• 2. Write down the hexadecimal equivalent of each 4-digit binary group:
``````
1011 = B
0110 = 6
``````

Therefore, the binary number 10110110 in hexadecimal is B6.

## Example to convert hexadecimal to binary.

To convert a hexadecimal number to a binary number, you can follow these steps:

1. 1. Write down the hexadecimal number.
2. 2. Write down the binary equivalent of each hexadecimal digit using the following table:
3. ```    Hexadecimal  Binary
0            0000
1            0001
2            0010
3            0011
4            0100
5            0101
6            0110
7            0111
8            1000
9            1001
A            1010
B            1011
C            1100
D            1101
E            1110
F            1111
```
4. 3. Concatenate the binary equivalents of each hexadecimal digit.

For example, let's convert the hexadecimal number D7 to binary:

1. Write down the hexadecimal number: D7
2. 2. Write down the binary equivalent of each hexadecimal digit:
3. ```   D = 1101
7 = 0111
```
4. Concatenate the binary digits: 11010111

Therefore, the hexadecimal number D7 in binary is 11010111.

## What is Binary-Coded Decimal ?

Binary-Coded Decimal (BCD) is a method for representing decimal numbers in digital electronics and computing. In BCD, each decimal digit is represented with a binary code of four bits. For example, the decimal number 123 would be represented in BCD as:

`0001 0010 0011`

The first digit of the code represents the thousands place, the second digit represents the hundreds place, the third digit represents the tens place, and the fourth digit represents the ones place. Each digit in a BCD number is independent of the other digits, unlike in binary representation where the value of each bit is dependent on its position. This makes BCD an easy format to work with when designing circuits for decimal arithmetic.

BCD is commonly used in electronic devices such as calculators, digital clocks, and measurement devices where decimal values need to be displayed or processed. However, BCD requires more memory and processing power than other binary representations, so it is generally only used where decimal arithmetic is needed.