Vous êtes sur la page 1sur 9

Von Neumann architecture

Von Neumann architecture


In the 1940s, a mathematician called John Von Neumann described the basic arrangement (or
architecture) of a computer. Most computers today follow the concept that he described although
there are other types of architecture. When we talk about the Von Neumann architecture, we are
actually talking about the relationship between the hardware that makes up a Von Neumann-
based computer.

A Von Neumann-based computer is a computer that:


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.

1) The ALU, or Arithmetic Logic Unit


A Von Neumann CPU has an ALU. This is the part of the CPU that performs arithmetic and
logic operations on data and acts as the revolving for the CPU, letting data enter and leave
the CPU. We also know that CPUs have a word size. This is the number of bits that can be
added, for example, in one go. The bigger a CPUs word size, the more bits it can work on in
one clock cycle and the more work you can get done.

2) The Control Unit


A Von Neumann CPU has a control unit. The control unit is in charge of fetching each
instruction that needs to be executed in a program by issuing control signals to the hardware.
It then decodes the instruction and finally issues more control signals to the hardware to
actually execute it.

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.

Von Neumann Component 2 - IAS


We also know that the Von Neumann computer has an IAS, or Immediate Access Store, where it
puts both programs and data. We often commonly refer to this memory as RAM. RAM is made
up of lots of boxes that can store a bit pattern. Each box has a unique address. A memory
address might store an instruction (which is made up of an operator and an operand) or it might
store just a piece of data. A Von Neumann computer cant tell the difference between the bit
patterns as such, but knows indirectly because of where the bit pattern is stored in RAM. Pre-
Von Neumann computers used to split up memory into program memory and data memory and
this made computers relatively complex. Von Neumann was the first to realise that there was
actually no difference between the nature of an instruction and the nature of a piece of data. One
important function of an operating system is to manage memory and to keep track of the RAM
addresses of applications as well as any data.

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.

Von Neumann Component 3 - I/O


A computer needs peripherals for inputting and outputting data. It needs to be able to read data
into itself and send data out. It reads data in and sends data out through its I/O ports. A port is
simply a gateway, like a port used for shipping. Just like every port used for ships needs its own
harbour master, so every I/O port needs to be managed. An I/O controller is the term used to
describe the I/O port along with the circuits that manage data into and out of the port. It allows
you to connect up any I/O device to the PC and transfer data in to or out of the computer. You
wouldnt want to connect an I/O device directly to a CPU because you would have to redesign
the CPU every time a new type of device came along. Besides, a new type of device might need
different voltages and control signals from the CPU, again necessitating a CPU redesign. The I/O
controller acts as an interface to overcome these problems. Refining the diagram we saw in the
previous chapter on CPUs, we now have:
A computer system showing the I/O controllers.
Of course, there are a whole range of other I/O controllers we could have included. We could
have shown ones for devices such as a mouse, a MIDI device, a printer, a DVD player, a SCSI
device as used with many scanners or a network card, to name just a few.

Von Neumann bottleneck


Whatever you do to improve performance, you cannot get away from the fact that instructions
can only be done one at a time and can only be carried out sequentially. Both of these factors
hold back the efficiency of the CPU. This is commonly referred to as the 'Von Neumann
bottleneck'. You can provide a Von Neumann processor with more RAM, more cache or faster
components but if real gains are to be made in CPU performance then a major review needs to
take place of CPU design.

Von Neumann Architecture


Von Neumann architecture was first published by John von Neumann in 1945.

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.

It is sometimes referred to as the microprocessor or processor.

The CPU contains the ALU, CU and a variety of registers.

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

AC Accumulator Where intermediate arithmetic and logic results are stored


PC Program Counter Contains the address of the next instruction to be executed

CIR Current Instruction Register Contains the current instruction during processing

Arithmetic and Logic Unit (ALU)

The ALU allows arithmetic (add, subtract etc) and logic (AND, OR, NOT etc) operations to be
carried out.

Control Unit (CU)

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).

The address will uniquely identify every location in the memory.


Loading data from permanent memory (hard drive), into the faster and directly accessible
temporary memory (RAM), allows the CPU to operate much quicker.

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

Fetch Execute Cycle


The fetch execute cycle is the basic operation (instruction) cycle of a computer.

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.

Stage Description of Stage Simplified Description


The PC contains the address of the memory location
1 PC has address of next instruction
that has the next instruction which has to be fetched
This address is then copied from the PC to the
2 PC copied to the MAR
MAR via the address bus
The contents (instruction) at the memory location
Lookup MAR and get contents. Copy
3 (address) contained in MAR are then copied into the
contents into the MDR
MDR
The contents (instruction) in the MDR is then
4 Copy MDR contents into the CIR
copied and placed into the CIR
The value in the PC is then incremented by 1 so that
5 it now points to the next instruction which has to be PC is then incremented by 1
fetched
The instruction is finally decoded and then executed
The instruction is decoded and then
6 by sending out signals (via control bus) to the
executed
various components of the computer
7 Repeat

Vous aimerez peut-être aussi