Number System

A Computer Number System is a method used to represent numbers within a computer. These systems are essential for storing and processing data.

  • Every number system has a base (or radix).
  • Positional Number Systems are primarily used in computers, where the position of a digit determines its value.

1. Types of Number Systems

Types of Positional Number Systems Used in Computers

  1. Binary Number System (Base 2): Uses only two digits: 0 and 1. Binary is the basic number representation used by digital electronic systems.
  2. Octal Number System (Base 8): Uses eight digits: 0–7. It is often used as a shorthand for binary numbers because three binary digits can represent one octal digit.
  3. Decimal Number System (Base 10): This is the everyday number system we use and contains digits 0–9.
  4. Hexadecimal Number System (Base 16): Uses sixteen symbols: 0–9 and A–F. The letters represent decimal values as follows: A=10, B=11, C=12, D=13, E=14, F=15. Hexadecimal is commonly used in computing because four binary digits can be represented by one hexadecimal digit.

2. Number System Conversions

Number system conversion is an important topic in Computer Science and competitive examinations. The following sections explain commonly used conversion methods with examples.

2.1 Binary to Decimal Conversion

To convert a binary number to decimal, multiply each binary digit by its corresponding power of 2 and add the results. The rightmost digit has the power 0.

Example 1: Convert (11110)2 to Decimal

Step 1: Write the binary number:

1   1   1   1   0

Step 2: Assign powers of 2 from right to left:

24   23   22   21   20

Step 3: Calculate the powers:

16   8   4   2   1

Step 4: Multiply and add:

(1 × 16) + (1 × 8) + (1 × 4) + (1 × 2) + (0 × 1)

= 16 + 8 + 4 + 2 + 0

= 30

Therefore, (11110)2 = (30)10

2.2 Decimal to Binary Conversion

There are two common methods:

  1. Repeated Division by 2: Divide the decimal number repeatedly by 2 and record the remainders. Read the remainders from bottom to top.
  2. Using Powers of 2: Find the largest power of 2 less than or equal to the number, subtract it, and continue until the remainder becomes zero.
Example 2: Convert (25)10 to Binary

Using the powers of 2 method:

Powers of 2:   16   8   4   2   1

25 − 16 = 9

9 − 8 = 1

1 − 1 = 0

Therefore:   1   1   0   0   1

(25)10 = (11001)2

2.3 Octal to Binary Conversion

To convert an octal number to binary, replace each octal digit with its corresponding 3-bit binary equivalent.

Example 3: Convert (537)8 to Binary

5 = 101
3 = 011
7 = 111

(101 011 111)2

(537)8 = (101011111)2

2.4 Binary to Octal Conversion

Group the binary digits into sets of three from right to left. Add leading zeros if necessary and convert each group into its octal equivalent.

Example 4: Convert (1010111100)2 to Octal

Step 1: Group the binary digits:

001   010   111   100

Step 2: Convert each group:

001 = 1
010 = 2
111 = 7
100 = 4

(1010111100)2 = (1274)8

2.5 Hexadecimal to Binary Conversion

Convert each hexadecimal digit into its corresponding 4-bit binary equivalent.

Example 5: Convert (5AD)16 to Binary

5 = 0101
A = 1010
D = 1101

(0101 1010 1101)2

(5AD)16 = (010110101101)2

2.6 Binary to Hexadecimal Conversion

Group binary digits into sets of four from right to left. Add leading zeros if required and convert each group into hexadecimal.

Example 6: Convert (1010101101001)2 to Hexadecimal

Step 1: Group into sets of four:

0001   0101   0110   1001

0001 = 1
0101 = 5
0110 = 6
1001 = 9

(1010101101001)2 = (1569)16

2.7 Octal to Hexadecimal Conversion

For conversion between octal and hexadecimal, binary can be used as an intermediate number system.

Example 7: Convert (46)8 to Hexadecimal

Step 1: Octal → Binary

4 = 100
6 = 110

(100110)2

Step 2: Binary → Hexadecimal

0010   0110

0010 = 2
0110 = 6

(46)8 = (26)16

2.8 Decimal to Octal Conversion

Divide the decimal number repeatedly by 8 and read the remainders from bottom to top.

Example 8: Convert (1234)10 to Octal

1234 ÷ 8 = 154 remainder 2
154 ÷ 8 = 19 remainder 2
19 ÷ 8 = 2 remainder 3
2 ÷ 8 = 0 remainder 2

Reading the remainders from bottom to top:

(1234)10 = (2322)8

2.9 Decimal to Hexadecimal Conversion

Divide the decimal number repeatedly by 16. Use A–F for decimal values 10–15 and read the remainders from bottom to top.

Example 9: Convert (1234)10 to Hexadecimal

1234 ÷ 16 = 77 remainder 2
77 ÷ 16 = 4 remainder 13 (D)
4 ÷ 16 = 0 remainder 4

(1234)10 = (4D2)16

2.10 Octal to Decimal Conversion

Multiply each octal digit by its corresponding power of 8 and add the results.

Example 10: Convert (125)8 to Decimal

(1 × 82) + (2 × 81) + (5 × 80)

= (1 × 64) + (2 × 8) + (5 × 1)

= 64 + 16 + 5

(125)8 = (85)10

2.11 Hexadecimal to Decimal Conversion

Multiply each hexadecimal digit by its corresponding power of 16. Use the decimal values of A–F.

Example 11: Convert (CAFE)16 to Decimal

C = 12, A = 10, F = 15, E = 14

(12 × 163) + (10 × 162) + (15 × 161) + (14 × 160)

= 49152 + 2560 + 240 + 14

(CAFE)16 = (51966)10

3. Fractional Number Conversions

3.1 Binary Fraction to Decimal

For digits after the decimal point, use negative powers of 2: 2-1, 2-2, 2-3, and so on.

Example 12: Convert (0.1011)2 to Decimal

(1 × 2-1) + (0 × 2-2) + (1 × 2-3) + (1 × 2-4)

= 0.5 + 0 + 0.125 + 0.0625

(0.1011)2 = (0.6875)10

Example 13: Convert (1101.1011)2 to Decimal

Whole part: (1101)2 = (13)10

Fractional part: (0.1011)2 = (0.6875)10

Therefore, (1101.1011)2 = (13.6875)10

3.2 Decimal Fraction to Binary

To convert a decimal fraction to binary, repeatedly multiply the fractional part by 2. Record the integer part at each step. Read the integer parts from top to bottom.

Example 14: Convert (0.375)10 to Binary

0.375 × 2 = 0.750 → 0
0.750 × 2 = 1.500 → 1
0.500 × 2 = 1.000 → 1

(0.375)10 = (0.011)2

Example 15: Convert (23.15)10 to Binary

Whole part: (23)10 = (10111)2

Fractional part:

0.15 × 2 = 0.30 → 0
0.30 × 2 = 0.60 → 0
0.60 × 2 = 1.20 → 1
0.20 × 2 = 0.40 → 0
0.40 × 2 = 0.80 → 0
0.80 × 2 = 1.60 → 1

The fractional part repeats, so the binary representation is a repeating fraction.

(23.15)10 ≈ (10111.001001...)2

3.3 Decimal Fraction to Octal

To convert a decimal fraction to another base, multiply the fractional part repeatedly by the target base. For octal, multiply by 8.

Example 16: Convert (0.37)10 to Octal

0.37 × 8 = 2.96 → 2
0.96 × 8 = 7.68 → 7
0.68 × 8 = 5.44 → 5

(0.37)10 ≈ (0.275)8

4. Binary Arithmetic

Binary arithmetic uses only two digits: 0 and 1. Binary addition and subtraction are important for understanding how computers represent and process data.

4.1 Binary Addition Rules

Operation Result Carry
0 + 0 0 0
0 + 1 1 0
1 + 0 1 0
1 + 1 0 1
1 + 1 + 1 1 1
Example 17: Add (1011)2 + (110)2
    1011
  + 0110
  ------
   10001
        

(1011)2 + (110)2 = (10001)2

4.2 Binary Subtraction Rules

Operation Result Borrow
0 − 0 0 0
1 − 0 1 0
1 − 1 0 0
0 − 1 1 1
Example 18: Subtract (1010)2 − (101)2
    1010
  - 0101
  ------
    0101
        

Therefore, (1010)2 − (101)2 = (101)2

5. Important Number System Facts

  • Hexadecimal Values: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
  • Valid Hexadecimal Digits: 0–9 and A–F.
  • Invalid Hexadecimal Digit: G is not a valid hexadecimal digit.
  • Largest Two-Digit Hexadecimal Number: (FF)16.
  • Binary: Base 2 and uses digits 0 and 1.
  • Octal: Base 8 and uses digits 0–7.
  • Decimal: Base 10 and uses digits 0–9.
  • Hexadecimal: Base 16 and uses 0–9 and A–F.

6. Quick Exam Tips

  • Remember the bases: Binary = 2, Octal = 8, Decimal = 10, Hexadecimal = 16.
  • Remember that 3 binary bits = 1 octal digit.
  • Remember that 4 binary bits = 1 hexadecimal digit.
  • Practice decimal-to-binary conversion using repeated division by 2.
  • Practice binary-to-decimal conversion using powers of 2.
  • For octal ↔ hexadecimal conversion, binary can be used as an intermediate step.
  • Remember hexadecimal values: A=10, B=11, C=12, D=13, E=14, F=15.
  • Practice both whole-number and fractional conversions.
  • Learn the basic rules of binary addition and subtraction.

© 2026 ExamRig. All Rights Reserved.