## Number System

## Introduction of Number System

A number system is a method of representing and manipulating quantities. The decimal (base-10) system has digits 0-9. With 0 and 1 digits, binary (base-2) is essential in computing. There are also octal (base-8) and hexadecimal (base-16) numbers. They perform critical roles in a variety of applications, including computer programming.

### Binary Number System

The binary number system employs only two digits: 0 and 1. Each digit indicates a power of two, with the rightmost digit being 0 (1), followed by 2 (1), 2 (2), 2 (4), and so on. Computers utilise binary to store and process data by employing two-state electronic switches.

Decimal Number | Binary Number |
---|---|

0 | 0000 |

1 | 0010 |

2 | 0011 |

3 | 0010 |

4 | 0100 |

5 | 0101 |

### Decimal Number system

The decimal number system, sometimes known as the base-10 system, is the most widely used numeric system. It has 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each digit in a number represents a power of ten, allowing us to express and operate with a wide variety of numerical values.

For example, the decimal number 1234 the thousands position, and its value can be written as

### Octal Number system

The octal number system, often known as the base-8 system, employs eight digits: 0, 1, 2, 3, 4, 5, 6, and 7. Each digit indicates a power of 8, with the rightmost digit being 80 (1), the next being 81 (8), the next being 82 (64), and so on. Octal numbers were utilized in early computing systems, although they are less frequent nowadays.

For example, the octal number (12570) Calculating Decimal Equivalent –

### Hexadecimal Number system

The hexadecimal number system, often known as the base-16 system, has sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. The letters A to F represent the decimal numbers 10 to 15, respectively. Hexadecimal digits are often used in computer programming to represent binary data in a compact manner that is easier for humans to read and work with.

Here table represents the decimal, binary, octal and hexadecimal numbers from 0 to 15 and their equivalent binary number.

Decimal | Binary | Octal | Hexadecima |
---|---|---|---|

0 | 0000 | 0 | 0 |

1 | 0001 | 1 | 1 |

2 | 0010 | 2 | 2 |

3 | 0011 | 3 | 3 |

4 | 0100 | 4 | 4 |

5 | 0101 | 5 | 5 |

6 | 0110 | 6 | 6 |

7 | 0111 | 7 | 7 |

8 | 1000 | 10 | 8 |

9 | 1001 | 11 | 9 |

10 | 1010 | 12 | A |

11 | 1011 | 13 | B |

12 | 1100 | 14 | C |

13 | 1101 | 115 | D |

14 | 1110 | 16 | E |

15 | 1111 | 17 | F |

## Number System Conversion

Here we will see the method and criteria converting a number system to another. We will be looking forward to convert each into everyone. Here we see…

## Convert Decimal to Other

### Decimal Number System to Other Base

To convert number system from Decimal Number System to any other base is quite easy; you have to follow just two steps :

- Divide the number by the base of target base system in which you want to convert the number : Binary(2), octal(8) and Hexadecimal(16).
- Write the remainder from step 1 as a least Signification bit (LSB) to step last as a most significant bit (MSB). repeat all the steps until the quotient is equal to 0.

#### Decimal to Binary

The method of repeated division by 2 can be used to convert a decimal integer to binary. Here’s a step-by-step procedure:

Assume you’d want to convert the decimal value 25 to binary:

- Divide 25 by 2: 25 2 = 12 rest 1
- Subtract 12 from 2: 12 2 = 6 remaining 0
- Divide 6 by 2: 6 2 = 3 rest 0
- Subtract 3 from 2: 3 2 = 1 residual 1
- Divide 1 by 2: 1 2 = 0 rest 1

Now, from bottom to top, read the remainders: 11001

In binary, the decimal number 25 is 11001.

#### Decimal to Octal

The method of repeated division by 8 can be used to convert a decimal number to an octal number. Here’s a step-by-step guide:

Assume you wish to convert the decimal number 57 to octal:

1. Divide 57 by 8: 57 8 = 7 leftover 1

2. Divide 7 by 8: 7 8 = 0 residual 7

Now, read the remainders from bottom to top: 71

As a result, the decimal number 57 in octal is 71.

#### Decimal to Hexadecimal

You may utilise the method of repeated division by 16 to convert a decimal value to hexadecimal. Here’s a step-by-step procedure:

Assume you wish to convert 255 from decimal to hexadecimal:

1. Subtract 255 from 16: 255 16 = 15 residual 15 (F in hexadecimal)

2. Subtract 15 from 16: 15 16 = 0 remaining 15 (F in hexadecimal)

Now, from bottom to top, read the remainders: FF

In hexadecimal, the decimal value 255 is FF.

## Convert Binary to Other

#### Binary to Decimal

You may utilise the positional value of each digit in the binary form to convert a binary number to decimal. Each digit in a binary number represents a power of two, with the rightmost digit representing 0 (1), the next to the left representing 2 (1), the next representing 2 (2), the next representing 22 (4), and so on.

Assume you wish to convert 11001 from binary to decimal:

1. Begin by assigning positional values to the rightmost digit: 1 (2^0) 1 (2^1) 0 (2^2) 0 (2^3) 1 (2^4)

2. Take each digit and multiply it by its positional value:

1 * 2^0 = 1 1 * 2^1 = 2 0 * 2^2 = 0 0 * 2^3 = 0 1 * 2^4 = 16

3. Add the outcomes together: 1 + 2 + 0 + 0 + 16 = 19

As a result, the decimal equivalent of the binary number 11001 is 19.

#### Binary to Hexadecimal

To convert a binary number to hexadecimal, divide the binary digits into groups of four from right to left, then convert each group into its matching hexadecimal digit. If there are any residual numbers that aren’t in groups of four, pad them with zeros from the left.

Here’s a step-by-step procedure:

Assume you wish to convert 1101101 from binary to hexadecimal:

1. Sort the binary digits into four-digit groups from right to left:

1101

2. If any numbers remain, pad them with zeros from the left to produce full groups of four:

0011 0110

3. Convert each group to its hexadecimal equivalent:

0110 = 6 (in hexadecimal) 0011 = 3 (in hexadecimal)

4. From left to right, add the hexadecimal digits:

36

In hexadecimal, the binary number 1101101 equals 36.

## Convert Octal to Other

#### Octal to Decimal

You may utilise the positional value of each digit in the octal format to convert an octal number to decimal. Each digit in an octal number represents a power of eight, with the rightmost digit representing 0 (1), the next to the left representing 81 (8), the next representing 82 (64), and so on.

Assume you’d want to translate the octal number 47 to decimal:

1. Begin by assigning positional values to the rightmost digit: 7 (8^0) 4 (8^1)

2. Take each digit and multiply it by its positional value:

7 * 8^0 = 7 4 * 8^1 = 32

3. Add the outcomes together: 7 + 32 = 39

As a result, the decimal equivalent of the octal number 47 is 39.

#### Octal to Binary

To convert an octal number to binary, first convert each octal digit to its 3-bit binary form. Each octal digit is a unique combination of three binary digits.

Here’s a step-by-step procedure:

Assume you’d want to convert the octal number 47 to binary:

1. Convert each octal digit to its three-bit binary equivalent:

4 (in octal) = 100 (binary) 7 (in octal) = 111 (binary)

2. From left to right, combine the binary representations:

100111

In binary, the octal number 47 is 100111.

#### Octal to Hexadecimal

To convert an octal number to hexadecimal, first convert it to binary, and then convert the binary number to hexadecimal. The procedure is as follows:

Assume you’d want to convert the octal number 47 to hexadecimal:

1. Convert an octal number to a binary number:

4 (in octal) = 100 (binary) 7 (in octal) = 111 (binary)

2. From left to right, combine the binary representations:

100111

3. Convert the binary number to the hexadecimal equivalent: 100111 (in binary) -> 27 (in hexadecimal).

In hexadecimal, the octal number 47 equals 27.

## Hexadecimal to Other

#### Hexadecimal to Decimal

You may utilise the positional value of each digit in the hexadecimal format to convert a hexadecimal number to decimal. Each digit in a hexadecimal number represents a power of 16, with the rightmost digit representing 161 (16), the next representing 162 (256), and so on.

Assume you wish to translate 2F from hexadecimal to decimal:

1. Begin by assigning positional values to the rightmost digit: F (160). 2 (16^1)

2. Convert the hexadecimal digits to decimal counterparts as follows:

F (hexadecimal) = 15 (decimal)

2 (hexadecimal) = 2 (decimal)

3. Take each digit and multiply it by its positional value:

15 * 16^0 = 15 2 * 16^1 = 32

4. Combine the results: 15 + 32 = 47

So the decimal equivalent of the hexadecimal number 2F is 47.

#### Hexadecimal to Binary

Each hexadecimal digit may be converted to its equivalent 4-bit binary representation to convert a hexadecimal integer to binary. Each hexadecimal digit represents a distinct set of four binary digits.

Here’s a step-by-step procedure:

Assume you wish to convert 2F from hexadecimal to binary:

1.Convert each hexadecimal digit to its four-bit binary equivalent:

F (in hexadecimal) -> 1111 (in binary) 2 (in hexadecimal) -> 0010 (in binary) F (in hexadecimal) -> 1111 (in binary)

2. From left to right, combine the binary representations:

00101111

In binary, the hexadecimal value 2F is 00101111.

## Binary Codes

The digital data is represented, stored and transmitted as group of binary bits. This group is also called as binary code. The binary code is represented by the number as well as alphanumeric letter.

Digital data is represented, stored and transmitted as a set of binary bits. This group is also known as binary code. Binary code is represented by numbers as well as alphanumeric letters.

**Advantages of Binary Code**

Following is the list of advantages that binary code offers.

- Binary codes are suitable for the computer applications.
- Binary codes are suitable for the digital communications.
- Binary codes make the analysis and designing of digital circuits if we use the binary codes.
- Since only 0 & 1 are being used, implementation becomes easy.

## Binary Coded Decimal (BCD) code

In this code each decimal digit is represented by a 4-bit binary number. BCD is a way to express each of the decimal digits with a binary code. In the BCD, with four bits we can represent sixteen numbers (0000 to 1111). But in BCD code only first ten of these are used (0000 to 1001). The remaining six code combinations i.e. 1010 to 1111 are invalid in BCD.

Decimal | BCD Code |
---|---|

0 | 0000 |

1 | 0001 |

2 | 0010 |

3 | 0011 |

4 | 0100 |

5 | 0101 |

6 | 0110 |

7 | 0111 |

8 | 1000 |

9 | 1001 |

#### Advantages of BCD Code

- It is very similar to decimal system.
- We need to remember binary equivalent of decimal numbers 0 to 9 only.

#### Disadvantages of BCD Code

- The addition and subtraction of BCD have different rules.
- The BCD arithmetic is little more complicated.
- BCD needs more number of bits than binary to represent the decimal number. So BCD is less efficient than binary.

## Alphanumeric codes

Alphanumeric codes are string combinations of letters (alphabets) and numbers that are used to represent various types of data. These codes are often used in several sectors for identification, categorization, and encoding. Alphanumeric codes can include both capital and lowercase letters and are occasionally mixed with numeric characters. Here are some examples of alphanumeric codes:

- American Standard Code for Information Interchange (ASCII)
- Extended Binary Coded Decimal Interchange Code (EBCDIC)
- Five bit Baudot Code.

#### ASCII Code

ASCII is a character encoding system used in computers and communication devices. Each character is represented by a 7-bit binary code (or 8-bit in extended ASCII). It has 128 (or 256) characters, which include control characters as well as printable characters such as letters, numerals, and symbols. For instance, the letter ‘A’ is represented as 65 (or 01000001 in binary). ASCII standardises text interchange and ensures compatibility across systems. While Unicode has grown increasingly popular for allowing a wider range of characters, ASCII is still used in many computing applications. Since its inception in the 1960s, it has served as a basic standard for encoding text and controlling devices.

#### EBCDIC Code

Another character encoding method used in early computers and IBM mainframes was EBCDIC (Extended Binary Coded Decimal Interchange Code). Unlike ASCII, which employs 7 or 8 bits to represent characters, EBCDIC uses 8 bits. It was popular in the past, but in current computers, ASCII and Unicode have mainly superseded it. Some legacy systems and mainframe settings still utilise EBCDIC. EBCDIC uses a unique 8-bit binary code for each character, allowing it to accommodate more characters and special symbols than ASCII.

#### Unicode

Unicode is a character encoding standard that assigns a unique numeric value (code point) to each character used in written languages throughout the globe, including symbols, emojis, and special characters. It aspires to be a global character set that can represent all of the characters used in every human language and script. Unlike ASCII and EBCDIC, which utilise 7 or 8 bits to represent characters, Unicode employs 16 bits (UTF-16 encoding) or more (UTF-8, UTF-32) to accommodate a wide range of characters. Unicode has evolved into the main character encoding standard in modern computers, and it is widely used for multilingual text representation and communication.