Encoding Schemes and Number System โ Chapter 2 Notes |1ST PU
Complete Short Notes & Exam Preparation Guide
1st PUC Computer Science Notes | Class 11 Computer Science Notes | Encoding Schemes and Number System
Based on the 1ST PU NCERT textbook
๐ Chapter Overview
This chapter explains how text entered through a computer keyboard is encoded, how computers represent numbers, and how numbers can be converted between different number systems.
The chapter mainly covers:
- Introduction to Encoding
- ASCII
- ISCII
- UNICODE
- Number System
- Decimal Number System
- Binary Number System
- Octal Number System
- Hexadecimal Number System
- Applications of Hexadecimal Number System
- Conversion Between Number Systems
- Conversions involving fractional numbers
๐ Table of Contents
- Introduction to Encoding
- ASCII
- ISCII
- UNICODE
- Number System
- Decimal Number System
- Binary Number System
- Octal Number System
- Hexadecimal Number System
- Applications of Hexadecimal Number System
- Conversion Between Number Systems
- Decimal to Other Number Systems
- Other Number Systems to Decimal
- Binary, Octal and Hexadecimal Conversions
- Fractional Number Conversions
- Quick Revision
- Important Questions
2.1 Introduction to Encoding
A computer understands binary language consisting of 0 and 1. Therefore, when a key on the keyboard is pressed, it is internally mapped to a unique code and then converted into binary.
๐ฅ๏ธ Encoding of Data Entered Using Keyboard
A
65
1000001
Figure: Encoding of data entered using keyboard
When the key A is pressed, it is internally mapped to decimal value 65, which is then converted into its equivalent binary value.
Why are Standard Encoding Schemes Required?
- Each letter, numeral and symbol can be assigned a unique code.
- The same standard can be used on different keyboards.
- Encoded information can be converted into binary for computer processing.
2.1.1 American Standard Code for Information Interchange (ASCII)
ASCII was developed to standardise character representation. It is one of the commonly used coding schemes.
- Initially ASCII used 7 bits.
- There are two binary digits: 0 and 1.
- 7-bit ASCII can represent 27 = 128 different characters.
- ASCII represents the character set of the English language.
ASCII Code for Some Printable Characters
| Character | Decimal Value | Character | Decimal Value | Character | Decimal Value |
|---|---|---|---|---|---|
| Space | 32 | @ | 64 | ` | 96 |
| ! | 33 | A | 65 | a | 97 |
| “ | 34 | B | 66 | b | 98 |
| # | 35 | C | 67 | c | 99 |
| $ | 36 | D | 68 | d | 100 |
| % | 37 | E | 69 | e | 101 |
| & | 38 | F | 70 | f | 102 |
| ‘ | 39 | G | 71 | g | 103 |
| ( | 40 | H | 72 | h | 104 |
| ) | 41 | I | 73 | i | 105 |
Example 2.2 โ Encoding the Word DATA
ASCII values and their equivalent 7-bit binary codes are:
| Character | ASCII Code | Binary Code |
|---|---|---|
| D | 68 | 1000100 |
| A | 65 | 1000001 |
| T | 84 | 1010100 |
| A | 65 | 1000001 |
2.1.2 Indian Script Code for Information Interchange (ISCII)
ISCII was developed in India during the mid-1980s to facilitate the use of Indian languages on computers.
- ISCII uses 8-bit code representation.
- 8 bits can represent 28 = 256 characters.
- It retains all 128 ASCII codes.
- The remaining codes are used for additional Indian language character sets.
- Additional codes are assigned in the upper region 160โ255 for the aksharas of the language.
2.1.3 UNICODE
Different encoding schemes for different languages could not always communicate with each other. Therefore, UNICODE was developed as a common standard.
- UNICODE provides a unique number for every character.
- It is independent of device, operating system and software application.
- Commonly used UNICODE encodings are UTF-8, UTF-16 and UTF-32.
- UNICODE is a superset of ASCII.
- Values 0โ128 have the same character as ASCII.
Unicode โ Devanagari Examples
| Character | Hexadecimal Value | Character | Hexadecimal Value |
|---|---|---|---|
| เค | 0905 | เค | 0906 |
| เค | 0907 | เค | 0908 |
| เค | 0909 | เค | 090A |
| เค | 0915 | เค | 0916 |
| เค | 0917 | เค | 0918 |
| เค | 091A | เค | 091C |
| เคค | 0924 | เคฆ | 0926 |
| เคจ | 0928 | เคฎ | 092E |
| เคฐ | 0930 | เคฒ | 0932 |
| เคต | 0935 | เคธ | 0938 |
| เคน | 0939 | เฅ | 0950 |
| เฅฆ | 0966 | เฅง | 0967 |
2.2 Number System
Every number system has a set of unique characters or literals. The count of these literals is called the radix or base of the number system.
Positional Number System
Number systems are also called positional number systems because the value of each symbol depends upon its position within the number.
- The rightmost position in the integer part has position 0.
- Position values increase from right to left.
- The first symbol in the fractional part has position โ1.
- Fractional position values decrease from left to right.
- Positional value is calculated using the position and base.
2.2.1 Decimal Number System
Decimal number system is used in our day-to-day life. It is called the base-10 system because it uses ten digits from 0 to 9.
| Digit | 1 | 2 | 3 | . | 4 | 5 |
|---|---|---|---|---|---|---|
| Position Number | 2 | 1 | 0 | -1 | -2 | |
| Positional Value | 10ยฒ | 10ยน | 10โฐ | 10โปยน | 10โปยฒ |
2.2.2 Binary Number System
The binary number system uses only two digits: 0 and 1.
It is called the base-2 system. The ON/high and OFF/low states of transistors are represented using 1 and 0 respectively.
Examples of Binary Numbers
- 1001011
- 1011.101
- 111111.01
Binary Values for Decimal Digits
| Decimal | Binary | Decimal | Binary |
|---|---|---|---|
| 0 | 0 | 5 | 101 |
| 1 | 1 | 6 | 110 |
| 2 | 10 | 7 | 111 |
| 3 | 11 | 8 | 1000 |
| 4 | 100 | 9 | 1001 |
2.2.3 Octal Number System
With an increase in decimal value, the number of bits in binary representation also increases. Octal number system provides a compact representation of binary numbers.
- Octal is a base-8 system.
- It uses digits 0 to 7.
- Positional values are expressed in powers of 8.
- Three binary digits are sufficient to represent any octal digit because 8 = 2ยณ.
| Octal Digit | Decimal Value | 3-bit Binary |
|---|---|---|
| 0 | 0 | 000 |
| 1 | 1 | 001 |
| 2 | 2 | 010 |
| 3 | 3 | 011 |
| 4 | 4 | 100 |
| 5 | 5 | 101 |
| 6 | 6 | 110 |
| 7 | 7 | 111 |
2.2.4 Hexadecimal Number System
Hexadecimal numbers are also used for compact representation of binary numbers.
- Hexadecimal is a base-16 system.
- It uses 16 symbols: 0โ9 and AโF.
- A represents decimal 10.
- B represents decimal 11.
- C represents decimal 12.
- D represents decimal 13.
- E represents decimal 14.
- F represents decimal 15.
- Four binary bits represent one hexadecimal symbol because 16 = 2โด.
| Hex Symbol | Decimal | 4-bit Binary |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
2.2.5 Applications of Hexadecimal Number System
1. Memory Address Representation
Main memory contains memory locations, and every location has a unique address. A 16-bit memory address can be difficult to handle in binary form, so hexadecimal notation provides a compact representation.
2. Webpage Colour Representation
Colours are made from three primary components: Red, Green and Blue (RGB).
Each component uses 8 bits, making 24 bits for a colour. Hexadecimal notation is used as a compact representation.
| Colour | Decimal | Binary | Hexadecimal |
|---|---|---|---|
| Black | (0,0,0) | (00000000,00000000,00000000) | (00,00,00) |
| White | (255,255,255) | (11111111,11111111,11111111) | (FF,FF,FF) |
| Yellow | (255,255,0) | (11111111,11111111,00000000) | (FF,FF,00) |
| Grey | (128,128,128) | (10000000,10000000,10000000) | (80,80,80) |
2.3 Conversion Between Number Systems
Decimal numbers are commonly used by humans, while digital systems understand binary numbers. Octal and hexadecimal systems help to simplify binary representation.
2.3.1 Conversion from Decimal to Other Number Systems
General Steps
- Divide the given number by the base value of the required number system.
- Note the remainder.
- Continue dividing the quotient by the base until the quotient becomes zero.
- Write the remainders in reverse order, from bottom to top.
Since the binary system has base 2, repeatedly divide the decimal number by 2.
Since the base value of octal is 8, repeatedly divide by 8.
Since hexadecimal has base 16, repeatedly divide the decimal number by 16.
2.3.2 Conversion from Other Number Systems to Decimal
General Steps
- Write the position number for each symbol.
- Calculate the positional value using the base.
- Multiply each digit by its positional value.
- Add all the values to obtain the decimal equivalent.
| Digit | 1 | 1 | 0 | 1 |
|---|---|---|---|---|
| Position Number | 3 | 2 | 1 | 0 |
| Positional Value | 2ยณ | 2ยฒ | 2ยน | 2โฐ |
| Digit | 2 | 5 | 7 |
|---|---|---|---|
| Position Number | 2 | 1 | 0 |
| Positional Value | 8ยฒ | 8ยน | 8โฐ |
2.3.3 Conversion from Binary to Octal/Hexadecimal and Vice-Versa
If the number of bits is not a multiple of 3, required zeroes are added at the most significant position.
Hexadecimal base is 16 and 16 = 2โด. Therefore four binary digits are sufficient to represent all 16 hexadecimal symbols.
Octal base is 8 and 8 = 2ยณ. Therefore three binary digits are sufficient to represent all 8 octal digits.
2.3.4 Conversion of a Number with Fractional Part
A. Decimal Number with Fractional Part to Another Number System
To convert the fractional part of a decimal number to another number system with base b, repeatedly multiply the fractional part by the base value.
- Continue until the fractional part becomes 0.
- Use the integer part obtained in each multiplication.
- Write the integer parts from top to bottom.
- If the fractional part does not become 0, calculation may be stopped after a suitable number of steps.
- If a fractional part starts repeating, stop further calculation.
B. Non-decimal Number with Fractional Part to Decimal
Compute the positional value of every digit using its base. Multiply each digit by its positional value and add the values.
| Digit | 1 | 0 | 0 | 1 | 0 | 1 | . | 1 | 0 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|
| Positional Value | 2โต | 2โด | 2ยณ | 2ยฒ | 2ยน | 2โฐ | 2โปยน | 2โปยฒ | 2โปยณ |
C. Fractional Binary Number to Octal or Hexadecimal
For the integer part, make groups from right to left. For the fractional part, make groups from left to right. Add zeroes at the end of the fractional part to make complete groups of 3 or 4 bits.
โก Quick Revision
| Topic | Important Point |
|---|---|
| ASCII | Initially 7-bit; 2โท = 128 characters |
| ISCII | 8-bit code representation for Indian languages |
| UNICODE | Common character encoding standard for written languages |
| Decimal | Base 10; digits 0โ9 |
| Binary | Base 2; digits 0 and 1 |
| Octal | Base 8; digits 0โ7 |
| Hexadecimal | Base 16; digits 0โ9 and AโF |
| Binary โ Octal | Group 3 bits |
| Binary โ Hexadecimal | Group 4 bits |
| Decimal โ Other | Repeated division and read remainders bottom to top |
| Other โ Decimal | Use positional values and add the products |
| Fractional Decimal โ Other | Repeated multiplication by the required base |
Important Base Values
| Number System | Base | Symbols |
|---|---|---|
| Binary | 2 | 0, 1 |
| Octal | 8 | 0โ7 |
| Decimal | 10 | 0โ9 |
| Hexadecimal | 16 | 0โ9, AโF |
Important Conversion Rules
- Decimal โ Binary: divide repeatedly by 2.
- Decimal โ Octal: divide repeatedly by 8.
- Decimal โ Hexadecimal: divide repeatedly by 16.
- Binary โ Octal: group 3 bits.
- Octal โ Binary: replace each octal digit by 3-bit binary.
- Binary โ Hexadecimal: group 4 bits.
- Hexadecimal โ Binary: replace each hexadecimal symbol by 4-bit binary.
- For fractional decimal conversion, multiply the fractional part by the base.
- For fractional binary to octal/hexadecimal, group the integer part from right to left and fractional part from left to right.
๐ Important Questions & Answers
Encoding is the mechanism of converting data into an equivalent coded form using a specific code.
It provides a standard way to represent characters using unique codes which can be converted into binary for computer processing.
ASCII stands for American Standard Code for Information Interchange.
2โท = 128 characters.
ISCII stands for Indian Script Code for Information Interchange.
2โธ = 256 characters.
UNICODE is a character encoding standard that provides a unique number for characters of written languages.
UTF-8, UTF-16 and UTF-32.
A number system is a method to represent or write numbers.
The count of unique characters or literals in a number system is called its radix or base.
2.
8.
10.
16.
Because 8 = 2ยณ, so three binary bits are sufficient to represent all eight octal digits.
Because 16 = 2โด, so four binary bits are sufficient to represent all sixteen hexadecimal symbols.
(65)10 = (1000001)2
(122)10 = (172)8
(122)10 = (7A)16
(1101)2 = (13)10
(257)8 = (175)10
(3A5)16 = (933)10
(10101100)2 = (254)8
(705)8 = (111000101)2
(0110101100)2 = (1AC)16
(23D)16 = (001000111101)2
(0.25)10 = (0.01)2
Hexadecimal numbers are used for compact representation of memory addresses and webpage colour codes.
๐ Important Conversion Practice Questions
- (514)8 = (?)10
- (220)8 = (?)2
- (76F)16 = (?)10
- (4D9)16 = (?)10
- (11001010)2 = (?)10
- (1010111)2 = (?)10
- (54)10 = (?)2
- (120)10 = (?)2
- (76)10 = (?)8
- (889)10 = (?)8
- (789)10 = (?)16
- (108)10 = (?)16
- Convert 145, 6760, 455 and 10.75 from octal to decimal.
- Convert 548, 4052, 58 and 100.25 from decimal to hexadecimal.
- Convert 4A2, 9E1A, 6BD and 6C.34 from hexadecimal to decimal.
- Convert 1110001000, 110110101, 1010100 and 1010.1001 into octal and hexadecimal.
- Write binary equivalents of 2306, 5610, 742 and 65.203.
- Write binary representations of 4026, BCA1, 98E and 132.45.
- How does a computer understand HOTS, Main and CaSe using 7-bit ASCII?
- Write the base value of a hexadecimal number system.
- Write the base value of a number system having B symbols.
- Write equivalent hexadecimal and binary values for the phrase โเคนเคฎ เคธเคฌ เคเคโ.
- What is the advantage of preparing digital content in Indian language using UNICODE?
- Write the steps required to type in an Indian language using UNICODE.
- Encode the word COMPUTER using ASCII and convert the encoded values into binary.
๐ฏ Final Exam Revision
Must Remember:
- ASCII โ 7 bits โ 128 characters.
- ISCII โ 8 bits โ 256 characters.
- UNICODE โ common character encoding standard.
- Binary โ Base 2 โ 0,1.
- Octal โ Base 8 โ 0โ7.
- Decimal โ Base 10 โ 0โ9.
- Hexadecimal โ Base 16 โ 0โ9,AโF.
- Binary โ Octal โ 3-bit groups.
- Binary โ Hexadecimal โ 4-bit groups.
- Decimal to another system โ repeated division.
- Fractional decimal to another system โ repeated multiplication.
- Other system to decimal โ positional values and addition.
๐ Conclusion
Chapter 2 explains how computers represent text and numbers. Encoding schemes such as ASCII, ISCII and UNICODE provide methods for representing characters. Number systems such as binary, octal, decimal and hexadecimal are used to represent numbers, while conversion techniques help move between these systems.
For examination preparation, special attention should be given to encoding, ASCII, ISCII, UNICODE, base values, positional values and all number-system conversion methods.