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 10010^0 place (units),
    • The 4 is in the 10110^1 place (tens),
    • The 3 is in the 10210^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 202^0 place (units),
    • The 1 next to it is in the 212^1 place (twos),
    • The 0 next is in the 222^2 place (fours),
    • The leftmost 1 is in the 232^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 808^0 place (units),
    • The 4 is in the 818^1 place (eights),
    • The 7 is in the 828^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 16016^0 place (units),
    • The A (which is 10 in decimal) is in the 16116^1 place (sixteens),
    • The 1 is in the 16216^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

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

6.2 Binary to Decimal

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

6.3 Decimal to Hexadecimal

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

6.4 Hexadecimal to Decimal

  1. Multiply each hexadecimal digit by its corresponding power of 16.
  2. 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×102+4×101+5×100=300+40+5=3453 \times 10^2 + 4 \times 10^1 + 5 \times 10^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×23+0×22+1×21+1×20=8+0+2+1=111 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^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×82+4×81+5×80=448+32+5=4857 \times 8^2 + 4 \times 8^1 + 5 \times 8^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×162+A×161+3×160=256+160+3=4191 \times 16^2 + A \times 16^1 + 3 \times 16^0 = 256 + 160 + 3 = 419 (in decimal, where A is 10)

5. Conversion Methods

5.1 Decimal to Binary

  1. Divide the number by 2 and record the remainder.
  2. Repeat the process with the quotient until the quotient is 0.
  3. 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

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

Example: Convert 1101 to decimal.

  • 1×23+1×22+0×21+1×20=8+4+0+1=131 \times 2^3 + 1 \times 2^2 + 0 \times 2^1 + 1 \times 2^0 = 8 + 4 + 0 + 1 = 13

5.3 Decimal to Octal

  1. Divide the number by 8 and record the remainder.
  2. Repeat the process with the quotient until the quotient is 0.
  3. 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

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

Example: Convert 745 to decimal.

  • 7×82+4×81+5×80=448+32+5=4857 \times 8^2 + 4 \times 8^1 + 5 \times 8^0 = 448 + 32 + 5 = 485

5.5 Decimal to Hexadecimal

  1. Divide the number by 16 and record the remainder.
  2. Repeat the process with the quotient until the quotient is 0.
  3. 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

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

Example: Convert 1A3 to decimal.

  • 1×162+A×161+3×160=256+160+3=4191 \times 16^2 + A \times 16^1 + 3 \times 16^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.

 1011
+ 1101
——
  1. Add the rightmost bits:
    • 1 + 1 = 10 (write down 0, carry 1)
  2. Add the next bits along with the carry:
    • 1 (carry) + 1 + 0 = 10 (write down 0, carry 1)
  3. Add the next bits along with the carry:
    • 1 (carry) + 0 + 1 = 10 (write down 0, carry 1)
  4. Add the leftmost bits along with the carry:
    • 1 (carry) + 1 + 1 = 11 (write down 1, carry 1)
  5. 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.

 10111
– 1101
——–
  1. Align the numbers:
    • Pad the second number with leading zeros: 01101
  2. Subtract the rightmost bits:
    • 1 – 1 = 0
  3. Move to the next bits:
    • 1 – 0 = 1
  4. Subtract the next bits:
    • 1 – 1 = 0
  5. 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.
  6. 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.

 

 

Important Questions
Comments
Discussion
0 Comments
  Loading . . .