Skip to content
8 MIN LESSON · COMPUTER SCIENCE

Class 11 Number Systems and Encoding: Complete Concepts and Practice

Computer Science — Bases, digits and positional value, Converting to decimal, Converting decimal integers to another base, Binary, octal and hexadecimal shortcuts, Fractions and precision, Binary arithmetic and fixed width, Character sets and encodings, Tested representation examples.

Big picture

Digital systems represent information using patterns of bits. A number written on a screen, a stored Hindi word and the colour of an image all need agreed representations. The same bit pattern can mean different things depending on whether a program interprets it as a number, text or another data type.

Number-system questions reward a dependable method rather than memorised answers. Always write the base, expand place values, and check a conversion by reversing it. Encoding questions add a second distinction: a character is an abstract symbol, while its stored bytes depend on the encoding chosen.

Learning goals

  • Explain positional weights in four number systems.

  • Convert integers and terminating fractions with working.

  • Perform binary addition and subtraction.

  • Calculate unsigned fixed-width ranges.

  • Distinguish ASCII, ISCII, Unicode and UTF-8.

Core ideas

1. Bases, digits and positional value

A number system provides digits and rules for representing quantities. In a positional system, each place has a weight that is a power of the base. Decimal uses base ten; binary uses base two. Octal uses eight digits, 0–7, while hexadecimal uses 0–9 and A–F, where A represents ten and F represents fifteen.

The rightmost integer position has weight base⁰ = 1. Moving left multiplies the weight by the base. Thus decimal 305 means 3 × 100 + 0 × 10 + 5 × 1. A zero preserves a place; omitting it changes the number. Binary 102 is invalid because digit 2 is unavailable in base two. A base label prevents ambiguity: the written string 10 can represent two, eight, ten or sixteen.

2. Converting to decimal

To convert an integer to decimal, multiply each digit by its positional weight and add. Work from the rightmost digit to avoid shifting every power accidentally. For binary 110101₂, the weights from left to right are 32, 16, 8, 4, 2 and 1. The sum is 32 + 16 + 0 + 4 + 0 + 1 = 53₁₀.

For 247₈, calculate 2 × 8² + 4 × 8 + 7 = 128 + 32 + 7 = 167₁₀. For 3B₁₆, replace B by eleven, then calculate 3 × 16 + 11 = 59₁₀. Do not treat the symbols B and 11 as two separate digits in hexadecimal. Explain the weights in working, even if a calculator could produce the answer immediately.

3. Converting decimal integers to another base

Repeated division produces the digits of a non-negative integer in another base. Divide by the destination base, record the remainder, and continue with the quotient until it becomes zero. Read the remainders from bottom to top because the first remainder belongs to the units position.

Convert 53₁₀ to binary: 53 ÷ 2 gives quotient 26, remainder 1; then 26 gives 13 remainder 0; 13 gives 6 remainder 1; 6 gives 3 remainder 0; 3 gives 1 remainder 1; finally 1 gives 0 remainder 1. Reversing the recorded remainders gives 110101₂. For hexadecimal, 167 ÷ 16 gives 10 remainder 7, and 10 ÷ 16 gives 0 remainder 10. Replace ten by A to obtain A7₁₆. Zero itself is written 0, rather than an empty representation.

4. Binary, octal and hexadecimal shortcuts

One octal digit corresponds to three binary bits because 8 = 2³. One hexadecimal digit corresponds to four bits because 16 = 2⁴. Group integer bits from the right. If necessary, add leading zeros to complete the leftmost group; leading zeros do not change a non-negative value.

For 110101₂, grouping as 110 101 gives 6 and 5, so the result is 65₈. Grouping as 0011 0101 gives 3 and 5, so the result is 35₁₆. For 7A₁₆, write 7 as 0111 and A as 1010, obtaining 01111010₂, or 1111010₂ without the leading zero.

Digit group

Binary

Decimal value

Octal 7

111

7

Hexadecimal A

1010

10

Hexadecimal F

1111

15

Do not regroup from the left without padding appropriately: place values are anchored at the units position.

5. Fractions and precision

Positions to the right of the point have negative powers of the base. Binary 0.101₂ means 1 × 2⁻¹ + 0 × 2⁻² + 1 × 2⁻³ = 0.5 + 0 + 0.125 = 0.625₁₀. To convert a decimal fraction to binary, repeatedly multiply by two and record each integer part in order.

For 0.625, multiplication gives 1.25, so record 1 and retain 0.25. Next comes 0.5, so record 0. Finally 0.5 × 2 gives 1.0, so record 1 and stop. The result is 0.101₂. Some fractions do not terminate in binary, so a fixed-width representation must approximate them. This explains why many decimal calculations in floating-point programs require sensible rounding rather than assuming every fraction is represented exactly.

6. Binary arithmetic and fixed width

Binary addition follows four small rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10₂. When adding three ones, write 1 and carry 1. Align equal place values before starting at the right.

For 1011₂ + 0110₂, the units column gives 1, the next gives 0 with carry 1, the next gives 0 with carry 1, and the leftmost gives 0 with carry 1. The result is 10001₂, checked by 11 + 6 = 17. Binary subtraction uses borrowing: borrowing one from the next column supplies two in the current column. Thus 1010₂ − 0011₂ = 0111₂, checked by 10 − 3 = 7.

With n bits, there are 2ⁿ distinct patterns. Unsigned values range from zero to 2ⁿ − 1. Four bits therefore represent 0–15; sixteen needs a fifth bit. An overflow means the mathematical result does not fit the available representation, not that arithmetic has stopped being valid.

7. Character sets and encodings

A character set identifies symbols; an encoding specifies their representation. ASCII is a seven-bit code with 128 possible values, widely associated with English letters, digits, punctuation and controls. The digit character '7' is a symbol, distinct from the numeric quantity seven.

Unicode assigns code points to characters across many writing systems, including Devanagari. UTF-8 is a variable-length encoding of Unicode, so it is incorrect to say every Unicode character occupies exactly two bytes. A displayed character can involve more than one code point, especially when combining marks are involved. ISCII is an Indian-script encoding encountered in computing syllabuses; distinguish its historical purpose from Unicode's broader character repertoire. These distinctions help explain why text copied with the wrong decoding can become unreadable.

8. Tested representation examples

Python conversion functions let you check hand calculations. The prefixes 0b, 0o and 0x identify binary, octal and hexadecimal strings returned by the relevant functions. They are labels, not extra digits of the value.

print(int("110101", 2))
print(bin(53), oct(53), hex(53))
print(ord("A"), chr(66))
print(len("A".encode("utf-8")))

Output:

53
0b110101 0o65 0x35
65 B
1

The second argument of int specifies the input base. ord maps a single character to its Unicode code point; chr performs the inverse. The final statement counts encoded bytes, not merely visible symbols. ASCII A is also represented by one byte in UTF-8. Do not generalise that result to every language. In an exam, show the conversion method first and use the program as a cross-check, since a correct final number without the requested working may leave the reasoning unclear.

A reliable approach to questions

  1. Read the command word before choosing an answer. A definition needs the distinguishing feature; a comparison needs matching criteria on both sides; an application needs a reason linked to the situation.

  2. Extract the supplied evidence and assumptions. Keep a small working table rather than relying on memory. If information is absent, state the limit instead of inventing a value or claiming certainty.

  3. Work through the relevant rule one step at a time. For a program, record the changing state; for a scenario, connect the requirement to the feature that meets it. Explain why the closest alternative fails.

  4. Check the result against the original question, including boundary cases, units and wording. Present a concise final answer followed by enough reasoning for another student to reproduce your conclusion.

Connections that matter

  • Computer organisation uses bit patterns in registers and memory.

  • Boolean logic operates on binary truth values.

  • Python strings represent text while encoding converts that text into bytes.

Common mistakes

  • Reading division remainders top-down: reverse them for integer conversion.

  • Grouping binary integers from the left: anchor groups at the right.

  • Treating a character digit as a numeric value: encoding stores a symbol code.

  • Assuming all Unicode symbols use two bytes: UTF-8 is variable length.

Revision checklist

  • I can explain positional weights in four number systems.

  • I can convert integers and terminating fractions with working.

  • I can perform binary addition and subtraction.

  • I can calculate unsigned fixed-width ranges.

  • I can distinguish ASCII, ISCII, Unicode and UTF-8.

Practise this topic →

Discussion

Sign in to join the discussion.

Sign in

No comments yet. Be the first to share your thoughts.