# Understanding ASCII

Home / Understanding ASCII

### Understanding ASCII

October 19, 2015 | Article | 4 Comments

What is ASCII?

ASCII is American Standard Code for Information Exchange. What does it mean? And why we use it?

Well, computer only knows number that we call binary number. Therefore, to instruct machine we have to use proper machine language which is binary coded form. Can you instruct machine, write sequence of 0 and 1 bits that make computer do something? It can but would be hard. Since computer only know 0 and 1, they also can’t understand our character. To make computer understand, our character will be mapped / encode to binary. That’s ASCII work for. It represent our character, from ‘A’ to ‘Z’, ‘0’ to ‘9’ and many more characters. This is standard that used in computer. As we say standard, the symbols on ASCII are well-known symbol or mutually agreed by many vendor.This guarantee that computer of different vendor / platform can still communicate and we also can use machine in more human-way.

Character in ASCII code are around 256 symbols numbered from 0 to 255 (in early era there are only 128 characters. The other 128 characters are extended to old standard). Why 0? Because our number system use 0 as lowest value for each digit. If you want to know further about number system, you can read my other article Number System or Decimal Number.

Now, I present to you list of ASCII code in simple table. Click the image to view full version of image.

ASCII Table 0~127

ASCII Table 127-255 (EXTENDED)

Now, what can we do with ASCII? Is it used? There are lot of things ASCII did. If ASCII was not present, we can’t read human character like we did now. So, must we read this article or blog with sequence of 0’s or 1’s? Must we remember and use machine language? If that’s the situation, you can imagine how many 0 and 1 you will see if there is a sentence “Satria is handsome and so cool”. (FYI: one character consist of eight number that can be 0 or 1).

Wow @@

## ASCII inside program

Like I said before, computer only knows binary number. In the program, we use characters of ASCII to print or read something. ASCII characters are symbolized by character data type in programming language (character in Pascal or char in C).

This snippet is written in C++ language and will print character of ASCII from 0 to 127 (means: 128 character would appear). Don’t be surprised if some characters are not printable.

```#include <iostream>
using namespace std;

int main() {
int i;

for(i=0; i< 128; i++) {
cout<<(char) i<<endl;
}

return 0;
}```

## ASCII is not only a character

ASCII is the way of life! No, that’s only joking. But when I say ASCII is not only a character I mean, yes that’s true.

ASCII are not only characters we often meet everyday like a,b,c,d,.., z or 0,1,…,9 or symbols like [email protected]#\$%^&*(). If you compile and execute snippet above and look carefully, you will see weird symbol in some lines. Yes, that’s also part of ASCII.

ASCII characters are also known by computer. Let’s take example of 8’th character in ASCII which is a backspace. This is a symbol used to represents backspace key on keyboard. Not only that, there is also character used for transmission like 2nd symbol which is STX or Start of Text. This character is used by program as beginning of text.

Now, we can conclude that ASCII is a universal code used for general purpose.

#### xathrya

A man who is obsessed to low level technology.

1. ##### silikon

First of all I would like to say great blog! I had a quick question that I’d like to ask if you do not mind. I was interested to know how you center yourself and clear your head before writing. I’ve had trouble clearing my thoughts in getting my thoughts out there. I do enjoy writing however it just seems like the first 10 to 15 minutes are usually lost simply just trying to figure out how to begin. Any ideas or hints? Thanks!|
silikon

• ##### xathrya

Hi, thank you for coming.

honestly, I do have the same problem. I usually note any idea sprout in my mind whenever they come so when I just need to complete the pieces when I am ready to write. As for “how to begin writing”, I usually use template so I only need to write the content.

I also create condition to comfort myself before getting ready. Stuff my stomach, make sure I’m not hungry but also not full. I often getting distracted by sound so I write at late night when it is peaceful enough.

That case works for this site, I don’t know if it can be applied to other things as well.