Sunday, August 22, 2021

Number System

Number System

Contents:

  • Introduction to Number System
  • Types:
    • Decimal Number System
    • Binary Number System
    • Octal Number System
    • Hexadecimal Number System
  • Conversion between number system:
    • Decimal to Binary Conversion
    • Decimal to Octal Conversion
    • Decimal to Hexadecimal Conversion
    • Binary Number to Decimal Number
    • Octal Number to Decimal Number
    • Hexadecimal Number to Decimal Number
    • Conversion from Binary Number to Octal/Hexadecimal Number and Vice-Versa
      • Binary Number to Octal Number
      • Octal Number to Binary Number
      • Binary Number to Hexadecimal Number
      • Hexadecimal Number to Binary Number
    • Conversion of a Number with Fractional Part
      • Decimal Number with Fractional Part to another Number System
      • Non-decimal Number with Fractional Part to Decimal Number System
      • Fractional Binary Number to Octal or Hexadecimal Number

Introduction:

A number system is a method to represent (write) numbers. Every number system has a set of unique characters or literals or SYMBOLS. The count of these literals is called the radix or base of the number system. The four different number systems used in the context of computer i.e. Decimal, Binary, Octal, Hexadecimal.
The value of each number is determined by the PLACE VALUE and FACE VALUE of each symbol of the number.

Decimal Number System:

The decimal number system is used in our day-to-day life. It is known as base-10 system since 10 digits (0 to 9) are used. A number is presented by its two values — symbol value (any digit from 0 to 9) and positional value (in terms of base value)

Note:

  • 10 symbols i.e (0,1,2,3,4,5,6,7,8,9)
  • base 10

Binary Number System:

Binary number system uses two digits 1 and 0, which form the binary number system. This system is also referred as base-2 system as it has two digits only. Binary number system are used in electronic circuits and computer as they work with high and low voltage which can be mapped to 1 and 0 respectively.

Note:

  • 2 symbols i.e (0,1)
  • base 2

Octal Number System:

Octal number system was devised for compact representation of the binary numbers. Octal number system is called base-8 system as it has total eight digits (0-7), and positional value is expressed in powers of 8. Three binary digits (8=23) are sufficient to represent any octal digit.

Note:

  • 8 symbols i.e (0,1,2,3,4,5,6,7)
  • base 8

Hexadecimal Number System:

Hexadecimal numbers are also used for compact representation of binary numbers. It consists of 16 unique symbols (0–9, A–F), and is called base-16 system.

Note:

  • 16 symbols i.e (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
  • base 16

Application of Hexadecimal Number System:

  1. Main memory is made up of memory locations where each location has a unique address. Usually, sizeof a memory address is 16-bit or 32-bit. To access 16-bit memory address, a programmer has to use16 binary bits, which is difficult to deal with. To simplify the address representation, hexadecimal and octal numbers are used.
  2. Hexadecimal numbers are also used for describing the colours on the webpage.

Conversion between Number System

From Decimal to any other number system
Steps:

  1. Divide the given number by the base value (b) of the number system in which it is to be converted
  2. Note the remainder
  3. Keep on dividing the quotient by the base value and note the remainder till the quotient is zero
  4. Write the noted remainders in the reverse order (from bottom to top)

Decimal to Binary Conversion

Example : (65)10 is (1000001)2
Practice: 1.Convert (122)10 to binary number.

Decimal to octal Conversion

Example: (65)10 = (101)8
Practice: Convert (122)10 to octal number.

Decimal to Hexadecimal Conversion

Example: (65)10 = (14)16
Practice: Convert (122)10 to hexadecimal number.

From other Number Systems to Decimal Number System
Step:

  1. Write the position number for each alphanumeric symbol in the given number
  2. Get positional value for each symbol by raising its position number to the base value b symbol in the given number
  3. Multiply each digit with the respective positional value to get a decimal value
  4. Add all these decimal values to get the equivalent decimal number

Binary Number to Decimal Number:

Example: (1101)2 is (13)10
Practice: Convert (1110)2 into decimal number.

Octal Number to Decimal Number

Example: (257)8 is (175)10
Practice: Convert (355)8 into decimal number

Hexadecimal Number to Decimal Number

Example: (3A5)16 is (933)10
Practice: Convert (AF2)16</sub> into decimal number

Conversion from binary to Octal/Hexadecimal Number and Vice-Versa

A binary number is converted to octal or hexadecimal number by making groups of 3 and 4 bits, respectively, and replacing each group by its equivalent octal/hexadecimal digit.

Binary Number to Octal Number Steps:

  1. Given a binary number, group the digit in group of 3 bits from right to left
  2. Zero can be added on the begining(left ) or the MSB(Most Significant Bit) of the binary number to complete the group
  3. Replace each group of 3 bits with the equivalent Octal number

Example: Convert (10101100)2 to octal number
010 101 100
2 5 4

So (10101100)2 = (254)8

Practice: Convert (11100100)2 to octal number

Binary Number to Hexadecimal Number

Steps:

  1. Given a binary number, group the digit in group of 4 bits from right to left
  2. Zero can be added on the begining(left ) or the MSB(Most Significant Bit) of the binary number to complete the group
  3. Replace each group of 3 bits with the equivalent Octal number

Example:Convert (0110101100)2 to hexadecimal number.
0001 1010 1100
1 A C
so (0110101100)2 = (1AC)16
Practice: Convert (0111101000)2 to hexadecimal number

Hexadecimal Number to Binary Number:

Steps:

  1. Encode(Convert) each hexadecimal symbol into 4 digit binary number
  2. Now substitute the obtained binary number in place of the hexadecimal symbol to get the equivalent binary number

Example: Convert (23D)16 to binary number
Hexadecimal digits 2 3 D
Equivalent Binary 0010 0011 1101

Therefore, (23D)16 = (001000111101)2

Practice: Convert (3AD)16 to binary number

Conversion of a Number with Fractional Part

Decimal Number with Fractional Part to another Number System
step:

  1. To convert the fractional part of a decimal number to another number system with base value b, repeatedly multiply the fractional part by the base value b till the fractional part becomes 0
  2. If the fractional part start repeating, then stop further calculation.

Example: Convert (0.25)10 to binary.

binary%20to%20deci.JPG

Therefore, (0.25)10 = (0.01)2
Practice: Convert (0.675)10 to binary.

Example: Convert (0.675)10 to octal.

2.JPG

Therefore, (0.675)10= (0.53146)8
Practice: Convert (0.245)10 to octal.

Example: Convert (0.675)10 to hexadecimal form.

3.JPG

Non-decimal Number with Fractional Part to Decimal Number System:

Compute positional value of each digit in the given number using its base value. Add the product of positional value and the digit to get the equivalent decimal number with fractional part.

Example: Convert (100101.101)2 into decimal.

4.JPG

= 37 + 0.625
Therefore, (100101.101)2= (37.625)10
Practice: Convert (100111.111)2 into decimal.

Example: Convert (605.12)8 into decimal number.

5.JPG

= 1029 + 0.15625
Therefore, (605.12)8 = (1029.15625)10
Practice: Convert (65.25)8 into decimal number.

Fractional Binary Number to Octal or Hexadecimal Number

To convert the fractional binary number into octal or hexadecimal value, substitute groups of 3-bit or 4-bit in integer part by the corresponding digit.


Example: Convert (10101100.01011)2 to octal number.
010 101 100 .010 110
2 5 4. 2 6
Therefore, (10101100.01011)2 = (254.26)8

Practice: Convert (10101100.010111)2 to octal number

Example: Convert (10101100.010111)2 to hexadecimal number
10101100 . 01011100
A   C . 5   C
Therefore, (10101100.010111)2 = (AC.5C)16
Practice: Convert (10111100.010101)2 to hexadecimal number

Refrences:

  • NCERT Class 11 Computer Science
Share: