# Number System and Their Conversion

By Notes Vandar

# Number System and Their Conversion

A number system is a mathematical framework used to represent and work with numbers. It provides a way to express values and perform calculations. Number systems can be categorized based on the base or radix they use. Here’s an overview of the most common number systems:

**1. Decimal Number System (Base 10)**

**Description**: The decimal number system is the most commonly used system in everyday life. It uses ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.**Base**: 10**Structure**: Each digit’s position represents a power of 10. For example, in the number 345:- The 5 is in the $1_{0}$ place (units),
- The 4 is in the $1_{1}$ place (tens),
- The 3 is in the $1_{2}$ place (hundreds).

**2. Binary Number System (Base 2)**

**Description**: The binary number system is used primarily in computing and digital electronics. It uses only two symbols: 0 and 1.**Base**: 2**Structure**: Each digit’s position represents a power of 2. For example, in the binary number 1011:- The rightmost 1 is in the $_{0}$ place (units),
- The 1 next to it is in the $_{1}$ place (twos),
- The 0 next is in the $_{2}$ place (fours),
- The leftmost 1 is in the $_{3}$ place (eights).

**3. Octal Number System (Base 8)**

**Description**: The octal number system is used in some computing applications. It uses eight symbols: 0, 1, 2, 3, 4, 5, 6, and 7.**Base**: 8**Structure**: Each digit’s position represents a power of 8. For example, in the octal number 745:- The 5 is in the $_{0}$ place (units),
- The 4 is in the $_{1}$ place (eights),
- The 7 is in the $_{2}$ place (sixty-fours).

**4. Hexadecimal Number System (Base 16)**

**Description**: The hexadecimal number system is often used in computing to represent large numbers more compactly. It uses sixteen symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A (10), B (11), C (12), D (13), E (14), and F (15).**Base**: 16**Structure**: Each digit’s position represents a power of 16. For example, in the hexadecimal number 1A3:- The 3 is in the $1_{0}$ place (units),
- The A (which is 10 in decimal) is in the $1_{1}$ place (sixteens),
- The 1 is in the $1_{2}$ place (two hundred fifty-sixes).

**5. Roman Numerals**

**Description**: Roman numerals are an ancient number system used by the Romans. It uses combinations of letters from the Latin alphabet: I, V, X, L, C, D, and M.**Structure**: Values are represented by combining these symbols. For example, the Roman numeral XIII represents 13 (10 + 3).

**6. Understanding Base Conversions**

To work with different number systems, it’s often necessary to convert between them. Here’s a basic method for converting numbers:

**6.1 Decimal to Binary**

**Divide the number by 2**and record the remainder.**Divide the quotient by 2**and record the new remainder.**Repeat**until the quotient is 0.**Read the remainders**from bottom to top to get the binary equivalent.

**6.2 Binary to Decimal**

**Multiply each binary digit**by its corresponding power of 2.**Sum the results**to get the decimal value.

**6.3 Decimal to Hexadecimal**

**Divide the number by 16**and record the remainder.**Divide the quotient by 16**and record the new remainder.**Repeat**until the quotient is 0.**Read the remainders**from bottom to top, converting remainders greater than 9 to letters (A-F) as needed.

**6.4 Hexadecimal to Decimal**

**Multiply each hexadecimal digit**by its corresponding power of 16.**Sum the results**to get the decimal value.

**7. Applications of Number Systems**

**Decimal**: Everyday arithmetic and financial calculations.**Binary**: Computer operations, digital circuits, and programming.**Octal**: Early computing systems and some Unix file permissions.**Hexadecimal**: Memory addresses, color codes in web design, and low-level programming.

## 4.2 Decimal, Binary, Octal, Hexadecimal Number System and Conversion

Understanding these number systems and how to convert between them is crucial in fields such as computer science and digital electronics. Here’s a detailed guide:

**1. Decimal Number System (Base 10)**

**Digits**: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9**Place Value**: Each digit represents a power of 10.**Example**: The number 345 can be broken down as:- $3×1_{2}+4×1_{1}+5×1_{0}=300+40+5=345$

**2. Binary Number System (Base 2)**

**Digits**: 0, 1**Place Value**: Each digit represents a power of 2.**Example**: The binary number 1011 can be broken down as:- $1×_{3}+0×_{2}+1×_{1}+1×_{0}=8+0+2+1=11$ (in decimal)

**3. Octal Number System (Base 8)**

**Digits**: 0, 1, 2, 3, 4, 5, 6, 7**Place Value**: Each digit represents a power of 8.**Example**: The octal number 745 can be broken down as:- $7×_{2}+4×_{1}+5×_{0}=448+32+5=485$ (in decimal)

**4. Hexadecimal Number System (Base 16)**

**Digits**: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A (10), B (11), C (12), D (13), E (14), F (15)**Place Value**: Each digit represents a power of 16.**Example**: The hexadecimal number 1A3 can be broken down as:- $1×1_{2}+A×1_{1}+3×1_{0}=256+160+3=419$ (in decimal, where A is 10)

**5. Conversion Methods**

**5.1 Decimal to Binary**

**Divide the number by 2**and record the remainder.**Repeat**the process with the quotient until the quotient is 0.**Read the remainders**from bottom to top to get the binary equivalent.

**Example**: Convert 13 to binary.

- 13 ÷ 2 = 6 remainder 1
- 6 ÷ 2 = 3 remainder 0
- 3 ÷ 2 = 1 remainder 1
- 1 ÷ 2 = 0 remainder 1

Binary representation: 1101

**5.2 Binary to Decimal**

**Multiply each binary digit**by its corresponding power of 2.**Sum the results**to get the decimal value.

**Example**: Convert 1101 to decimal.

- $1×_{3}+1×_{2}+0×_{1}+1×_{0}=8+4+0+1=13$

**5.3 Decimal to Octal**

**Divide the number by 8**and record the remainder.**Repeat**the process with the quotient until the quotient is 0.**Read the remainders**from bottom to top to get the octal equivalent.

**Example**: Convert 485 to octal.

- 485 ÷ 8 = 60 remainder 5
- 60 ÷ 8 = 7 remainder 4
- 7 ÷ 8 = 0 remainder 7

Octal representation: 745

**5.4 Octal to Decimal**

**Multiply each octal digit**by its corresponding power of 8.**Sum the results**to get the decimal value.

**Example**: Convert 745 to decimal.

- $7×_{2}+4×_{1}+5×_{0}=448+32+5=485$

**5.5 Decimal to Hexadecimal**

**Divide the number by 16**and record the remainder.**Repeat**the process with the quotient until the quotient is 0.**Read the remainders**from bottom to top, converting values 10-15 to A-F.

**Example**: Convert 419 to hexadecimal.

- 419 ÷ 16 = 26 remainder 3
- 26 ÷ 16 = 1 remainder 10 (A)
- 1 ÷ 16 = 0 remainder 1

Hexadecimal representation: 1A3

**5.6 Hexadecimal to Decimal**

**Multiply each hexadecimal digit**by its corresponding power of 16.**Sum the results**to get the decimal value.

**Example**: Convert 1A3 to decimal.

- $1×1_{2}+A×1_{1}+3×1_{0}=256+160+3=419$ (where A is 10)

## 4.2 Calculation in Binary – addition, subtraction

Binary calculations are fundamental to computing and digital electronics. Here’s a guide to performing binary addition and subtraction.

**1. Binary Addition**

Binary addition follows similar rules to decimal addition but operates with only two digits: 0 and 1. The key rule to remember is that:

**0 + 0 = 0****0 + 1 = 1****1 + 0 = 1****1 + 1 = 10**(which means a sum of 0 with a carry of 1)

**1.1 Binary Addition Example**

Let’s add the binary numbers 1011 and 1101.

+ 1101

——

**Add the rightmost bits**:- 1 + 1 = 10 (write down 0, carry 1)

**Add the next bits along with the carry**:- 1 (carry) + 1 + 0 = 10 (write down 0, carry 1)

**Add the next bits along with the carry**:- 1 (carry) + 0 + 1 = 10 (write down 0, carry 1)

**Add the leftmost bits along with the carry**:- 1 (carry) + 1 + 1 = 11 (write down 1, carry 1)

**Write down the carry**:- The final carry is 1.

So, the sum of 1011 and 1101 is 11000.

**2. Binary Subtraction**

Binary subtraction is similar to decimal subtraction but involves borrowing from the next higher bit when needed.

**2.1 Binary Subtraction Rules**

**0 – 0 = 0****1 – 0 = 1****1 – 1 = 0****0 – 1**requires borrowing: treat it as**10 – 1 = 1**.

**2.2 Binary Subtraction Example**

Let’s subtract the binary number 1101 from 10111.

– 1101

——–

**Align the numbers**:- Pad the second number with leading zeros: 01101

**Subtract the rightmost bits**:- 1 – 1 = 0

**Move to the next bits**:- 1 – 0 = 1

**Subtract the next bits**:- 1 – 1 = 0

**Subtract the next bits**:- 0 – 1 requires borrowing: borrow 1 from the next higher bit. The subtraction becomes 10 – 1 = 1, and the next higher bit is reduced by 1.

**Subtract the leftmost bits after borrowing**:- 0 – 0 = 0

So, the result of 10111 – 1101 is 10010.

**3. Additional Notes**

**Carrying**in addition and**borrowing**in subtraction are crucial for accurate binary calculations.**Binary Addition**can be extended to multiple bits and involves carrying over when the sum exceeds 1.**Binary Subtraction**can be made easier using the concept of**two’s complement**for handling negative numbers, but the basic borrowing method is a good start.