next up previous
Next: The Idea of Language Up: Introduction Previous: Introduction

Computers and Programs

To have an idea of what we mean by the phrase `program a computer', we have to know what we mean by 'program' and what we mean by 'computer.' We'll start with 'What's a computer?', but these ideas are very closely related.

What's the difference between a computer and a washing machine? Let's say our washing machine is pretty simple: you can wash on delicate, permanent press, and normal, and you can do so in cold, warm, or hot water. Each time we run the machine, we select one of these 3X3 = 9 possibilities, press start, and the machine follows a certain predetermined set of instructions and then stops. Usually such a 'program' goes like this:

  1. Fill with water
  2. Wash
  3. Drain
  4. Spin dry
  5. Stop

Is this like a 'program' for a computer? It's similar in the sense that the washing machine follows a predetermined number of steps, as does a computer program. It's different because the washing machine only has 9 possible programs it can run, and they're all a physical part of the machine. In the case of the computer, we can make up any set of instructions we like, give it to the computer, and it will follow them. This means that there are an infinite number of programs that a computer will follow, and because they're not a physical part of the machine (we say 'not hard-wired'), we can change the program of the computer at any time. These programs are stored in the memory of the computer, and the computer can read the program from memory, execute it, and write things to memory as well. This ability to read and write to memory is very important for making the computer a powerful machine.

Notice that I haven't talked about the mechanical parts of the washing machine at all - the tub with the motor,the pipes and the water, and so on. The truth is that we could connect these things to our computer and it could be a washing machine as well. In fact, it would be the world's most complex washing machine since we could tell it to wash in an infinite number of different ways corresponding to the different programs we might give it. Our original washing machine can only wash in 9 ways, which makes it a very weak cousin of our computerized washing machine.

So a computer is a machine that follows the instructions that we give it, and the instructions that we give it are called the 'program'.


next up previous
Next: The Idea of Language Up: Introduction Previous: Introduction
Chris Trendall
Copyright ©Chris Trendall, 2001. All rights reserved.

2001-12-09