Class 11 Computer Science
Chapter 2: Data Representation
1. What is Data Representation?
Data representation is the process of storing data in a format that computers can process. It
includes various methods of representing data such as binary, octal, hexadecimal, and their
usage in computer systems.
2. Number System
The number system is the foundation of data representation. There are several types of
number systems used in computers:
1. Binary Number System (Base 2)
It uses two digits: 0 and 1. Computers use binary to represent data because digital circuits
recognize two states: on (1) and off (0). Examples: 1011, 1101
2. Octal Number System (Base 8)
It uses eight digits: 0 to 7. It is commonly used to represent binary data more compactly.
Examples: 17, 42
3. Decimal Number System (Base 10)
It uses ten digits: 0 to 9. This is the number system humans use in daily life. Examples: 45,
102
4. Hexadecimal Number System (Base 16)
It uses sixteen digits: 0 to 9 and A to F (where A=10, B=11, ..., F=15). It is used to represent
binary data more concisely and is commonly used in programming. Examples: 2F, A4
3. Conversion Between Number Systems
Understanding how to convert between number systems is crucial for working with data
representation.
1. Binary to Decimal Conversion Example
Convert binary 1011 to decimal:
1. Write down the binary number and assign powers of 2 to each bit starting from the right.
2. Multiply each bit by the corresponding power of 2.
Binary: 1011
Power of 2: 2^3, 2^2, 2^1, 2^0
1 × 2^3 = 8, 0 × 2^2 = 0, 1 × 2^1 = 2, 1 × 2^0 = 1
Sum: 8 + 0 + 2 + 1 = 11
Decimal equivalent: 11
2. Decimal to Binary Conversion Example
Convert decimal 45 to binary:
1. Divide the decimal number by 2 and record the remainder.
2. Repeat the division for the quotient until the quotient is 0.
3. Read the remainders from bottom to top.
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
Binary equivalent: 101101
3. Binary to Hexadecimal Conversion Example
Convert binary 110101101 to hexadecimal:
1. Group the binary number into sets of 4 bits (starting from the right).
2. Convert each group to its hexadecimal equivalent.
Binary: 110101101
Group the bits: 1101 0110 1 (padded with zeros on the left for the final group).
Binary to Hexadecimal: D 6 1
Hexadecimal equivalent: D61
4. Hexadecimal to Binary Conversion Example
Convert hexadecimal A4 to binary:
1. Convert each hexadecimal digit to its 4-bit binary equivalent.
A = 1010, 4 = 0100
Binary equivalent: 10100100
5. Decimal to Octal Conversion Example
Convert decimal 45 to octal:
1. Divide the decimal number by 8 and record the remainder.
2. Repeat the division for the quotient until the quotient is 0.
3. Read the remainders from bottom to top.
45 ÷ 8 = 5 remainder 5
5 ÷ 8 = 0 remainder 5
Octal equivalent: 55
6. Octal to Decimal Conversion Example
Convert octal 55 to decimal:
1. Multiply each digit of the octal number by the corresponding power of 8.
5 × 8^1 = 40, 5 × 8^0 = 5
Sum: 40 + 5 = 45
Decimal equivalent: 45
Here are examples with calculations for each conversion type:
1. Binary to Decimal Conversion Example
Convert binary 1011 to decimal:
Steps:
Write down the binary number and assign powers of 2 to each bit starting from
the right.
Multiply each bit by the corresponding power of 2.
Binary Power of 2 Calculation Result
1 2^3 1 × 2^3 = 8 8
0 2^2 0 × 2^2 = 0 0
1 2^1 1 × 2^1 = 2 2
1 2^0 1 × 2^0 = 1 1
Sum the results: 8+0+2+1=118 + 0 + 2 + 1 = 118+0+2+1=11
Decimal equivalent of binary 1011 is 11.
2. Decimal to Binary Conversion Example
Convert decimal 45 to binary:
Steps:
Divide the decimal number by 2 and record the remainder.
Repeat the division for the quotient until the quotient is 0.
Read the remainders from bottom to top.
45÷2=22 remainder 1
22÷2=11remainder 0
22÷2=11 remainder 0
11÷2=5 remainder 1
11÷2=5 remainder 1
5÷2=2 remainder 1
5÷2=2 remainder 1
2÷2=1 remainder 0
2÷2=1 remainder 0
1÷2=0 remainder 1
1÷2=0 remainder 1
Reading the remainders from bottom to top: Binary equivalent of 45 = 101101
3. Binary to Hexadecimal Conversion Example
Convert binary 110101101 to hexadecimal:
Steps:
Group the binary number into sets of 4 bits (starting from the right).
If the leftmost group has fewer than 4 bits, pad it with leading zeros.
Convert each 4-bit group to its hexadecimal equivalent.
Binary: 110101101
Group the bits: 11011101 0110 1→ 0001 1010 1101 (padded with zeros on the left for
the final group). Now convert each group to hexadecimal:
1101 (binary) = D (hexadecimal)
0110 (binary) = 6 (hexadecimal)
0001 (binary) = 1 (hexadecimal)
Hexadecimal equivalent of binary 110101101 = D61.
4. Hexadecimal to Binary Conversion Example
Convert hexadecimal A4 to binary:
Steps:
Convert each hexadecimal digit to its 4-bit binary equivalent.
A=1010
4=0100
Binary equivalent of hexadecimal A4 = 10100100.
5. Decimal to Octal Conversion Example
Convert decimal 45 to octal:
Steps:
Divide the decimal number by 8 and record the remainder.
Repeat the division for the quotient until the quotient is 0.
Read the remainders from bottom to top.
45÷8=5 remainder 545 \div 8 = 5 \text{ remainder } 545÷8=5 remainder 5
5÷8=0 remainder 55 \div 8 = 0 \text{ remainder } 55÷8=0 remainder 5
Reading the remainders from bottom to top: Octal equivalent of 45 = 55.
6. Octal to Decimal Conversion Example
Convert octal 55 to decimal:
Steps:
Multiply each digit of the octal number by the corresponding power of 8.
5×81=5×8=405 \times 8^1 = 5 \times 8 = 405×81=5×8=40 5×80=5×1=55 \times 8^0 =
5 \times 1 = 55×80=5×1=5
Sum the results:
40+5=4540 + 5 = 4540+5=45
Decimal equivalent of octal 55 = 45.
Character Encoding Systems
1. ASCII (American Standard Code for Information Interchange)
Definition: ASCII is a 7-bit character encoding scheme used to represent
English characters, numbers, and control characters.
Bit Size: 7 bits (can represent 128 characters: 0–127).
Characters Represented:
o 0–31: Control characters (e.g., newline, tab).
o 32–126: Printable characters (letters, digits, symbols).
o 127: DEL (delete).
Example:
o A → ASCII value = 65
o a → ASCII value = 97
o 0 → ASCII value = 48
Limitation: Only supports English and lacks representation for other languages
and special symbols.
2. ISCII (Indian Standard Code for Information Interchange)
Definition: ISCII is an 8-bit encoding scheme developed by the Indian
government to represent characters of Indian languages along with English.
Bit Size: 8 bits (can represent 256 characters).
Languages Supported:
o Hindi, Tamil, Telugu, Kannada, Bengali, Gujarati, Malayalam, Oriya,
Punjabi, Assamese, and Sanskrit.
Structure:
o ASCII characters (0–127) are the same as standard ASCII.
o Indian language characters are assigned codes from 128 to 255.
Advantages:
o Allows multiple Indian scripts in one encoding.
o Promotes Indian language computing.
Limitation: Not widely adopted; replaced by Unicode in modern applications.
3. Unicode (Universal Character Encoding Standard)
Definition: Unicode is a universal character encoding standard developed to
represent text in all major writing systems of the world.
Bit Sizes:
o UTF-8 (Variable length: 1 to 4 bytes)
o UTF-16 (2 or 4 bytes)
o UTF-32 (4 bytes fixed)
Total Characters: Can represent over 1.1 million characters (current version
supports ~149,000+ characters).
Languages Supported:
o All major global and regional languages including English, Indian
languages, Chinese, Arabic, Greek, etc.
Advantages:
o Platform-independent and supports multilingual text.
o Standard for modern computing and the internet.
Example:
o A → Unicode = U+0041
o अ (Hindi) → Unicode = U+0905