Programming

What is ASCII (American Standard Code for Information Interchange)?

Imagine that you open a Word document and type something on the keyboard. Now you can see the letters you typed on the keyboard on the screen. How did that happen? Does the PC understand what we type? Today we will talk about it.

Even if we type each letter from the keyboard, the PC can’t really understand these words on the laptop. Actually PC can understand only binary values like 1 and 0.

Now you may be thinking what are these binary values. Ok, imagine that your PC is charging the laptop. Then how does your PC and laptop understand that the current is coming? The PC can understand that the current is coming to the lap from the signals. That means 1 if the current is coming, 0 if the current is not coming.

Here, the signals coming from 1 and 0 are called binary values. So even if we type something on the keyboard, our laptop and PC will understand these as binary signals like this. Because of that, the standard coding methods became famous among people so that the PC can understand what people type in this way. Now let’s see what they are.

1. BCD – Binary Coded Decimal

2. ASCII – American Standards Code for Information Interchange

3. EBCDIC – Extended Binary Coded Decimal Interchange Code

4. Unicode

BCD – Binary Coded Decimal

BCD or Binary Coded Decimal is a code system used in the early days of computer use. By using the BCD code system, we can represent the numbers from 0 to 9 with 4 bits in this way. (24 = 16)

ASCII – American Standards Code for Information Interchange

This is the main topic we are talking about today. Earlier we talked about BCD or Binary Coded Decimal. We talked about that it can represent numbers from 0 to 9. So then how to represent text? ASCII was created as a solution.

The ASCII code system was created by ANSI (American National Standard Institute) in 1963. And because ASCII has 7 bits, it can represent 128 characters. (27 = 128) That’s why we have got a chance to represent capital letters from A – Z, simple letters, numbers from 0 – 9 and punctuation marks by using the ASCII method.

Now let’s see how binary, decimal, octal, hexadecimal digits are represented in ASCII characters.

Hexadecimal

PC understands binary values. But people cannot understand them. As a solution to that, the hexadecimal number system is used in the world. Hexadecimal means 16 base. It means that in hexadecimal numbers are represented until 0-9 and A-F values are represented until 10-15.

Decimal Number0123456789101112131415
Hexadecimal Number0123456789ABCDEF
Number SystemHexadecimal Number System
Base16
Digital Use0,1,2,3,4,5,6,7,8,9, A, B, C, D, E, F

(As an example, the hexadecimal value of m is 0×6D)

Octal

Octal Number Systems are used to represent the numbers 0, 1, 2, 3, 4, 5, 6, and 7.

Number SystemDecimal Number System
Base10
Digital Use0,1,2,3,4,5,6,7,8,9

(As an example, the decimal value of m is 109)

Binary

When you say Binary, you know that it means numbers in the base of two. That means 1 and 0. In some cases 7 bits are used and in some cases 8 bits are used.

Example – When the value m is represented by 8 bits in a binary value, we get a value like this 0110 1101.

When we represent the same with 7 bits, we get the value 110 1101. Now you are looking to see if there are two binary values for the letter m when you take two values bit 7 and bit 8. There is no big difference. Because whether the letter m is taken from 7 bits or taken from 8 bits, both values are the same. Because it needs to be represented in 8-bit, an extra 0 has been added to the beginning of it. According to ASCII, the letter m is represented by binary, decimal, octal, hexadecimal digits as follows.

CharacterHexadecimalOctalDecimalBinary (7bit)Binary (8 bit)
m0×6D155109110 11010110 1101

Why is ASCII so import?

Now you understand that ASCII is a very famous method for character encoding. It is because of ASCII encoding method that we have been able to type text on Lap PC.

As a result of that, in 1969 IEFT (The Internet Engineering Task Force) published the ASCII method as RFC 20. Not only that, in 2015 the RFC document has also accepted ASCII as a standard method.

The ASCII method is mainly divided into 4 parts, namely UTF-7, UTF-8, UTF-16, UTF 32 (UTF – Unicode transformation format). At present, languages like Sinhala, Hindi and Tamil are being typed in addition to English typing. The base for these extra languages is because of the ASCII method.

When a PC laptop is developed in the world, it is developed using the ASCII method. It means that you can type in English. Apart from that, because many people now type in other languages, the ASCII method has been developed and the coding system called Unicode has been introduced to the world.

How does ASCII work?

You must now understand that ASCII is a very important coding method. Because we have got the ability to easily type text because of ASCII. Let’s see how to use the ASCII method with an example.

The binary value of Capital A is 0100 0001
The binary value of simple a is 0110 0001

When you look at the difference between capital A and simple a, you can see the difference in the third MSB (Most significant bit).

What then is this MSB? MSB or Most Significant Bit is the non-zero value at the left end when reading a number from left to right. And the value at the left end is called LSB or we call it Least Significant bit.

CharacterBinaryDecimalHexadecimal
A0100 0001650x41
B0110 0001970x61

According to this example, in ASCII, the difference between upper and lover case is 32. That means 97 – 65 = 32. (0 ×20). Now you may understand that by using ASCII method and looking for the values of capital simple characters, you can find the values by adding or subtracting 32 to the decimal value.

CharacterBinaryDecimalHexadecimal
00011 0000480x30
10011 0001490x31
20011 0010500x32
30011 0011510x33
40011 0100520x34
50011 0101530x35
60011 0110540x36
70011 0111550x37
80011 1000560x38
90011 1001570x39

According to this table, the first 4 bits of the ASCII values, that is, the bits called 0011, can be easily converted to the decimal value. Similarly, if you add the binary value 0011 0000 to the first binary value, that is 0000 0000 to 48, you can easily get the value 0011 0000.

Not only that. Developers say that if the value of the MSB of a binary value is 0, it is encoded as an ASCII value, and if the value of the MSB is 1, it is not encoded in ASCII.

Advantages and Disadvantages of ASCII

Now let’s see what are the advantages and disadvantages of ASCII.

Advantages

ASCII is a universally accepted language encoding method. That means Unicode is currently used in the world as a developed method of ASCII when creating PCs and Laptops. Because of that we have got the ability to type any language. Efficient of programming – that means you can get work done easily while working on the PC lap. Because we have got the ability to type letters, numbers, etc. because of ASCII.

Compact character encoding – Compact character encoding is another advantage of ASCII. That means that a standard of 7 bits should be kept. If we use the ASCII method and type from anywhere in the world, the user will find the message in the most appropriate format because of the compact character encoding in ASCII.

Disadvantages

Earlier we talked about the advantages of ASCII, now let’s see what are the disadvantages. There is nothing much to say about the disadvantages of ASCII. But when using languages other than English language like Lathan and Greek, small problems arise while typing some letters.

Leave a Reply

Your email address will not be published. Required fields are marked *