Coding Systems
According to the above figure (Figure 3.15), when you enter a data to the
computer, it converts the data to different patterns made of 0 and 1. Thus, binary
codes are used when storing numeric, alphabetic, special character, images and
sounds in internal storage devices of computers
In the beginning of the lesson, when you type ‘A’ on the keyboard, the
code you get for ‘A’ is the bits pattern 1000001 (the binary code of letter ‘A’).
The number of bits used is 7. Thus, a combination made of a bit pattern is used
to represent each data and the bits used for each code is different. Following are
different coding systems used.
• BCD - Binary Coded Decimal
• ASCII - American Standards Code for Information Interchange
• EBCDIC - Extended Binary Coded Decimal Interchange Code
• Unicode
•
BCD - Binary Coded Decimal
This coding system was used in the early stages of computing. In this system
one digit is represented by 4 bits. This is used only to represent decimal numbers.
Sixteen symbols (24 = 16) can be represented in this system. The table 3.15 shows
the BCD codes for the 10 digits from 0 to 9.
2n n – number of bits
Example
Indicating number 3710 in BCD codes.
3 710
0011 0111
3710 = 00110111
ASCII – American Standard Code for Information
Interchange
Initially ASCII coding system used 7-bit binary digit. 128 characters can be
represented using this coding system. ASCII is used to represent text.
ASCII system is designed and approved by ANSI (American National
Standard Institute).
• One code consist of 7 bits
• A number of characteristics 27 = 128
Example 1
• Text
When the word ‘School’ is entered into the computer through the keyboard,
write down how it is understood by the computer. (Use Appendix Table 3.7)
First, write the decimal numbers for the symbols.
S - 83 c - 99 h - 104 o - 111 l – 108
Write binary numbers for each value.
S – 1010011 c – 1100011 h – 1101000 o – 1101111 l – 1101100
Write the associated code
School
101001111000111101000110111111011111101100
Example 2
If the value of ASCII A is 65 then what is the value of ASCII C?
step1 → write the ASCII value in 7 bits
26 25 24 23 22 21 20
64 32 16 8 4 2 1
1 0 0 0 0 0 1
65 = 1 0 0 0 0 0 1
A = 65
B = 66
C = 67
step1 → write the ASCII value in 7 bits
26 25 24 23 22 21 20
64 32 16 8 4 2 1
1 0 0 0 0 1 1
67 = 1 0 0 0 0 1 1
Example 3
If the value of ASCII B is 60 then what is the value of ASCII BAD?
A – 59 B – 60 C – 61 D-62
B A D
60 59 62
2 6 25 24 23 22 21 20 26 25 24 23 22 21 20 26 25 24 23 22 21 20
64 32 16 8 4 2 1 64 32 16 8 4 2 1 64 32 16 8 4 2 1
0 1 11100 0111011 0111110
EBCDIC – Extended Binary Coded Decimal Interchange
Code
We can write only 128 characters using ASCII system, but the EBCDIC
code system allows the use of 256 characters. Here, one symbol can be written with
a binary number which consists of 8 bits. Hence, 256 characters can be represented
using this system. This system was used in IBM main frame computers. The table
below shows that there are different EBCDIC codes for the 26 different capital
letters and 26 different EBCDIC codes for the 26 simple letters in this system
• One code consist of 8 bits
• A number of characteristics 28 = 256
➢ Calculators
➢ Mainframe computers
Unicode System
Though 128 characters can be used in the ASCII system and 256
characters can be used in the EBCDIC system for data representation. For
example, these systems cannot be used for Sinhala, Japanese, Chinese and Tamil
languages as there are more than 256 characters. Hence Unicode system was
designed according to a standard to represent 65536 different symbols of 16 bits
(216 = 65536).
As per the figure given below (Figure 3.16), shows the Unicode system
can be used to represent Sinhala and Tamil letters, and special symbols and picture
symbols.
Figure 3.16 – Occasions Unicode are used
Unicode system uses unique number for each number, text or symbol in any
or Operating System.