Number Systems

 What is a Numbering System?

A numbering system is a way to represent numbers using specific symbols and rules. We use numbering systems in everyday life for counting, measuring, and performing calculations. Different numbering systems exist, each with a unique base that determines the number of symbols used. Understanding numbering systems is essential, especially in computing, where different systems are used for various applications.

Types of Numbering Systems

There are several numbering systems, but the most commonly used ones are:

Number System
Number System

2.1 Decimal Numbers (Base-10)

The decimal system is the numbering system we use daily. It consists of ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The value of a digit depends on its position and the base (10) of the system. Example: The decimal number 247 can be expanded as:

(2 × 10²) + (4 × 10¹) + (7 × 10⁰) = 200 + 40 + 7 = 247

2.2 Binary Numbers (Base-2)

The binary system is used in computers and digital electronics. It consists of only two digits: 0 and 1. Every binary digit (bit) represents a power of 2. The binary number system is also known as the base 2 number system. Example: The binary number 1011 can be converted to decimal as:

(1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) = 8 + 0 + 2 + 1 = 11

2.3 Octal Numbers (Base-8)

The octal system has eight digits: 0 to 7. It is used in computing as a shorthand for binary numbers since three binary digits correspond to one octal digit. The octal number system is also known as the base 8 number system. Example: The octal number 345 can be converted to decimal as:

(3 × 8²) + (4 × 8¹) + (5 × 8⁰) = 192 + 32 + 5 = 229

2.4 Hexadecimal Numbers (Base-16)

The hexadecimal system has sixteen symbols: 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15). It is widely used in programming and digital systems for representing large binary numbers compactly. The hexadecimal number system is also known as the base 16 number system. Example: The hexadecimal number 2F can be converted to decimal as:

(2 × 16¹) + (15 × 16⁰) = 32 + 15 = 47

3. Number Conversion

Decimal to Binary:

  • Divide the decimal number by 2 repeatedly and note the remainder.

Example: Convert (52)10 into binary.

decimal to binary

The Result is (110100)2

decimal to binary

Binary to Decimal Conversion:

Multiply each binary digit by powers of 2: Example

Digital to binary conversion

Binary to Octal conversion:-

For conversion from binary to octal, the binary numbers are divided into groups of 3 bits each, starting at the binary point and proceeding towards left and right.

Binary to Hexadecimal conversion:-

For converting a binary to a hexadecimal number, the binary number starting from the binary point, groups of 4 bits each, on either side of the binary point.

Dicimal to octal Conversion:

  • To convert a decimal whole number to octal, divide the number by 8 again and again until the quotient becomes 0.
  • To convert a decimal fraction to octal, multiply the fraction by 8 again and again until the result becomes 0 or until you get the required number of decimal places.

Decimal to Hexadecimal Conversion:

  • The decimal to hexadecimal conversion is the same as octal.

octal to binary Conversion

  • To convert a given octal number to binary, replace each octal digit by its 3-bit binary equivalent.

Octal to decimal conversion:

  • To convert an octal number to a decimal number, multiply each digit in the octal number by the weight of its position
    and add all the product terms.

Octal to hexadecimal conversion

  • For conversion of octal to Hexadecimal, first convert the given octal number to binary and then to hexadecimal.

Hexadecimal to binary conversion:

  • For conversion of hexadecimal to binary, replace a hexadecimal digit with its 4-bit binary group.

Hexadecimal to decimal conversion:-

  • For conversion of hexadecimal to decimal, multiply each digit in the hexadecimal number by its position
    weight and add all those product terms.

Hexadecimal to Octal conversion:-

  • For conversion of hexadecimal to octal, first convert the given hexadecimal number to binary and then binary number to octal.

 1’s Complement

1’s complement is a method of representing negative numbers in binary. It is found by flipping all the bits of a binary number (changing 0s to 1s and 1s to 0s).

Example: Binary: 1010 → 1’s complement = 0101

Subtraction of Two Binary Numbers Using 1’s Complement 

Algorithm
1. Ensure both binary numbers have the same number of bits by adding leading zeros if necessary.
2. Find the 1’s complement of the subtrahend (the number to be subtracted).
3. Add this 1’s complement to the minuend (the main number).
4. Check the result:
(a) If there is an overflow (carry out), the result is positive. Remove the overflow bit and add it to the remaining bits to get the final answer.
(b) If there is no overflow, the result is negative. Take the 1’s complement of the obtained result to get the final answer.

Example 1: Subtract 1101 − 110 Using 1’s Complement 
Step 1: Make the number of bits equal
Minuend: 1101
Subtrahend: 0110
Step 2: Find the 1’s complement of the subtrahend
1’s complement of 0110 = 1001
Step 3: Add the 1’s complement to the minuend
1101 + 1001 = 10110
Step 4: Check for overflow
Since there is an overflow (carry), the result is positive. Remove the overflow bit and add it to the remaining bits:
0110 + 1 = 0111

Final Answer:
1101 − 110 = 0111 (or 111 in binary)

Example 2: Subtract 10110 − 11101 Using 1’s Complement 

Step 1: Check the number of bits
Both numbers already have the same number of bits.
Minuend:      10110
Subtrahend: 11101
Step 2: Find the 1’s complement of the subtrahend
1’s complement of 11101 = 00010
Step 3: Add the 1’s complement to the minuend
10110 + 00010 = 11000
Step 4: Check for overflow
There is no overflow (carry), so the result is negative. Take the 1’s complement of the result:
1’s complement of 11000 = 00111

Final Answer:
10110 − 11101 = −00111 (or −111 in binary)

Example 3:Subtract 5 from 7 Using 1’s Complement Method[SEE 2081]

Step 1: Convert numbers to binary (use same number of bits)
7 = 0111
5 = 0101
Step 2: Find the 1’s complement of the subtrahend (5)
1’s complement of 0101 = 1010
Step 3: Add the 1’s complement to the minuend
0111 + 1010 = 10001
Step 4: Check for overflow
There is an overflow (carry). Remove the carry and add it to the remaining bits:
0001 + 1 = 0010

Final Answer:
7 − 5 = 0010 (or 2 in decimal)

2’s Complement

2’s complement is a method used in binary number systems to represent negative numbers and to perform subtraction easily. It is widely used in digital electronics and computers. The 2’s complement is found by adding 1 to the 1’s complement.

Example: Binary: 1010 → 1’s complement = 0101 Add 1 → 0110 (2’s complement)

Subtraction of two Binary Numbers using 2’s Complement


Algorithm
1. Make equal number of bits if the bits are not equal.
2. Calculate 2’s complement of the subtrahend,that is the number that is to be subtracted.
3. Add 2’s complement with the minuend, that is the main number.
4.a. If the result contains the overflow bit, the sign is positive and the final result is
obtained by removing the overflow bit.
b. If the result does not contains over flow bit, the sign is negative and the final result
is obtained by calculating 2’s complement of the number.

Example 1: Subtract 1101 − 101 Using 2’s Complement 

Step 1: Make the number of bits equal
Minuend: 1101
Subtrahend: 0101
Step 2: Find the 2’s complement of the subtrahend
1’s complement of 0101 = 1010
Add 1: 1010 + 1 = 1011
Step 3: Add the 2’s complement to the minuend
1101 + 1011 = 11000
Step 4: Check for overflow
Since there is an overflow (carry), the result is positive. Remove the overflow bit:
Final result = 1000

Final Answer:
1101 − 101 = 1000

Example 2: Subtract 10110 − 11011 Using 2’s Complement 

Step 1: Check the number of bits
Both numbers already have the same number of bits.
Minuend: 10110
Subtrahend: 11011
Step 2: Find the 2’s complement of the subtrahend
1’s complement of 11011 = 00100
Add 1 to get 2’s complement:
00100 + 1 = 00101
Step 3: Add the 2’s complement to the minuend
10110 + 00101 = 11011
Step 4: Check for overflow
There is no overflow (carry), so the result is negative. Take the 2’s complement of the result to find the magnitude:
1’s complement of 11011 = 00100
Add 1: 00100 + 1 = 00101

Final Answer:
10110 − 11011 = −00101 (or −101 in binary)

  Binary Addition

Binary addition follows these rules:

  • 0 + 0 = 0

  • 0 + 1 = 1

  • 1 + 0 = 1

  • 1 + 1 = 10 (carry 1 to the next column)

 Binary Subtraction

Binary subtraction is done using:

  • Direct subtraction method.

  • 2’s complement method.

Example: 1101 – 101 = ? Convert 101 to 2’s complement: 101 → 010 → add 1 → 011 Now add: 1101

  • 011 +1101 = 1000

 Binary Multiplication

Binary multiplication follows these rules:

  • 0 × 0 = 0

  • 0 × 1 = 0

  • 1 × 0 = 0

  • 1 × 1 = 1

Tutorial :1

  1. Convert 10110 (binary) to decimal.
    Answer: 22
  2. Convert 47 (decimal) to binary.
    Answer: 101111
  3. Convert 2A (hexadecimal) to binary.
    Answer: 00101010
  4. Convert 110011 (binary) to hexadecimal.
    Answer: 33
  5. Convert 72 (octal) to decimal.
    Answer: 58
  6. Convert 89 (decimal) to octal.
    Answer: 131
  7. Convert 1F (hexadecimal) to decimal.
    Answer: 31
  8. Convert 100 (decimal) to hexadecimal.
    Answer: 64
  9. Convert 101101 (binary) to octal.
    Answer: 55
  10. Convert 45 (octal) to binary.
    Answer: 100101
  11. Convert 3B (hexadecimal) to octal.
    Answer: 73
  12. Convert 1111 (binary) to decimal.
    Answer: 15
  13. Convert 123 (decimal) to binary.
    Answer: 1111011
  14. Convert 67 (octal) to hexadecimal.
    Answer: 37
  15. Convert A5 (hexadecimal) to binary.
    Answer: 10100101

Compiled By Er. Basant Kumar Yadav

error: Content is protected !!
Scroll to Top