Computer Basics
Before looking too deeply into computer architecture, we must first look
at the basics.
Computers are machines that execute instructions, values in a computer's
memory that tell the computer what operation to perform. First we will
look at how these instructions are given to the computer.
Programming
Languages
Programming languages are a way by which people can tell computers what
to do using a language somewhat easy for people to understand.
Examples of programming languages are C and Pascal. An example
of some of this language, which is referred to as code when written
as a program for the computer to execute, is this:
for(int x = 0; x < 10; x++){
int a = x * 10;
cout << "A: " << a << endl;
}
This above code is written in the C programming language.
Now we'll take a look at what this code does. The first line, for(int x =
0; x < 10; x++), creates a loop that will execute all code between the
two curly brackets that immediately follow the parentheses while the
conditions in the parentheses are satisfied. Thus, x will
initially be set to 0. The loop will executed, after which the code x++
will set x to equal 1. The loop will repeat while x<10, so that when x =
9, the code int the loop will be executed for the last time.
The actual code int the loop will do this each time: set a to equal 10
times whatever x is at the time, and then output the on the screen (or
cout) the words in quotation marks and the value of a before starting a
new line (endl).
The output would be as follows:
A: 0
A: 10
A: 20
A: 30
A: 40
A: 50
A: 60
A: 70
A: 80
A: 90
However, the above example is only a small tidbit of one
language. There are myriad languages, each being extremely complex.
Assembly Language
Assembly language is another programming language, but is of a different
type than others such as C and Pascal. Each computer has one assembly
language. Assembly does less with each instruction than regular
languages, breaking instructions down for easier execution. Assembly is less
easily understood by people because it is
written more for the computer to understand and execute that people to
write. The computer takes languages such as C and Pascal and changes them
into assembly for its benefit.
Binary
The computer takes assembly language and executes it through
understanding it as binary code.
Binary is the 2's number system which computers understand. One binary
number is a bit, 8 are a byte, which looks like this: 0100 0111.
Read from right to left, each binary number represents 2 to a power. The
first is 2^0, the second is 2^1. Thus the above binary number equals 2^0
+ 2^1 + 2^2 + 2^6, because those are the positions that have 1's.
Having looked at how computers are told what to do, and how they
understand these commands, we shall now look into the computer and see
what is actually doing the understanding.
Central Processing Unit
Computers are basically split into three parts: a central processing
unit (CPU), the main memory system, and the input/output system (I/O)
As implied by the name, the CPU actually does the computing, and is made
up of the following parts:
- control unit(CU), which controls the operation of the computer.
- arithmetic and logic unit (ALU) which performs arithmetic, logical,
and shift operations to produce results.
- register set, which holds various values during the computer's operation.
- program counter(PC), which holds the main-memory address of an
instruction. The PC is part of the register set.
Main Memory
The main memory is relatively simple: it stores values in different
places, called memory addresses, which are called by
the CPU when required.
Input/Output
I/O is how we communicate with computers. Values are input through
keyboard or mouse, and executed instructions then may output to the
screen.
A Fast Ride
That was indeed a fast ride we just took through the computer. Of course,
computers are much more complex than the above description, but what
was given was only that necessary for comprehension of the important
architectural facets of HPC.
Computer parts list taken from Baron
Previous
Next
Home