🎓 Senior Secondary
| CBSE • Computer Science

Number Systems and Encoding

Binary, octal, hexadecimal, ASCII, Unicode.

1 Lesson 1 MCQ 1 Mnemonic
+25
XP
Available to earn
1
Lesson

Number Systems and Encoding — Lesson

1) Hook — A Fun Real-Life Example

Imagine you are at a cricket stadium in India, watching your favourite team play. The scoreboard shows the runs in decimal (base 10), but what if the scoreboard was designed to show scores in binary or hexadecimal? How would you read 1101 or 1A? Understanding different number systems is like learning different languages of numbers — essential for computers and digital devices worldwide!

2) Core Concepts — Number Systems and Encoding

In Computer Science, numbers are represented in various number systems. Each system has a base (or radix) which determines the number of unique digits including zero.

Number System Base (Radix) Digits Used Example
Decimal 10 0-9 237
Binary 2 0, 1 1101
Octal 8 0-7 345
Hexadecimal 16 0-9, A-F 1A3F

Place Value Concept: Each digit’s value depends on its position and the base.

For example, decimal number 237 can be expanded as:

2 × 10² + 3 × 10¹ + 7 × 10⁰ = 200 + 30 + 7 = 237

Similarly, binary number 1101 is:

1 × 2³ + 1 × 2² + 0 × 2¹ + 1 × 2⁰ = 8 + 4 + 0 + 1 = 13 (decimal)

Number System Conversions

To convert numbers between systems, use these methods:

  • Decimal to Other Bases: Repeated division by the base, collect remainders.
  • Other Bases to Decimal: Use place value expansion.
  • Binary to Octal/Hexadecimal: Group bits (3 for octal, 4 for hex) and convert each group.

Example: Convert decimal 45 to binary:

45 ÷ 2 = 22 remainder 1
22 ÷ 2 = 11 remainder 0
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Write remainders bottom to top: 101101 (binary)

Encoding Schemes

Computers use encoding schemes to represent characters as numbers (bits). Common schemes include:

Encoding Bits Description Example
ASCII 7 or 8 Represents English characters and control codes 'A' = 65 (Decimal) = 01000001 (Binary)
Unicode 16 or more Supports characters from all languages including Indian scripts 'अ' (Hindi letter) = U+0905

Why Encoding Matters: Without encoding, computers cannot understand or display text, numbers, or symbols.

3) Key Formulas / Rules

Decimal to Base-n Conversion:

Repeated division by n, write remainders in reverse order.

Base-n to Decimal Conversion:

Number = Σ (Digit × Base^Position), where position starts from 0 at rightmost digit.

Binary to Octal:

Group binary digits in sets of 3 (from right), convert each group to octal digit.

Binary to Hexadecimal:

Group binary digits in sets of 4 (from right), convert each group to hex digit.

4) Did You Know?

Computers use the binary number system because electronic circuits have two states: ON (1) and OFF (0). Even the ancient Indian mathematician Pingala (around 200 BCE) is credited with the earliest known description of binary numbers in his work on Sanskrit prosody!

5) Exam Tips

  • Always label the base when writing numbers (e.g., 1011₂, 7A₁₆).
  • Practice conversion methods thoroughly — many questions ask for decimal to binary/octal/hex and vice versa.
  • Remember grouping rules for binary to octal (3 bits) and binary to hex (4 bits).
  • Don’t confuse place values: The rightmost digit is position 0, increasing to the left.
  • Encoding questions may ask for ASCII codes — memorize common letters like 'A' = 65.
  • Previous Year Question Pattern: Typically 2–3 marks for conversions, 1–2 marks for encoding, and sometimes 4 marks for detailed explanation or multiple conversions.
  • Common Mistakes: Forgetting to reverse remainders in decimal to base-n conversion; mixing up digit groups in binary to octal/hex; ignoring base notation.
2
MCQ Practice

Number Systems and Encoding — Mcq

3
Memory Trick

Number Systems and Encoding — Mnemonic

Mnemonic 1: Number Systems Order 📊

"**B**oys **O**ften **D**rink **H**ot **D**osa" 🍽️

  • B - Binary (Base 2)
  • O - Octal (Base 8)
  • D - Decimal (Base 10)
  • H - Hexadecimal (Base 16)
  • D - Denotes the increasing base values

Use this to remember the common number systems in order of increasing base.

Mnemonic 2: Encoding Types 🎭

"**A**ll **U**ncles **A**re **M**emory **H**eroes" 🦸‍♂️

  • A - ASCII
  • U - Unicode
  • A - AMI (Alternate Mark Inversion)
  • M - Manchester Encoding
  • H - Huffman Coding

Perfect to recall popular encoding schemes used in computer science.

Mnemonic 3: Binary Place Values in Hindi 🇮🇳

"**2 ka Power, Lagao Dhyan, Har Bit Ka Apna Gyaan"** 🔢

  • Each bit represents 2n where n = position from right (starting 0)
  • Example: 1011 = (1×2³) + (0×2²) + (1×2¹) + (1×2⁰) = 8 + 0 + 2 + 1 = 11

Remember: "2 ka Power" = base, "Lagao Dhyan" = pay attention, "Har Bit Ka Apna Gyaan" = each bit has its own value.

Interactive

Mission: Master This Topic!

Reinforce what you learned with fun activities

🎯

Ready to Battle? Test Your Knowledge!

Practice MCQs, build combos, climb the leaderboard!

Start Practice

Loading...

Hey! 🔥 Your 7-day streak is at risk. Complete one quick quest today?

Streak broken? No worries. Recover with bonus XP by completing a quest now.