Structure and Functions Flashcards
What is the CPU
Central Processing Unit
responsible for processing all the data within the computer
PC
Program Counter
Stores the address of the next instruction to be executed
ALU
Arithmetic Logic Unit
Does calculations and logic e.g. comparison
CU
Control Unit
Sends signals to coordinate how the processor works and controls how the data moves around the CPU and between the CPU and memory
MAR
Memory Address Register
Stores the address of the data or the instructions to be fetched from or sent to memory
ACC
Accumulator
Stores the result of calculations made up by the arithmetic logic unit
MDR
Memory Data Register
Stores the data that is to be sent or to be fetched from memory
CIR
Current Instruction Register
Stores the actual instruction that is being decoded and executed
What are the three buses in the CPU and what do they do
Address Bus
Data Bus
Control Bus
They are a set of parallel wires which connect two or more components inside the CPU, they are collectively called the system bus
What does each bus do?
Data Bus - It’s bi-directional so it can move data in both directions, used for transporting data and instructions between components, read/write
Address Bus - one directional, used to transmit the memory addresses specifying where data is to be sent to or retrieved from, read/write
Control Bus - bi-directional, used to transmit control signals between internal and external components, coordinates the use of the address and data buses and provides status information between system components, sends signals
What are registers?
Locations of very high speed computer memory within the processor
What are general-purpose registers
used to store the results of the intermediate calculations that are part of larger computations
What do dedicated or special-purpose registers do?
Have specific purpose within the fetch-decode-execute cycle
What are the registers?
PC, CIR, MAR, MDR, ACC and SR
What does the decode unit hold?
On the left, it has the opcode and operand which consists of 4 numbers each like “0000 0000” or a 4 number opcode and the word address as the operand like “0001 address”
On the right is the instructions like “add” and “end”
Fetch using the location 0000
The PC is loaded with the address of the first or next instruction to be executed (so location 0000)
then its copied to the MAR and then it goes along the address bus to the memory (RAM)
the CU sends a signal down the control bus to say to read
the contents of whatever is at the address 0000 is transferred along the data bus and added to the MDR and CIR
(if the address was 0000 the value in RAM would be 0101 0101)
the PC is incremented to get the next data instruction; 0001
Decode
the instruction in the CIR is decoded by the decode unit
the value copied from the RAM from Fetch (0101 0101) is made up of the opcode (operation; load, add, sub, store) and operand (data or address)
if on the decode unit “0101 address” means load, you would load whatever is in address 0101
Execute
As the item we need is in address 0101 we need to update the MAR to 0101
address is sent down the address bus to memory (RAM)
wait for a signal from the control unit to read the data
the data is in location 0101 ( which is 0011 0000) is sent down the data bus and added to the MDR
this is then passed to the ACC
this is then passed to the ALU which does any calculations and then back to the ACC which stores the results of any calculations done by the ALU
the calculation is executed by the ALU and the result of the instruction is stored in the accumulator, a general-purpose register, or back into main memory
Structure of the CPU chip (with cores)
CPU chip - 4 cores, one cache, one clock and then one external cache which is outside the CPU chip
Each core contains an ALU, Control Unit and Registers
the clock - how it works
The processor carries out one instruction at a time
to coordinate this action, the CPU has an internal quartz crystal clock that runs at a certain speed
this is called clock frequency
with each tick of the clock, a single-core CPU can process one instruction. 3.5GHz, this means that 3.5 billion instructions can be processed every second
clock frrquency, CPU, instructions correlation
The higher the clock frequency, the faster the CPU can run and the more instructions that can be processed every second
the clock - heat sinks
Every time the clock ticks, a bit of power is used and the power causes heat to be generated. if you go higher than a clock frequency of around 3.5 - 4.5 GHz, the heat will damage the chip itself
to keep the temperature down and to stop damage to the CPU, a large heat sink is required
A heat sink is a device designed to take heat away from the CPU, it includes metal fins to dissipate heat and a fan to drive air across the fins
The heatsink is placed right on top of the CPU
the clock - overclocking & other cooling systems
It is possible to run a CPU faster than its normal design speed - this is called ‘overclocking’.
But to do so requires some serious cooling systems.
For example, keen gamers might invest in water-cooled computers
there are some even more exotic scientific computers cooled by liquid nitrogen
Cores - how it works
A ‘core’ is a complete processing unit within the CPU - it has ALU, Control Unit and Registers
A CPU with two cores is called a ‘dual core’ and one with four cores is called a ‘quad-core’
each core can have its own internal cache to improve performance as well as a shared cache within the CPU
Increasing the number of cores improves performance in two ways
- Multi-tasking
- Parallel Processing