Chapter at a glance
- Computer understands only binary (0s and 1s); keys pressed on keyboard are mapped to unique codes that are converted to binary.
- Encoding is the mechanism of converting data into an equivalent cipher using a specific code.
- ASCII is a 7-bit encoding scheme that represents 128 characters (English keyboard only).
- ISCII is an 8-bit code that retains all 128 ASCII codes and adds 128 codes for Indian language aksharas.
- UNICODE provides a unique number for every character of every written language; UTF-8, UTF-16 and UTF-32 are its common encodings; it is a superset of ASCII.
- Number systems (decimal base-10, binary base-2, octal base-8, hexadecimal base-16) are positional; value of each symbol depends on its position and the base.
- Conversion between number systems follows fixed procedures: repeated division for decimal to other bases, positional-value summation for other bases to decimal, and bit-grouping for binary–octal/hexadecimal.
- Hexadecimal and octal provide compact representation of binary numbers (4 bits and 3 bits respectively).
Key terms and definitions
- Encoding: The mechanism of converting data into an equivalent cipher using a specific code.
- ASCII (American Standard Code for Information Interchange): 7-bit encoding scheme that can represent 128 different characters of the English keyboard.
- ISCII (Indian Script Code for Information Interchange): 8-bit encoding scheme (256 characters) that retains all 128 ASCII codes and uses the remaining 128 codes for Indian language aksharas.
- UNICODE: Character encoding standard that assigns a unique number to every character irrespective of device, operating system or application; superset of ASCII (values 0–128 identical).
- UTF-8, UTF-16, UTF-32: Commonly used UNICODE encodings.
- Number system: A method to represent numbers; each system has a unique set of literals whose count is the radix (base).
- Positional number system: System in which the value of each symbol depends on its position within the number and the base of the system.
- Positional value: Value obtained by raising the base to the power of the position number of a symbol.
- Base / Radix: Number of unique symbols (literals) used in a number system; written as subscript (e.g., (65)₁₀).
Syntax and constructs
No programming statements, functions or commands are taught in this chapter.
Algorithms and worked logic
Decimal to any other base (binary/octal/hexadecimal)
1. Repeatedly divide the decimal number by the target base.
2. Record the remainder after each division.
3. Continue until the quotient becomes zero.
4. Write the remainders from bottom to top.
Example (decimal 65 to binary):
65 ÷ 2 = 32 rem 1
32 ÷ 2 = 16 rem 0
16 ÷ 2 = 8 rem 0
8 ÷ 2 = 4 rem 0
4 ÷ 2 = 2 rem 0
2 ÷ 2 = 1 rem 0
1 ÷ 2 = 0 rem 1
Binary = 1000001
Any base to decimal
- Write position numbers from right to left (starting at 0 for integer part).
- Compute positional value = base^position.
- Multiply each digit by its positional value.
- Sum all products.
Binary to octal
Group binary digits in sets of 3 from right to left (add leading zeros if needed); replace each group by its octal digit.
Binary to hexadecimal
Group binary digits in sets of 4 from right to left (add leading zeros if needed); replace each group by its hexadecimal symbol.
Fractional part conversion (decimal to other base)
Repeatedly multiply the fractional part by the target base; record the integer part of each product from top to bottom; stop when fractional part becomes 0 or repeats.
Common errors and exam pitfalls
- Writing remainders top-to-bottom instead of bottom-to-top in decimal-to-base conversions (loses all marks for the number).
- Incorrect grouping direction or size (using 4 bits for octal or 3 bits for hex).
- Forgetting to add leading zeros to make complete groups of 3 or 4 bits.
- Using wrong decimal equivalents for hexadecimal letters A–F (must use 10–15).
- Reversing the direction of positional-value calculation for fractional parts (position numbers decrease left to right).
- Stopping fractional multiplication too early or continuing after a repeating pattern appears.
- Confusing base values (binary = 2, octal = 8, hex = 16) or writing the base subscript incorrectly.
- Treating UNICODE as an 8-bit or 16-bit fixed-width scheme instead of noting variable-length UTF encodings.