What are the 7 internal structures of the CPU?
Control unit
Program counter
Memory address/buffer register
Memory data register
Current instruction register
Arithmetic logic unit
Accumulator
What is the ALU responsible for?
Performing mathematical calculations and logical operations on data
What are the tasks of the ALU?
Performing addition, subtraction, multiplication, division
Performing logical bitwise operations, such as AND, OR, NOT, and XOR
Performing comparisons between values
Shifting binary patterns to the left or right
What is the Control Unit?
A component of the processor that directs the operations of the CPU
What are the jobs of the CU?
Controlling and coordinating the activities of the CPU
Managing the flow of data between the CPU and other devices
Accepting the next task, decoding tasks
Storing the resulting data back in memory
How does the CU work?
Uses control signals to enable data to be read from and written to memory
What is the CPU?
An electronic chip that fetches instructions from main memory, decodes them, executes them and produces an output
What is the Program Counter?
Holds the address of the location of the next instruction to be executed
What does the MAR do?
Temporarily holds the address of the memory location that is to be read from or written to
What does the MDR do?
Temporarily holds the data that has been read from or that needs to be written to main memory
What does the CIR do?
Holds the current instruction being executed - divided up into operand and opcode
What does the ACC do?
Stores the results from calculations performed by the ALU
What is a bus?
A set of parallel wires that connect two or more components
What are the 3 system buses?
Address bus
Data bus
Control bus
What does uni-directional mean?
Information flows in one direction - from the processor to main memory
What does bi-directional mean?
Information flows both ways
What buses are uni-directional?
Only the address bus
What buses are bi-directional?
Data and control bus
What needs to be done for a program’s intructions to be ready to be carried out?
Translated into machine code
Instructions have been loaded from secondary storage into main memory
What are external buses?
Connects the peripherals to the processor via serial or parallel connections
What is the purpose of the address bus?
Carries memory addresses that identify where the data is being read from and written to
What is the purpose of the data bus?
Transports data and instructions between components
What is the purpose of the control bus?
Carries command and control signals between internal and external components
What is an instruction set?
A collection of instructions that the CPU uses to carry out its tasks
What is assembly language?
Programming language that is written in a readable format
What is LMC?
Little Man Computer - A simplified instruction set
What are the 11 mnemonics in LMC and what is the translation?
ADD - Add
SUB - Subtract
STA - Store
LDA - Load
BRA - Branch Always
BRZ - Branch if zero
BRP - Branch if positive
INP - Input
OUT - Output
HLT - End program
DTA - Data Location
What are the 6 factors that can affect CPU performance?
Clock speed
Number of cores
Cache size
Size of RAM
GPU
Pipelining
What is clock speed?
Number of instructions a single processor core can carry out per second
What is a core?
A complete processing unit that has its own registers, ALU and CU
What is cache?
A small amount of fast RAM that stores regularly used data for fast CPU access
How does the clock speed affect CPU performance?
The greater the clock speed, the faster the CPU can run, resulting in more instructions being processed every second and programs take less time to run
What is a disadvantage of having a high clock speed and how can it be combatted?
Power is used with every clock tick, which generates heat. If overclocking occurs, the heat can damage the chip. A heat sink can be used
What is overclocking?
When the CPU is run faster that its normal design speed
How does having multiple cores affect CPU performance?
Multi-tasking - Multiple F-D-E cycles can be run at the same time on multiple cores
Parallel Processing - when a single task is split into two or more parts and each is processed at the same time
What is a dual-core?
A CPU with two cores
What is a quad-core?
A CPU with four cores
What is a disadvantage of increasing the number of cores?
Not all programs take advantage of multiple cores
How does increasing the cache size affect CPU performance?
Less retrieval from RAM - regularly used instructions will be retrieved from the cache at a faster rate
More space for data/instructions in cache memory
What is a disadvantage of increasing cache size?
Cache is more expensive than RAM
What are the 3 levels of cache?
Level 1 (L1) - Very fast but has the smallest capacity
Level 2 (L2) - Relatively fast with a medium-sized capacity
Level 3 (L3) - Slow but has the largest capacity
Where is L1 cache found?
Inside the CPU chip
Where is L2 and L3 cache found?
Inside or outside the CPU
What is RAM?
Random Access Memory - Main memory that is used to store computer programs and data currently in use
What happens if there is not enough RAM?
The computer will perform poorly - some applications may not load at all
Applications are swapped out to virtual memory
What is virtual memory?
An area set aside on the hard disk to act as very slow RAM
Stores some of the currently running programs and data if RAM is full
What is pipelining?
The process of fetching an instruction, whilst the prior one is being decoded and the one before that is being executed
What is instrucion pipelining?
Seperating out the instruction into fetching, decoding and executing
What is arithmetic pipeling?
Breaking down the arithmetic operations and overlapping them as they are performed
What is the fetch, decode, execute cycle?
The sequence of operations that are completed in order to execute an instruction
What is the fetch stage?
Contents of the PC is copied into the MAR, which is connected to the address bus. The address of the next instruction to be executed is placed on the address bus
CU instructs a memory read operation to allow the contents of the memory location to be transferred to the processor. Instruction stored at that address is transferred using the data bus from RAM to the processor, and is copied into the MDR
Contents of the MDR is copied into the CIR and the PC is incremented by 1 simultaneously to hold the address of the next instruction
What is the decode phase?
CU decodes the instruction into operand and opcode in the CIR
What is the execute phase?
Instruction is executed
What is the Von Neumann Architecture?
The idea of storing program instructions and data in main memory and moving them between memory and the processor
Shared memory and shared data bus for both data and instructions
What does the Von Neumann Architecture include?
A single CU, ALU, registers and memory units
What are the issues with the Von Neumann Architecture?
Shared memory for data and programs is a security threat
Defective programs may fail to release the memory when finished using it
Von Neumann bottleneck
Bottlenecked data bus
What is the Harvard Architecture?
Physically seperates memories for instructions and data
What are the isseues with the Harvard Architecture?
More physical space needed
Complex to handle two seperate blocks of memory
Increases potential cost designs
What are the advantages of Von Neumann?
Cheaper to develop as the CU is easier to design
Programs can be optimised in size
What are the advantages of Harvard?
Quicker execution - data and inctructions can be fetched in parallel
Memories can be different sizes, which can make more efficient use of space
What is contemporary processing?
Uses both Harvard and Von Neumann Architecture.
Harvard for communication between CU and caches - divides cache into instruction cache and data cache
Von Neumann is used when working with data and instructions in main memory