Uses a single processor.
Uses one memory for both instructions and data. A von Neumann computer
cannot distinguish between data and instructions in a memory location! It knows
only because of the location of a particular bit pattern in RAM.
Executes programs by doing one instruction after the next in a serial manner using
a fetch-decode-execute cycle.
In this chapter, we are going to build upon and refine the ideas introduced in an earlier chapter.
You should re-read the relevant chapter on CPUs before you start this one. We have already said
that the CPU was made up of 4 important components:
The ALU.
The registers.
The control unit.
The IAS (otherwise known as RAM or memory).
Because the IAS is so important, we are definitely going to move it to its own section in our
model of a computer. (We discussed this previously). We need to get data into and out of the
computer so we will include this as a separate section as well. We will also introduce the idea of
a clock and clock cycles in the CPU. Our new model of a computer now looks like this:
Von Neumann Component 1 - The CPU
The CPU, or Central Processing Unit, is the name given to the component that controls the
computer and works on the data. It can be split up into four sub-components:
We know a few things from before about the Von Neumann CPU.
3) Registers
A Von Neumann CPU has registers. These are very fast memory circuits. They hold
information such as the address of the next instruction (Program Counter), the current
instruction being executed (Current Instruction Register), the data being worked on and the
results of arithmetic and logical operations (Accumulators), information about the last
operation (Status Register) and whether an interrupt has happened (Interrupt Register).
Registers are covered in a lot more detail later in this chapter.
4) The clock
Instructions are carried out to the beat of the clock! Some instructions take one beat and
others more than one beat. Very roughly speaking, the faster the clock, the more clock beats
you have per second so the more instructions per section you can do and the faster your
computer will go.
We also know that computers have an address bus, so that the CPU can address each individual
memory location in the IAS, for example, when it wants to store a piece of data or retrieve a
piece of data. The data itself is moved about between devices on a data bus. There is also a
control bus, to generate signals to manage the whole process.
His computer architecture design consists of a Control Unit, Arithmetic and Logic Unit (ALU),
Memory Unit, Registers and Inputs/Outputs.
Von Neumann architecture is based on the stored-program computer concept, where instruction
data and program data are stored in the same memory. This design is still used in
most computers produced today.
Central Processing Unit (CPU)
The Central Processing Unit (CPU) is the electronic circuit responsible for executing the
instructions of a computer program.
Registers
Registers are high speed storage areas in the CPU. All data must be stored in a register before it
can be processed.
MAR Memory Address Register Holds the memory location of data that needs to be accessed
MDR Memory Data Register Holds data that is being transferred to or from memory
CIR Current Instruction Register Contains the current instruction during processing
The ALU allows arithmetic (add, subtract etc) and logic (AND, OR, NOT etc) operations to be
carried out.
The control unit controls the operation of the computers ALU, memory and input/output
devices, telling them how to respond to the program instructions it has just read and interpreted
from the memory unit. The control unit also provides the timing and control signals required by
other computer components.
Buses
Buses are the means by which data is transmitted from one part of a computer to another,
connecting all major internal components to the CPU and memory.
A standard CPU system bus is comprised of a control bus, data bus and address bus.
Carries the addresses of data (but not the data) between the processor and
Address Bus
memory
Carries data between the processor, the memory unit and the input/output
Data Bus
devices
Carries control signals/commands from the CPU (and status signals from other
Control Bus
devices) in order to control and coordinate all the activities within the computer
Memory Unit
The memory unit consists of RAM, sometimes referred to as primary or main memory. Unlike a
hard drive (secondary memory), this memory is fast and also directly accessible by the CPU.
RAM is split into partitions. Each partition consists of an address and its contents (both in binary
form).
Translators
Computers only understand machine code (binary), this is an issue because programmers prefer
to use a variety of high and low-level programming languages instead.
To get around the issue, the high-level and low-level program code (source code) needs to pass
through a translator. A translator will convert the source code into machine code (object code).
There are several types of translator programs, each able to perform different tasks.
Compiler
Compilers are used to translate a program written in a high-level language into machine code
(object code).
Once compiled (all in one go), the translated program file can then be directly used by the
computer and is independently executable.
Compiling may take some time but the translated program can be used again and again without
the need for recompilation.
An error report is often produced after the full program has been translated. Errors in the
program code may cause a computer to crash. These errors can only be fixed by changing the
original source code and compiling the program again.
Interpreter
Interpreter programs are able to read, translate and execute one statement at a time from a high-
level language program.
The interpreter stops when a line of code is reached that contains an error.
Interpreters are often used during the development of a program. They make debugging easier as
each line of code is analysed and checked before execution.
Interpreted programs will launch immediately, but your program may run slower then a complied
file.
No executable file is produced. The program is interpreted again from scratch every time you
launch it.
Assembler
Assemblers are used to translate a program written in a low-level assembly language into a
machine code (object code) file so it can be used and executed by the computer.
Once assembled, the program file can be used again and again without re-assembly.
Summary of translators
Compiler Interpreter Assembler
Temporarily executes high-
Translates high-level languages Translates low-level assembly
level languages, one statement
into machine code code into machine code
at a time
No executable file of machine
An executable file of machine An executable file of machine
code is produced (no object
code is produced (object code) code is produced (object code)
code)
Compiled programs no longer Interpreted programs cannot be Assembled programs no longer
need the compiler used without the interpreter need the assembler
Error report produced once One low-level language
Error message produced
entire program is compiled. statement is usually translated
immediately (and
These errors may cause your into one machine code
program stops at that point)
program to crash instruction
Compiling may be slow, but Interpreted code is run through
the resulting program code will the interpreter (IDE), so it may
run quick (directly on the be slow, e.g. to execute
processor) program loops
One high-level language
statement may be several lines
of machine code
when compiled
During the fetch execute cycle, the computer retrieves a program instruction from its memory. It
then establishes and carries out the actions that are required for that instruction.
The cycle of fetching, decoding, and executing an instruction is continually repeated by the CPU
whilst the computer is turned on.