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: