We have thus far considered only numbers. What if we wanted to represent words from English language? English has an alphabet, from A (or a) to Z (or z). In addition we use comma, exclamation mark, question mark etc to form sentences. How should we represent these? ASCII describes the format of character (char) data types considering English alphabet as primary source of language. ‘Unicode’ format could be used to describe an alphabet much greater than described by ASCII, and hence can be used with other languages like Arabic, Chinese, etc.
ASCII allocates one byte to a value, and each value represents a character. This character can be ‘, 1, 2, a, A, b, B, !, ~, *, -, _ etc. Since, one byte (8 bits) are used for representation, the maximum number of values we can have are 11111111, i.e. 255. But, ASCII uses only seven of these bits []. So, we actually end up having 1111111, ie 127 characters in the ASCII set. I know! That is why Unicode is in demand.
Whenever a processor checks a string of bits it divides it into operation code and data. Considering the type of data it knows what operation the user wants it to perform.
2. PROGRAM
A series (set) of instructions to the processor is called as a computer program. A program typically consists of space (reserved locations in memory) that is used to store intermediate data for operations, instructions for the processor, and a logic that defines what the program does. The logic is nothing but the usage of operation codes and data in different permutations. Why do we need to store intermediate data? Because we have always needed some store to perform operations. If I ask you to add 2 to 3, you will either use a paper to write 2, 3, +, and perform calculation, or, would use your brain as a store to perform this calculation on-the-fly. But you will need a store. Storing all these instructions and allocating space for intermediate data is called writing a program.
Subscribe to:
Post Comments (Atom)
0 Response to "What is Program ?"
Post a Comment