You are on page 1of 5

What is a computer

It is a system which has the following important properties: a) It can accept inputs. b) It can deliver outputs. c) It can follow instructions to generate the outputs from the inputs. What are inputs? Anything that can be measured and defined unambiguously (A piece of text can be measured; by its number of words, numerical value of each word, position of each word in the text, etc etc). What are outputs? Anything that can be measured and defined unambiguously. Thats same as inputs! Yes, it is. We use computers to convert inputs to outputs. Think: The instructions which the computer follows to convert the inputs to the outputs are also inputs to the computers. Example 1: Computer = You Input 1: Look up your math book to find an integer. (This is an instruction). Input 2: An integer P. (this is the actual integer you looked up from the book). Input 3: Look up your math book to find an integer. (This is another instruction). Input 4: An integer Q. (this is the second integer you looked up from the book). Input 5: Add them (this is another instruction). Input 6: Write the sum into your exercise copy (yet another instruction) Output 1: Sum (This is the sum that you wrote in the exercise copy). Input 7: Take 5. (This is an input, with a fixed value). Input 8: Add that to the sum (Another instruction). Input 9: Write the result into the exercise copy (another instruction). Output 2: Sum + 5 (The result you wrote in the exercise copy). Example 2: Computer = You Input 1: Look up your math book to find an integer. (This is an instruction). Input 2: An integer P. (this is the actual integer you looked up from the book). Input 3: Look up your math book to find an integer. (This is another instruction). Input 4: An integer Q. (this is the second integer you looked up from the book). Input 5: Find GCD of P and Q (this is another instruction) Input 6: Write the GCD into your exercise copy (yet another instruction) Output 1: GCD (This is the GCD that you wrote in the exercise copy).

So you see that in a sense, input consists of both data and instructions. Same data and different instructions will generally result in different outputs; so will same instructions and different data. What does a computer need to have? 1. It must have a way to accept inputs (A blind person cannot look up an integer in the math book). 2. It must have a memory (If you forget the integers after looking them up, you cannot add them). 3. It must KNOW how to add, or find the GCD (else, it simply cannot carry out the instruction). Actually, it must also KNOW how to look up an integer in a math book. Try to make a 3 year old look up an integer in a math book. Believe it or not, computers KNOW nothing. Computer designers design electronic circuits, which can do certain things. It means those electronic circuits are bound to do those things according to the laws of physics, they cannot choose to do anything else. Think: If I throw a stone at a window pane with enough force, it will hit the pane and will break it. Now think: A stone thrown with enough force can break a window pane. Actually, the stone has no choice but to break the window pane. Similarly, electronic circuits can be designed which have no choice but to add the two numbers given to them. Now, let us draw a computer with the blocks that we discussed. It will look like something in Figure 1.

Figure 1: A computer with its parts

INPUT: This is the place where all the inputs exist. Think of the inputs in Example 1. Someone must have prepared those inputs and kept it somewhere (like written in a piece of paper) for you to see. The box INPUT in the figure is that piece of paper. Only, for a computer, the piece of paper must be a bunch of electronic circuits storing the information. It may be a keyboard with instructions being given with keystrokes, or may be a USB stick containing the instructions, or may be a hard disk, CDROM (long list). What is the big block called PROCESS with the smaller blocks MEMORY and CPU inside? Well, this is the guy in example 1, who was actually following all those instructions; thus it is you. Now we have already explained MEMORY; you need it to remember the numbers you looked up (maybe this is another piece of paper where you write down the two integers you looked up from your maths book). But what is this CPU? Well, this is a bunch of those electronic circuits, which can be forced to add two numbers etc. This is also the guy, which actually follows the instructions given to it. Thus, CPU is the one which adds the two numbers or computes their GCD, or even look up a place called Maths Book to get an integer. Finally, OUTPUT is the place where the result is shown. This is the exercise copy in the examples. It may be a printer or a monitor or a USB stick or a Hard Disk or anything (another long list) where the result can be written/dumped in some electronic form. Now let us think about this block called PROCESS for a while. Someone prepared an INPUT (a list of instructions and data) and stored it in the box called INPUT. If the PROCESS block has to process these inputs, it has to be able to connect with the INPUT block. (You cannot follow instructions unless the instruction booklet is given to you). So, we need to establish a connection between the INPUT and the PROCESS block. How do we establish connection? We use something called a BUS. Similarly we need a BUS to connect to the output. Let us add these two buses to the figure.

Figure 2: Better picture of a computer So, now we have a way for the PROCESS block to access the INPUTs and to write to the OUTPUTs. Now, for a moment, think about Example 1 again. It is repeated below:

Computer = You Input 1: Look up your math book to find an integer. (This is an instruction). Input 2: An integer P. (this is the actual integer you looked up from the book). Input 3: Look up your math book to find an integer. (This is another instruction). Input 4: An integer Q. (this is the second integer you looked up from the book). Input 5: Add them (this is another instruction). Input 6: Write the sum into your exercise copy (yet another instruction) Output 1: Sum (This is the sum that you wrote in the exercise copy). Input 7: Take 5. (This is an input, with a fixed value). Input 8: Add that to the sum (Another instruction). Input 9: Write the result into the exercise copy (another instruction). Output 2: Sum + 5 (The result you wrote in the exercise copy). Think of yourself as the PROCESS block, (your mind being the CPU, and a small piece of scratch paper as the memory). Suppose the instructions above are written on a piece of paper titled GENERAL APTITUDE TEST. As long as you do not have this piece of paper you cannot do anything. Suppose the GENERAL APTITUDE TEST is now given to you. So now you can see the instructions (i.e. the BUS 1 is established). What will you do? Obviously, you will start reading into your mind Input 1. If your mind is distracted by something else, you will not be able to read it into your mind. What does reading into your mind mean? It means converting the piece of text into known sequence of actions. Once you have read it into your mind you will know that you are being asked to: 1. Open your maths book. 2. Look up an integer. 3. Write that integer in the scratch paper (so that you remember it). Thus, understanding the instruction, and actually following it are two different things. The first step of reading into your mind or understanding involves bringing the instruction from the GENERAL APTITUDE TEST into your mind (you do this by merely seeing it, a computer is stupid, it needs electronic circuits at every stage). Now, remember, your mind is the CPU. So, the first step is to read in the instruction into the CPU. This is called a Fetch, i.e. to bring an input into the CPU to decipher its meaning (or decode it). Once a Fetch is done, the instructions is deciphered or decoded (with the help of electronic circuits again). Now it is time to do the job (i.e. open the maths book, look up the integer). This part is called the Execute. Thus, following instruction 1 involves Fetching it, Understanding it or Decodeing it, and finally, Executing it. Once these are done, we can move to Input 2. This is how all operations on a computer is done, by following a Fetch-Decode-Execute cycle. In short, it is written as the Fetch-Execution cycle, with the decoding being implicitly implied. Think about Input 7. This instruction contains some information or data (the number 5). Thus, data can also be fetched (but data cannot be executed).

Things to remember: A computer needs a block called INPUT. A computer needs a block called OUTPUT. A computer needs a block called PROCESS (MEMORY + CPU) The CPU fetches the instructions and data from INPUT, and executes the instructions after decoding them. This is called the Fetch-Execution cycle.

This is enough guys. Digest this information. Come up with questions (as many as you can).