Skip to content

Number Systems in Computers

Computers use different number systems to represent and process data. The most common are:


1. Decimal Number System (Base 10)

  • Digits used: 0 to 9 (10 symbols).
  • It is the number system we use in daily life.
  • Example: 325 (3×10² + 2×10¹ + 5×10⁰).

2. Binary Number System (Base 2)

  • Digits used: 0 and 1 only.
  • Each digit is called a bit.
  • It is the language of computers (machine language).
  • Example: (1011)₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11 (Decimal).

3. Octal Number System (Base 8)

  • Digits used: 0 to 7.
  • Example: (537)₈ = 5×8² + 3×8¹ + 7×8⁰ = 351 (Decimal).

4. Hexadecimal Number System (Base 16)

  • Digits used: 0–9 and A–F (where A=10, B=11, …, F=15).
  • Used in computer memory addresses, color codes (like HTML).
  • Example: (2F)₁₆ = 2×16¹ + 15×16⁰ = 47 (Decimal).

Inter-Conversions of Number Systems


A. Decimal → Other Systems

  1. Decimal → Binary
    • Divide the decimal number by 2 repeatedly, write remainders in reverse.
    • Example: (13)₁₀ → divide by 2 → 1101₂.
  2. Decimal → Octal
    • Divide by 8 repeatedly.
    • Example: (125)₁₀ → 175₈.
  3. Decimal → Hexadecimal
    • Divide by 16 repeatedly.
    • Example: (254)₁₀ → FE₁₆.

B. Binary → Other Systems

  1. Binary → Decimal
    • Multiply each digit by 2ⁿ (from right to left).
    • Example: (10101)₂ = 21₁₀.
  2. Binary → Octal
    • Group binary digits in 3 bits (right to left).
    • Example: (110101)₂ → (110)(101) → 65₈.
  3. Binary → Hexadecimal
    • Group binary digits in 4 bits.
    • Example: (10111100)₂ → (1011)(1100) → BC₁₆.

C. Octal ↔ Hexadecimal (via Binary)

  1. Convert Octal → Binary → Hexadecimal.
  2. Example: (745)₈ → Binary: 111100101 → Group in 4 bits → (1 1110 0101) → 1E5₁₆.

Quick Reference Table

DecimalBinaryOctalHexadecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Summary for Exams

  • Binary = Base 2 (0,1)
  • Octal = Base 8 (0–7)
  • Decimal = Base 10 (0–9)
  • Hexadecimal = Base 16 (0–9, A–F)
  • Conversion → Repeated division or grouping method.