Hardware Overview


The Central Processing Unit (CPU)

The CPU is the ``brains'' of the computer system:

Main Memory

This is the temporary, or working storage, for the computer. It holds the data and programs the computer is currently working on.

Secondary Storage

This is the permanent, or long-term, storage for information.

In secondary storage data is stored in files (e.g. information in a database, folders with your electronic mail, word processing documents you want to keep electronic copies of, etc.)

I/O Devices and the Bus

Input/output devices are all the tools that connect the computer to the user and the rest of the world. The communications bus is a device (maybe just a set of wires) that connects different computer components together.

The bus is used to transfer data between the CPU, I/O devices, secondary storage devices, and memory.

Networks


Source Code, compiling, and execution

Running a program

Fetch-Decode-Execute cycle

This cycle of events is being constantly repeated while the computer is turned on.

Computer software and languages


Computerised problem solving

There are two key skills for developing software solutions to problems:
  1. Developing a plan or algorithm for solving the problem
  2. Expressing the problem in a particular programming language

Software types

Software is often classified into two broad groups: In career terms, programmers often specialise in one or the other, but the development and problem solving skills for both are similar.

Language types

There are many different programming languages, divided into categories such as: `Lower level' languages closely reflect a machine's hardware characteristics, `Higher level' languages come closer to natural language solutions

High level languages

High level language examples

Every language has its own rules
but there are distinct similarities Below we show how different languages might
print out the numbers from 5 to 10
Fortran
DO  99, X=5,10,1
    PRINT X
99 CONTINUE
Pascal
for x := 5 to 10 do
begin
  write(x);
end;
C
for (x=5; x<=10; x=x+1)
{
    printf("%d", x);
}
C++
for (x=5; x<=10; x=x+1)
{
    printf("%d", x);
}

And for two low-level languages:
MC68000 assembly language
      MOVE.L  #4,D2
LOOP: MOVE.L  D2,D0
      ADDI.W  #6,D0
      JSR     DECOUT
      DBRA    D2,LOOP
MC68000 executable
00100000101111000000000000000100
0010000000000010
00000110010000000000000000000110
0100111010000000
01010001110010101111111111110100

The C++ programming language

We will program using the C++ (high level) language