ASCII : Alphabets in Computers
The storage of numbers is relatively easy to understand as, computers are very simple at the basic level. Computers use Base - 2, meaning they count in powers of two. This also means that computers have only Humans on the other hand count in Base - 10, meaning we two digits, namely 0 & 1. Humans count in the powers of 10, so we have 10 digits (0-9). For example,
32 = 3 x 10^1 +2 x 10^0 ("^" means raised to the power of)
For computers,
32 = 1 x 2^5 + 0 x 2^ 4 + 0 x 2^3 + 0 x 2^2 + 0 x 2^1 + 0 x 2^0
Each 2^x represents a "bit". Think of each bit as a slot. In this slot a zero or one can be placed. The bits are also represented as powers of two in their order. For example : the fourth bit is 0 or 1 into 2^4. Nowadays, computers have either 32 bits or 64 bits meaning the maximum value that can be stored is 2,147,483,647. Note : we can DISPLAY numbers greater than this. But on a 32 bit computer, this is the maximum value you can STORE.
So, if every possible configuration of the bits (slots) is used up to represent unique numbers, where is the place for letters? Computers need to be able to process letters for being useful to us, otherwise, the are just expensive calculators.
Here is where ASCII comes in. ASCII stands for American Standard Code for Information Interchange. ASCII helps us to store and display letters on our screens.
In the ASCII encoding (fancy term for saying configuration of letters), a letter is given a unique numerical value. When the computer receives this value, it processes it as a letter. The value of "a" is given a value of 97. Note : "a" is different from "A" as they are considered as different characters.
You must be wondering, if every possible binary value is represented as a number, and each letter is represented by a number, how does a computer know weather we mean "a" or just 97?
Actually, your computer doesn't .
Actually, your computer doesn't .
In reality, your computer is just hardware. What makes it really run is your operating system or software. The Operating System is the main piece of software. Windows, OSX and Linux are all operating systems. Now if you open your web-browser like Chrome or IE (Why do you still use this?) you are running another piece of software on top of your operating system.
Think of it as a cake : Your hardware is the base, your operating system is like frosting and applications are like the cherry on top.
So, when you press the KEY on your keyboard, your operating system identifies it either as a number or a letter, while your HARDWARE processes it as a number/alphabet. In this way computers can identify numbers and letters uniquely and helps you type.
When you open notepad, you can be sure that whatever you want to write actually happens.
-Raghav M
Pretty good!!
ReplyDelete