4. Processor Fundamentals
1. CPU Architecture
Main memory stores data and instructions that are to be processed
Stored program concept:
● Stored programs made up of instructions and data stored in the same memory space (main
memory), to be executed in sequential order
● Machine code instructions are loaded into main memory to be
executed by the processor
● Data is loaded into main memory
● The instructions are fetched one at a time and executed
immediately by the processor in a sequential order
Memory and addresses:
● Any program is just a series of instructions and data
● They are loaded into memory before they are executed by the CPU
● Each instruction is stored in its own memory address
● An address is just a location in the memory that stores an instruction
Von Neumann architecture encompasses:
● A common main memory that can stores instructions & data - the
Immediate Access Store (IAS)
● A CPU that can access the memory directly, with CU + ALU
● Instructions and data transferred using a (single shared) bus
● Stored programs made up of data & instructions that can be
executed in sequential order - stored program concept
Arithmetic Logic Unit (ALU):
● Performs arithmetic, logical and shift operations on data
○ Arithmetic operations: Add, Subtract, Multiply and Divide
○ Logical operations include: AND, OR, NOT, XOR
○ Shift operations: Move bits to the left or right within a register
Control Unit (CU):
● Coordinates/synchronises the actions of other components in the CPU
● Sends/receives control signals along the control bus
● Manage the execution/decoding of instructions (in sequence)
● Controls the communication between the components of the CPU
System Clock:
● The system clock is responsible for synchronising the
operations in the CPU components
● It does this by creating a series of regular ON/OFF
timing signals, which are sent on the Control Bus
● Actions are usually carried out on the rising edge of the clock
● Actions each take a fixed number of cycles to complete
, Immediate Access Store (IAS):
● The IAS is a type of primary memory (RAM)
● Holds all the data/instructions/programs currently in use ready for the CPU to access
● Volatile memory
● Has fast access times (read/write operations carried out using the IAS are considerably faster
than read/write operations to backing store/secondary storage)
Registers:
● A register is very small amount of memory that holds values, and is very quick for CPU to access
● Results from arithmetic operations can be stored in a general purpose register e.g. accumulator to
keep a running total when doing multiple additions
● The ALU uses registers, as rather than having to write working data back to the much slower
memory, they can use the much faster and nearer registers to temporarily store data
● General purpose registers can be used for all purposes defined by the programmer, whereas
special purpose registers have a specified role in the machine
● General purpose registers hold the program’s data during operations whereas special purpose
registers hold the state of the program’s execution
Special Purpose Registers:
● Program counter (PC) - stores the memory address of the next instruction to be executed
● Memory Address Register (MAR) - holds/stores the address of the memory location currently
being read from or written to by the processor
● Memory Data Register (MDR) - temporarily holds/stores the data/instructions which have been
read from or is to be written to the memory address currently in the MAR
● Current Instruction Register (CIR) - holds/stores instruction currently being decoded/executed
● Index register (IX) - used to store a value that is added to the operand to give a new address,
when using indexed addressing operations
● Status register (SR) – used to store flags/bits (e.g. carry or overflow), which are set by events, that
hold information about the current state of operations, that can be changed/set/cleared after
arithmetic/logic operations
● Used when an instruction requires some form of arithmetic operation or logic processing
● Each bit is known as a flag - the following flags are in most systems:
○ Carry flag (C) - set to 1 if there is a carry from an addition
○ Negative flag (N) - set to 1 if a result yields a negative value
○ Overflow flag (V) - set to 1 if an operation results in an overflow
○ Zero flag (Z) - set to 1 if a result is zero
1. CPU Architecture
Main memory stores data and instructions that are to be processed
Stored program concept:
● Stored programs made up of instructions and data stored in the same memory space (main
memory), to be executed in sequential order
● Machine code instructions are loaded into main memory to be
executed by the processor
● Data is loaded into main memory
● The instructions are fetched one at a time and executed
immediately by the processor in a sequential order
Memory and addresses:
● Any program is just a series of instructions and data
● They are loaded into memory before they are executed by the CPU
● Each instruction is stored in its own memory address
● An address is just a location in the memory that stores an instruction
Von Neumann architecture encompasses:
● A common main memory that can stores instructions & data - the
Immediate Access Store (IAS)
● A CPU that can access the memory directly, with CU + ALU
● Instructions and data transferred using a (single shared) bus
● Stored programs made up of data & instructions that can be
executed in sequential order - stored program concept
Arithmetic Logic Unit (ALU):
● Performs arithmetic, logical and shift operations on data
○ Arithmetic operations: Add, Subtract, Multiply and Divide
○ Logical operations include: AND, OR, NOT, XOR
○ Shift operations: Move bits to the left or right within a register
Control Unit (CU):
● Coordinates/synchronises the actions of other components in the CPU
● Sends/receives control signals along the control bus
● Manage the execution/decoding of instructions (in sequence)
● Controls the communication between the components of the CPU
System Clock:
● The system clock is responsible for synchronising the
operations in the CPU components
● It does this by creating a series of regular ON/OFF
timing signals, which are sent on the Control Bus
● Actions are usually carried out on the rising edge of the clock
● Actions each take a fixed number of cycles to complete
, Immediate Access Store (IAS):
● The IAS is a type of primary memory (RAM)
● Holds all the data/instructions/programs currently in use ready for the CPU to access
● Volatile memory
● Has fast access times (read/write operations carried out using the IAS are considerably faster
than read/write operations to backing store/secondary storage)
Registers:
● A register is very small amount of memory that holds values, and is very quick for CPU to access
● Results from arithmetic operations can be stored in a general purpose register e.g. accumulator to
keep a running total when doing multiple additions
● The ALU uses registers, as rather than having to write working data back to the much slower
memory, they can use the much faster and nearer registers to temporarily store data
● General purpose registers can be used for all purposes defined by the programmer, whereas
special purpose registers have a specified role in the machine
● General purpose registers hold the program’s data during operations whereas special purpose
registers hold the state of the program’s execution
Special Purpose Registers:
● Program counter (PC) - stores the memory address of the next instruction to be executed
● Memory Address Register (MAR) - holds/stores the address of the memory location currently
being read from or written to by the processor
● Memory Data Register (MDR) - temporarily holds/stores the data/instructions which have been
read from or is to be written to the memory address currently in the MAR
● Current Instruction Register (CIR) - holds/stores instruction currently being decoded/executed
● Index register (IX) - used to store a value that is added to the operand to give a new address,
when using indexed addressing operations
● Status register (SR) – used to store flags/bits (e.g. carry or overflow), which are set by events, that
hold information about the current state of operations, that can be changed/set/cleared after
arithmetic/logic operations
● Used when an instruction requires some form of arithmetic operation or logic processing
● Each bit is known as a flag - the following flags are in most systems:
○ Carry flag (C) - set to 1 if there is a carry from an addition
○ Negative flag (N) - set to 1 if a result yields a negative value
○ Overflow flag (V) - set to 1 if an operation results in an overflow
○ Zero flag (Z) - set to 1 if a result is zero