Computer Structure

Computation
Hardware and software
Components of a computer system
Instruction execution cycle

Computation

A computer system performs computation.  What is computation?  Computation can be defined as "symbols transformation".  It is a process that transform input symbols to output symbols.  "Symbol" is an abstraction.  A symbol can represent something in the real world, or it can represent some mathematical object.  The real world is connected to a computation by sensors and actuators.  A sensor transforms real world events, such as temperature, into symbols that are fed into computation.  An actuator transforms symbols from a computation to affect the real world.  An actuator such as a motor has effect in the real world.  The relationship between compuation and the real world can be shown as the figure below:
 
                    computation
   input symbols -->  process --> output symbols
        ^                              |
        |                              v
      sensors                       actuators
        |                              |
                    real world
Software is a specification of a computation.  From this point of view, a software does not describe sensors, actuators nor the events in the real world.  Hence, it is necessarily incomplete, i.e. it cannot describe the computation plus the real world connected to that computation completely.
 

Hardware and Software

The most important property of computer systems is it "programmability".  This property differentiates a computer from all other artifacts.  Software is the result from this property.  Software as a specification of computation enables a computer to be multi-function, and even adaptive.

An application software runs on a computer system.  At the bottom level of a computer there are electronic circuits which are called "hardware".  The interface between a program and a hardware is the instruction set.  An instruction set defines an abstraction of hardware.  This abstraction allows a programmer to "program" the hardware to perform multiple functions.
 

Components of a computer

There are many possibilities in realizing a programmable system.  The most influencial concept is the "stored program" concept invented by John Von Neumann.  In this model, a computer is composed of two parts: processor and memory.  Memory stores both data and program.  Furthermore, memory can be accessed directly at any location.  This is called "random access model".  Other possible realization of a programmable system includes data flow architecture, systolic architecture etc.  We will restrict our study to the stored program concept.

A processor is connected to memory through two ports: address and data.  The "access" to memory by a processor is done by a processor sending an address to memory and a value can be read or write through data port. The largest size of value (measures in the number of bits) that can be accessed is the width of the data.  This size defines the bit-size of a processor, such as 8-bit, 16-bit, 32-bit, 64-bit processor.

A processor contains an arithmetic-logic unit (ALU), registers, a program counter (PC), an instruction register (IR) and a countrol unit.  An ALU performs arithmetic and logic functions: add, substract, multiply, divide, and, or, not and others.  Registers are the "fast" memory used by a processor to store the intermediate result.  A program counter keeps track where the current instruction is.  It is changed by instructions that alter the flow of control of a program (if..then..else, loop, and function call in a high level language). An instruction register stores the current instruction fetched from memory.  Its content (the instruction) signals the control unit to initiate the execution of that instruction.  The control unit sends control signals to all parts in the processor to co-ordinate their activities.  The control unit is a large finite state machine.  It is the most complex part of a processor.
 

Processor                    Memory
---------                    ---------
registers  ALU
                              data
control unit        data
                  <=======>
instruction reg.             program
                   address
program counter   -------->


            Fig.  components of a computer
 

Instruction execution cycle

Instructions reside in memory.  This is why this architecture is called "stored program".  It can be accessed from a processor similar to any piece of data in memory.  A sequence of instructions is a program.  A processor starts running a program by reading instructions from memory and executing them one instruction at a time.

The cycle starts by a processor sending the address of the current instruction to memory via the address bus.  The current instruction is read from the memory via the data bus and is sent to the instruction register (IR).  IR causes the control unit to co-ordinate activities in the processor to execute that instruction.  The processor then starts to read the next instruction (the program counter is increment to point to the next instruction) and executing it and so on.

The result of executing of an instruction can effect many parts: registers, data in the memory, or the program counter.  When an instruction changes the program counter, it causes the program to change the flow,  either the program entering the loop or selecting the next statement depending on the if condition in if..then..else statement.

last update 9 March 2020