Free Study Material

Number Systems

Introduction

Every number you've ever written uses one particular counting system without thinking about it. This topic names that system formally, and introduces the others a computer actually uses internally.

Concept

A number system is a way of representing numbers using a fixed set of symbols. Its base (or radix) is how many symbols it uses before it needs to reuse them with a new position. CBSE covers four:

  • Decimal (Base 10) — the everyday system, using digits 0–9.
  • Binary (Base 2) — using only 0 and 1.
  • Octal (Base 8) — using digits 0–7.
  • Hexadecimal (Base 16) — using digits 0–9, then letters A–F for the values 10–15.

Every number system works the same underlying way: each digit's position has a place value, based on a power of the base. In decimal, 243 means (2 × 10²) + (4 × 10¹) + (3 × 10⁰) — hundreds, tens, and ones. The exact same idea, just with a different base, is what the next topic uses to convert between systems.

Explanation

Computers use binary specifically because it maps onto something physically simple and reliable: a transistor or a memory cell is naturally either carrying current or not — two stable states, matching binary's two digits exactly. Octal and hexadecimal exist mainly as a shorthand for binary, not because hardware uses them directly — a long string of binary digits is hard for a person to read, and both octal and hex compress it into a much shorter, more manageable form (covered fully in the next two topics).

Note: "Base" and "radix" mean exactly the same thing in this chapter — CBSE uses both terms interchangeably, so recognise either one.

Summary

A number system represents numbers using a fixed set of symbols, sized by its base: Decimal (10 symbols), Binary (2 symbols), Octal (8 symbols), Hexadecimal (16 symbols). Every system assigns each digit a place value based on a power of its base — computers use binary internally because it matches a circuit's two stable physical states.

The Language of Quantities

Humans typically use the Decimal System (Base-10) because we have ten fingers. However, digital circuits are made of switches that only have two states: ON or OFF. To bridge this gap, we use different Number Systems. A number system is simply a way to represent values using a specific set of symbols called Digits.

The Four Main Systems

System Name Base (Radix) Allowed Digits/Symbols Common Use
Binary 2 0, 1 Internal Computer Logic
Octal 8 0, 1, 2, 3, 4, 5, 6, 7 Shorthand for Binary
Decimal 10 0 to 9 Human Interaction
Hexadecimal 16 0-9, A, B, C, D, E, F Memory Addresses / Color Codes

Concept of Weightage

Every digit in a number has a positional value based on the base. For a number 52610

5
102 (Hundreds)
2
101 (Tens)
6
100 (Units)

In Binary, the weights would be powers of 2 (1, 2, 4, 8, 16...). In Hexadecimal, they are powers of 16.

Introduction

Now that you know binary uses place values based on powers of 2, this topic covers converting a number between decimal and binary in both directions.

Concept

Decimal to Binary — Division Method

Repeatedly divide the decimal number by 2, writing down each remainder, until the quotient reaches 0. The binary result is every remainder read from bottom to top (last remainder found first, in the answer).

Binary to Decimal — Place Value Method

Multiply each binary digit by its place value (a power of 2, starting at 2⁰ for the rightmost digit) and add all the results together.

Worked Example

Convert 25 (decimal) to binary:

StepDivisionQuotientRemainder
125 ÷ 2121
212 ÷ 260
36 ÷ 230
43 ÷ 211
51 ÷ 201

Reading the remainders from bottom to top gives 11001. So 25 in decimal is 11001 in binary.

Convert 11001 (binary) back to decimal, to check the answer: (1 × 2⁴) + (1 × 2³) + (0 × 2²) + (0 × 2¹) + (1 × 2⁰) = 16 + 8 + 0 + 0 + 1 = 25

The two directions confirm each other — this cross-check is always worth doing after any conversion.

Note: The division stops the moment the quotient reaches 0, not before — the very last remainder produced (from dividing 1 by 2 in the example above) becomes the leftmost digit of the binary answer, since remainders are read bottom to top.

Explanation

The division method works because it's finding the coefficients of a base-2 place-value expansion, one digit at a time, from the smallest place value upward — which is exactly why the remainders come out in reverse order and need to be read from bottom to top to get the correct final answer.

Summary

Decimal to binary: repeatedly divide by 2, and read the remainders bottom to top. Binary to decimal: multiply each digit by its place value (a power of 2) and add the results — the two conversions are exact reverses of each other, useful for checking your own work.

The Language of Computers

Computers use Binary (Base-2) because their circuits consist of billions of tiny switches. These switches can only be ON (1) or OFF (0). Translating our Decimal numbers into Binary is how we "talk" to the hardware.

Step-by-Step: Division Method

To convert, divide the decimal number by 2 and track the remainders.

Calculation Quotient Remainder
25 ÷ 2121 (LSB)
12 ÷ 260
6 ÷ 230
3 ÷ 211
1 ÷ 201 (MSB)
Answer (Bottom to Top): (11001)2

Step-by-Step: Expansion Method

Multiply each bit by 2position, starting from position 0 on the right.

Example: (1011)2

= (1 × 23) + (0 × 22) + (1 × 21) + (1 × 20)
= (1 × 8) + (0 × 4) + (1 × 2) + (1 × 1)
= 8 + 0 + 2 + 1
= (11)10

Introduction

Octal and hexadecimal follow the exact same two conversion methods you just used for binary — division for decimal-to-X, place value for X-to-decimal — just with a different base. This topic applies both, then covers the fast shortcut between binary and these two systems specifically.

Concept

Decimal ↔ Octal / Hexadecimal

  • Decimal to Octal — divide repeatedly by 8, read remainders bottom to top.
  • Decimal to Hexadecimal — divide repeatedly by 16, read remainders bottom to top (remainders 10–15 are written as A–F).
  • Octal/Hexadecimal to Decimal — multiply each digit by its place value (a power of 8, or of 16) and add the results.

Binary ↔ Octal / Hexadecimal (the Grouping Shortcut)

Because 8 = 2³ and 16 = 2⁴, binary converts to octal and hex directly, without going through decimal at all:

  • Binary to Octal — group the binary digits into sets of 3, starting from the right, and convert each group to its one octal digit.
  • Binary to Hexadecimal — group the binary digits into sets of 4, starting from the right, and convert each group to its one hex digit.

Worked Example

Convert 100 (decimal) to hexadecimal: 100 ÷ 16 = 6 remainder 4; 6 ÷ 16 = 0 remainder 6. Reading bottom to top: 100 decimal is 64 in hexadecimal.

Convert 11010110 (binary) to hexadecimal using grouping: Group into sets of 4 from the right: 1101 and 0110. 1101 = 13 = D; 0110 = 6. So 11010110 in binary is D6 in hexadecimal — no decimal step needed at all.

Note: When grouping from the right leaves a leftover group with fewer than 3 (for octal) or 4 (for hex) digits, pad it with leading zeros — they don't change the value, only make the group the right size to convert.

Explanation

The grouping shortcut works because each hex digit already represents exactly 4 binary digits' worth of information (2⁴ = 16, hex's full digit range) — the two systems line up perfectly, digit group for digit group, which is exactly why programmers use hexadecimal as a compact, readable stand-in for long binary values instead of writing binary out in full.

Summary

Decimal-to-octal/hex uses the same division method as decimal-to-binary, just with 8 or 16. Binary converts directly to octal (groups of 3 bits) or hexadecimal (groups of 4 bits) without needing to pass through decimal, because 8 and 16 are themselves powers of 2.

Why Bases 8 and 16?

Binary strings are long and difficult to manage. Because 8 and 16 are exact powers of 2 (23 and 24), we can group binary bits into single digits. This makes memory addresses and machine code much easier for humans to read.

Hexadecimal Alpha-Numeric Mapping

In Base-16, we use letters A-F to represent values from 10 to 15.

Decimal 10 11 12 13 14 15
Hex A B C D E F
Binary to Octal (Group of 3)

Split the binary number into sets of 3 from right to left.

110 | 101
6     5   → (65)8
Binary to Hexadecimal (Group of 4)

Split the binary number into sets of 4 from right to left.

1011 | 1100
11(B) | 12(C) → (BC)16

Introduction

Number systems represent numbers. This closing topic covers how a computer represents text — every character you type is actually stored as a number too, using an agreed-upon encoding scheme.

Concept

An encoding scheme is a fixed table that assigns a unique numeric code to every character it supports.

  • ASCII (American Standard Code for Information Interchange) — a 7-bit code, giving 128 possible values, covering English letters (upper and lower case), digits, and common punctuation.
  • ISCII (Indian Script Code for Information Interchange) — an 8-bit code, built as an extension of ASCII specifically to also represent Indian scripts (like Devanagari and Tamil).
  • Unicode — a much larger, universal scheme designed to represent every character of every written language in the world in one single, consistent standard, rather than needing a different scheme per language or region.

Worked Example

The letter A has the ASCII code 65. The letter a (lowercase) has the ASCII code 97. Because ASCII assigns consecutive codes to consecutive letters, B is 66, C is 67, and so on — this consistent, predictable spacing is exactly what makes operations like sorting text alphabetically work correctly at the character level: the computer is really just comparing these underlying numbers.

Note: ASCII's 7 bits give exactly 2⁷ = 128 possible codes — enough for English text and common symbols, but nowhere near enough for every script in the world, which is exactly the gap ISCII and then Unicode were each built to close.

Explanation

ASCII, ISCII, and Unicode exist as three points along the same widening need: ASCII covered English; ISCII extended that specifically for Indian languages by using the extra values an 8th bit provides; Unicode then went further still, aiming to cover every language's script in one single scheme, so that text from any language in the world can be represented, and exchanged between systems, without ambiguity about which encoding was used.

Summary

An encoding scheme assigns a unique number to every character. ASCII (7-bit, 128 codes) covers English text; ISCII (8-bit) extends it for Indian scripts; Unicode is a much larger, universal scheme aiming to represent every language's characters in one consistent standard.

What is Encoding?

Computers cannot "see" letters; they only see 1s and 0s. Encoding is the process of assigning a unique numeric code to every character on your keyboard. Without these standards, a "A" typed on one computer might show up as a "%" on another.

Character Decimal Character Decimal Character Decimal
Space32A - Z65 - 90[91
!33a - z97 - 122\92
"340 - 948 - 57]93
#35$36^94
%37&38_95
(40)41@64
ISCII (Indian Script Code for Information Interchange)

Developed in India to represent various Indian languages like Hindi, Marathi, and Tamil in digital format. It is an 8-bit code.

Unicode (The Universal Standard)

The modern world standard. It provides a unique number for every character across every language, including Emojis! It can use 8, 16, or 32 bits (UTF-8, UTF-16, UTF-32).

Want the full course?

Unlock all chapters, video lectures, and SQL practice exercises.

Get Full Access