Processor Structure
Course Content Specification
Describe the concept of the fetch-execute cycle.
Processor Structure
The Von Neumann Model
The Von Neumann architecture was originally described in a paper by John von Neumann in 1945 . It described a computer that had 4 main parts:
CA – Central Arithmetic Logic Unit
CC – Central Control Unit
Memory
Input and Output Channels
Von Neumann proposed that instructions should be stored in binary within memory. This is referred to as the Stored Program Concept. There are other architectures that treat data and instructions separately such as the Harvard architecture. The Von Neumann architecture can be represented by the following diagram.
Von Neumann architecture
The 5 parts of the diagram can be broken down as follows:
Input Devices
These are devices that put new information into the computer, such as mice, keyboards etc. More on these later.
Output Devices
These are devices that get information from the computer, such as monitors and printers etc.
Backing Storage
These are devices that are used to store permanent copies of our files and data, such as Hard Disk Drives and USB Flash Drives.
Memory
Memory can be broken down into two types, RAM and ROM.
Processor or CPU (Central Processing Unit)
This is the processor, this is the part of the computer that actually performs the tasks required by the system.
A closer look at the processor
The processor is a complex piece of equipment and can be broken down into some of its more basic parts.
These are shown below:
The Control Unit is responsible for the timing of the processor and the execution of instructions. It ensures that they are completed in the correct order
The ALU performs the arithmetical operations and Boolean logical comparisons (such as AND,OR etc.)
Registers are small temporary stores of information inside the processor. They are used for things such as storing results from calculations at most they will store a few bytes.
However the processor has other critical parts, these parts are shown below:
Bus Structure. A bus is the name given to a collection of wires which can transmit a signal.
What does the Control Unit do?
The control unit does not carry any data in the way that a data bus does but it has a number of lines that perform particular tasks, these are detailed below.
Clock - Generates a constant pulse (measured in Mhz/Ghz). One operation will be carried out per core per pulse.
Reset - Returns the system/CPU/processor to its initial state saves contents and clears registers. This is not the same as resetting the power.
Interrupt - Notifies the processor that an external event has occurred such as I/O from a device. This type of interrupt can be ignored.
Non Maskable Interrupt (NMI) - This is an interrupt that CANNOT be ignored such as a low power failure notification.
Difference between instructions and operations
An operation is a single command, such as a value being transferred to a register, one instruction (such as adding two numbers together) may require more than one operation (line of assembly code).
The Arithmetic and Logic Unit (ALU)
The ALU’s primary role is arithmetic. Such as addition, multiplication etc.
With regards to logic it will perform operations such as: Logical AND/OR i.e. the Boolean comparison operators as used in programming. One particular register used by the ALU is the Accumulator - this holds the results of additions. In documentation about Intel processors this is referred to as the EAX.
Registers
Registers are small temporary stores of information, these are built into the CPU and can be accessed almost immediately. Modern Intel Processors will have registers up to 64 bits.
What can be held in a register?
A register can only hold 3 types of information:
Data
Instructions
Addresses
Use of a register when performing arithmetic
If we were adding two numbers together using a line of assembly code as shown below:
add ax,bx
The ax register would hold one value with the bx register holding a second value.
Other Registers
Although out of the scope of the course some are listed below:
Program Counter (PC) : Holds the address in memory of the next instruction in the program. Would be passed to the MAR.
Instruction Register (IR): Holds the current instruction being executed. If needed would transfer to the memory Data Register (MDR)
Memory Address Register (MAR): This is used to hold a value representing the address in memory that the processor needs to access. Connected to the Address Bus.
Memory Data Register (MDR): This is used to hold data read from or being written to memory. Connected to the Data Bus
Buses
Each bus has a particular role, we have covered the control bus/unit but we have two left:
Address Bus
Data Bus
Address Bus
The address bus has only one role. It simply carries the address of the location in memory that is to be accessed. It is only ever points TO memory. It does not hold any data and never transmits any data back to the CPU.
Data Bus
The data bus is used to carry data to and from the processor. It will hold a binary word. The word length is the term given to the maximum length of a binary number that the processor can process in one operation. Generally - the bigger the word length the more efficient the processor i.e. the more work it can do in every operation. The data bus is bi-directional, it can carry data FROM and TO the CPU/memory.
Fetch Execute Cycle
Every time that the processor wants to actually execute an instruction it has to follow a set series of steps to retrieve and execute the instruction.
This is known as the fetch-execute cycle. It can be represented by the following steps:
The memory address of the next instruction is placed on the address bus.
Read line is activated.
The instruction is transferred to the processor on the data bus.
The instruction is decoded and executed.
Reading from Memory (Memory Read)
The Address bus is set up with the address to be read from.
The Read (control) line is activated.
The Data bus is set up with data to be read.
The Data on data bus is placed in the registers in the processor.
Decode and then execute.
Writing to Memory (Memory Write)
Address bus is set up with the address to be written to.
Data bus is setup with the data to be written.
Write (control) line is activated.
Data on data bus is placed in memory location specified by address bus.
Lesson Video
![](https://www.google.com/images/icons/product/drive-32.png)