Introduction to C Programming by Rob Miles, Electronic Engineering
A device which processes information according to instructions it has been given.
This general definition rules out fridges but is not exhaustive. However for our purposes it will do. The instructions you give to the computer are often called a program. The business of using a computer is often called programming. This is not what most people do with computers. Most users do not write programs, instead they talk to programs written by other people. We must therefore make a distinction between users and programmers. A user has a job which he or she finds easier to do on a computer running the appropriate program. A programmer has a masochistic desire to tinker with the innards of the machine. One of the golden rules is that you never write your own program if there is already one available, i.e. a keen desire to process words with a computer should not result in you writing a word processor!
However, because you will often want to do things with computers which have not been done before, and further because there are people willing to pay you to do it, we are going to learn how to program as well as use a computer.
Before we can look at the fun packed business of programming though it is worth looking at some computer terminology:
If you ever buy a computer you are not just getting a box which humms. The box, to be useful, must also have sufficient built in intelligence to understand simple commands to do things. At this point we must draw a distinction between the software of a computer system and the hardware.
Hardware is the physical side of the system. Essentially if you can kick it, and it stops working when immersed in a bucket of water, it is hardware. Hardware is the impressive pile of lights and switches in the corner....
Software is what makes the machine tick. If a computer has a soul it keeps it in its software. Software uses the physical ability of the hardware, which can run programs, do something useful. It is called software because it has no physical existence and it is comparatively easy to change. Software is the voice which says "Computer Running" in a Star Trek film.
People use the words data and information interchangeably. They seem to think that one means the other. I regard data and information as two different things:
Data is the collection of ons and offs which computers store and manipulate.
Information is the interpretation of the data by people to mean something. Strictly speaking computers process data, humans work on information. An example, the computer holds the bit pattern: 1111111 11111111 11111111 00000000
However you could regard this as meaning: "you are 256 pounds overdrawn at the bank"
or "you are 256 feet below the surface of the ground"
or "eight of the thirty two light switches are off"
The transition from data to information is usually made when the human reads the output. So why am I being so pedantic? Because it is vital to remember that a computer does not "know" what the data it is processing actually means. As far as it is concerned data is just patterns of bits, it is you who gives meaning to these patterns. Remember this when you get a bank statement which says that you have [[sterling]]8,388,608!
Computers are data processors. Information is fed into them, they do something with it, and then generate further information. A computer program tells the computer what to do with the information coming in. A computer works on data in the same way that a sausage machine works on meat, something is put in one end, some processing is performed, and something comes out of the other end:
A computer program is just a sequence of instructions which tell a computer what to do with the data coming in, and what form the data sent out will have.
Note that the data processing side of computers, which you might think is entirely reading and writing numbers, is much more than that, examples of typical data processing applications are:
Digital Watch : A micro-computer in your watch is taking pulses from a crystal and requests from buttons, processing this data and producing a display which tells you the time.
Car : A micro-computer in the engine is taking information from sensors telling it the current engine speed, road speed, oxygen content of the air, setting of the accelerator etc and producing voltages out which control the setting of the carburettor, timing of the spark etc, to optimise the performance of the engine.
CD Player : A computer is taking a signal from the disk and converting it into the sound that you want to hear. At the same time it is keeping the laser head precisely positioned and also monitoring all the buttons in case you want to select another part of the disk.
Note that some of these data processing applications are merely applying technology to existing devices to improve the way they work. However one, the CD player, could not be made to work without the built-in data processing ability.
Most reasonably complex devices contain data processing components to optimise their performance and some exist only because we can build in intelligence. It is into this world that we, as software writers are moving. It is important to think of business of data processing as much more than working out the company payroll, reading in numbers and printing out results. These are the traditional uses of computers.