Computation
Hardware and software
Components of a computer system
Instruction execution cycle
computationSoftware 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.
input symbols --> process --> output symbols
^ |
| v
sensors actuators
| |
real world
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.
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
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