A computer is a machine that manipulates data according to a set of instructions. This is a simple introductory course on how to program a computer. I think it is quite important for people to have a basic understanding of how computers work and how they can be programmed. Much of what is taught today is used of particular computer programs such as word processors etc... A computer is much more than a passive word processor however. It is a sophisticated tool that can be programmed to perform simple or even complex tasks to aid ones work. In order to understand what a computer can really do you need to have a basic understanding as to how it works. This course aims to give that basic understanding and leads onto writing and modifying a simple game written in the Java computer language.
Computers are fundamentally electronic devices. They use the flow of electricity in complex circuits in order to be able to input, compute, store and display information. A basic knowledge of electronics is useful to provide a basis for the understanding of computers.
Computers are primarily number processing machines. In order to understand them it is useful to know how they deal with numbers. Due to there electronic heritage and the simplicity of binary numbers their processing is based on the binary number system.
There are many type of computer in normal use today. These can be classified into a number of groups.
Computers perform calculations and other operations on numbers. A basic computer has the following components:
Memory: This is an area where a computer will store infomation temporarily (while switched on). Memory is addressed using a value termed an address. This is a value from "0" up to the maximum memory size eof the computer in use.
Processor: The performs "calculations" on the data from input and memory and puts results into the output and memory.
I/O: This is the input and output to the computer. In the Greenpower computer it is implemented as a set of pins on a the computer chip.
Computers perform a set of comands using the input data and memory and write results into the memory and/or output. The set of commands is called a program. The set of program commands can consist of oneof the following types:
Input: Inputs data from an outside source.
Output: Outputs data to an outside source.
Memory access: Reads or writes data to internal memory.
Calculation: Performs a mathmatical calculation on data.
Decision and jump: Checks the value of data and jumps to a different section of the program. Can also loop around a section of program.
We will now look inside a typical PC and see what the components are.
http://pcsupport.about.com/od/insidethepc/ss/howitfits.htm
In order to instruct a computer to perform some task we need to give it a list of instructions to be performed. At the basic electronic level this will be a list of number codes called computer opcode's. As these are difficult to understand there have been written a number of human like languages designed to program a computer. These languages have been designed to be precise, non-ambiguous languages unlike conventional human languages in order to clearly define the set of instructions to be performed and deal with the data types involved. The computer is able to translate the text of these languages into the numeric opcode's the computer needs in order to be able to run. There are three basic forms of languages:
This shows how to program a computer using the Java computer language in a simple teaching environment called Greenfoot.
This is just a basic introduction. There are many sources for information on computer programming and many areas of knowledge involved.