Lecture04 VonNuemann

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 53

CHAPTER 04

THE VON NEUMANN COMPUTER ARCHITECTURE


THE BASIC OPERATIONS OF A COMPUTER

 Regardless of type and size, all computers use the


same four basic operations:
(1) input,
(2) processing,
(3) storage, and
(4) output. To this we add
(5) communications.
COMPUTER ARCHITECTURE/ VON NEUMANN
ARCHITECTURE

 Early computer programs were hard wired.

 To reprogram a computer meant changing the


hardware switches manually, that took a long time
with potential errors.

 Computer memory was only used for storing data.

 John von Neumann suggested that data and programs


should be stored together in memory.
 This “STORED-PROGRAM ” architecture is now known
as Von-Neumann Architecture
THE VON NEUMANN MODEL
THE VON NEUMANN ARCHITECTURE

Von Neumann microprocessor is a processor that


follows this pattern:
 Fetch An instruction and the necessary data are

obtained from memory.


 Decode The instruction and data are separated, and

the components and pathways required to execute


the instruction are activated.
 Execute The instruction is performed, the data is

manipulated, and the results are stored.


THE INSTRUCTION CYCLE OF VON NEUMANN
ARCHITECTURE

Fetch

Execu Decod
te e
PARTS OF THE MICROPROCESSOR

The simplified model consists of five parts, which are:


 Arithmetic & Logic Unit (ALU)

The part of the central processing unit that deals with


operations such as addition, subtraction, and multiplication of
integers and Boolean operations. It receives control signals
from the control unit telling it to carry out these operations

 Control Unit (CU)


This controls the movement of instructions in and out of the
processor, and also controls the operation of the ALU. It
consists of a decoder, control logic circuits, and a clock to
ensure everything happens at the correct time. It is also
responsible for performing the instruction execution cycle.
PARTS OF THE MICROPROCESSOR

 Register Array
This is a small amount of internal memory that is used
for the quick storage and retrieval of data and
instructions. All processors include some common
registers used for specific functions, namely the program
counter, instruction register, accumulator, memory
address register and stack pointer.
 System Bus
This is comprised of the control bus, data bus and
address bus. It is used for connections between the
processor, memory and peripherals, and transferal of
data between the various parts. Click the title above for
more.
PARTS OF THE MICROPROCESSOR

 Memory
The memory is not an actual part of the CPU itself,
and is instead housed elsewhere on the
motherboard. However, it is here that the program
being executed is stored, and as such is a crucial part
of the overall structure involved in program
execution.
PARTS OF THE MICROPROCESSOR
THE CONTROL UNIT

 The control unit issues control signals to the other areas


of the processor, instructing them on what should be
performed next. The three main elements of the control
unit are :
 Decoder
This is used to decode the instructions that make up a
program when they are being processed, and to
determine in what actions must be taken in order to
process them. These decisions are normally taken by
looking at the opcode of the instruction, together with
the addressing mode used. This is covered in greater
detail in the instruction execution section of this tutorial.
THE CONTROL UNIT

 Timer or clock
The timer or clock ensures that all processes and instructions are carried
out and completed at the right time. Pulses are sent to the other areas of
the CPU at regular intervals (related to the processor clock speed), and
actions only occur when a pulse is detected. This ensures that the actions
themselves also occur at these same regular intervals, meaning that the
operations of the CPU are synchronised.
 Control logic circuits
The control logic circuits are used to create the control signals themselves,
which are then sent around the processor. These signals inform the
arithmetic and logic unit and the register array what they actions and
steps they should be performing, what data they should be using to
perform said actions, and what should be done with the results.
 Further detail is not required at this stage on the control unit, though it is
clear that there is much detail at lower levels that has yet to be touched
on. However, to move on to the next element of the processor (the
register array), please click the next button below
REGISTERS

 A register is a memory location within the CPU itself,


designed to be quickly accessed for purposes of fast
data retrieval.
 Processors normally contain a register array, which
houses many such registers. These contain
instructions, data and other values that may need to
be quickly accessed during the execution of a
program. Many different types of registers are
common between most microprocessor designs.
These are:
REGISTERS

Program
Instruction
Counter
Register (IR)
(PC)

Memory
Accumulator Address
(A) Register
(MAR)
Memory
Buffer Flag
Register(MB Registers
R)
REGISTERS

 Program Counter (PC)


This register is used to hold the memory address of the next instruction that has
to executed in a program.

 Instruction Register (IR)


This is used to hold the current instruction in the processor while it is being
decoded and executed

 Accumulator (A, or ACC)


The accumulator is used to hold the result of operations performed by the ALU.

 Memory Address Register (MAR)


Used for storage of memory addresses, usually the addresses involved in the
instructions held in the instruction register. The control unit then checks this
register when needing to know which memory address to check or obtain data
from.
REGISTERS

 Memory Buffer Register (MBR)


When an instruction or data is obtained from the memory or elsewhere, it is
first placed in the memory buffer register. The next action to take is then
determined and carried out, and the data is moved on to the desired location.

 Flag register / status flags


The flag register is specially designed to contain all the appropriate 1-bit
status flags, which are changed as a result of operations involving
the arithmetic and logic unit.

 Other general purpose registers


These registers have no specific purpose, but are generally used for the quick
storage of pieces of data that are required later in the program execution. In
the model used here these are assigned the names A and B, with suffixes of L
and U indicating the lower and upper sections of the register respectively.
THE DETAILED MODEL OF VON NEUMANN ARCHITECTURE
THE SYSTEM BUS

 The system bus is a cable which carries data


communication between the major components of
the computer, including the microprocessor.

 The system bus consists of three different groups of


wiring, called the data bus, control bus and address
bus.
THE SYSTEM BUS

 These all have seperate responsibilities and


characteristics, which can be outlined as follows:
THE SYSTEM BUS

 Control Bus
The control bus carries the signals relating to the control and co-
ordination of the various activities across the computer, which can be
sent from the control unit within the CPU. This is a bidirectional bus.
 Data Bus
This is used for the exchange of data between the processor, memory
and peripherals, and is bi-directional so that it allows data flow in both
directions along the wires.

 Address Bus
The address bus contains the connections between the microprocessor
and memory that carry the signals relating to the addresses which the
CPU is processing at that time, such as the locations that the CPU is
reading from or writing to. The maximum address capacity is equal to
two to the power of the number of lines present (2^lines).
NOTE

 In many older computers, the address bus was 16


bits wide (a = 16).
 This meant that there were 16 wires.
 Such microprocessors could address up to 216 =
65536 memory locations.
 By increasing the width of the address bus, more
memory locations can be directly addressed.
WHY IS A DATA BUS BIDIRECTIONAL ,
AND AN ADDRESS BUS UNIDIRECTIONAL ?
THE DETAILED INSTRUCTION CYCLE

The instruction execution cycle can be clearly divided into three


different parts
 Fetch Cycle

The fetch cycle takes the address required from memory, stores it in
the instruction register, and moves the program counter on one so
that it points to the next instruction.
 Decode Cycle

Here, the control unit checks the instruction that is now stored
within the instruction register. It determines which opcode and
addressing mode have been used, and as such what actions need to
be carried out in order to execute the instruction in question.
 Execute Cycle

The actual actions which occur during the execute cycle of an


instruction depend on both the instruction itself, and the addressing
mode specified to be used to access the data that may be required.
 http://www.eastaughs.fsnet.co.uk/cpu/execution-
fetch.htm
FETCH
DECODE AND EXECUTE

 Once the instruction has been fetched and is stored,


the next step is to decode the instruction in order to
work out what actions should be performed to
execute it.

 This involves examining the opcode to see which of


the machine codes in the CPU's instruction set it
corresponds to.

 Opcode stands for Operation Code.


DECODE AND EXECUTE

 Once the opcode is known, the execution cycle can occur.


Different actions need to be carried out dependant on the
opcode, with no two opcodes requiring the same actions to
occur. However, there are generally four groups of different
actions that can occur:
 Transfer of data between the CPU and memory.
 Transfer of data between the CPU and an input or output
devices.
 Processing of data, possibly involving the use of the arithmetic
and logic unit.
 A control operation, in order to change the sequence of
subsequent operations. These can possibly be conditional,
based on the values stored at that point within the flag
register.
AN OPCODE

 An opcode is a single instruction that can be executed by


the CPU. In machine language, it is a binary or
hexadecimal value as B6 loaded into the IR.

In assembly language, an opcode is a mnemonic such as


ADD, MOV, JMP, etc.

For example,
MOV, AL, 34h

The parts AL and 34h are the operands, where AL is a


register and 34hex is a value.
FOR GREATER SIMPLICITY, AND AS DESCRIBING ALL THE POSSIBLE
INSTRUCTIONS IS UNNECESSARY, WE WILL ONLY LOOK AT A FEW
POSSIBLE INSTRUCTIONS. THESE ARE:

Mnemonic Description
MOV Moves a data value from one location to
another
ADD Adds to data values using the ALU, and
returns the result to the accumulator
STO Stores the contents of the accumulator in
the specified location
END Marks the end of the program in memory
IMMEDIATE ADDRESSING

 When writing out the code in mnemonic form,


operands that require this mode are marked with
a # symbol. With immediate addressing, the data
required for execution of the instruction is located
directly within the operands of the instruction itself.
No lookup of data from memory is required.
ACTIVITY

 Class Activity : Write your first name as an ASCII bit


configuration

You might also like