KEY WORDS:
Fetch-execute cycle - instructions are fetched one by one from the main memory, decoded, and then executed by the processor. This cycle repeats until the program is complete.
CPU - a chip within the computer which controls the operations of all parts of the computer and decodes then executes program instructions.
ALU(Arithmetic Logic Unit) - The part of the CPU responsible for arithmetic and logical operations.
Von Neumann Architecture:
Programs consist of instructions and data which are stored in memory addresses as binary digits.
In short, this is the internal, logical structure and the organisation of the computer hardware.
CPU:
Known as the brain of the computer.
Job is to process the data
searching, sorting, calculating and decision making.
Fetch - Execute - Decode Cycle:
There are three steps in the cycle:
Fetches instructions
Decodes instructions
Executes instructions
The data and instructions are loaded onto the RAM.
RAM is directly accessed by the CPU.
The FETCH stage:
The CPU fetches some data and instructions from the main memory(RAM) then stores them in its own temporary memory called ‘registers‘.
RAM is a separate chip, outside the CPU and is directly accessed by the CPU as main memory/primary memory.
The CPU uses a piece of hardware path called the ‘address bus‘.
The address of the next item that the CPU wants is put onto the ‘address bus‘.
Data from this area then travels from the RAM to the CPU on another piece of hardware called the ‘data bus‘.
The DECODE stage:
The decode step is where the CPU understands/works out what the instruction it has just fetched actually means.
The CPU ‘decodes‘ the instruction and gets things ready for the next step.
The EXECUTE stage:
Where the data processing happens.
The instructions are carried out on this data.
Once the cycle has been completed, another one begins.
What makes up the CPU?
Control Unit or CU
Immediate Access Store(IAS) OR ‘Cache‘
Arithmetic Logic Unit(ALU)
Registers
The CONTROL UNIT:
Manages and monitors hardware on the computer to ensure correct data goes to the correct hardware.
Manages the input and output signals ensuring these are dealt with correctly.
It manages the Fetch-Decode-Execute cycle.
The CACHE:
Stores data which is to be immediately processed.
The CPU takes a chunk of data/instructions from the RAM and keeps it closed so that it always has a constant supply of data to process.
The ALU:
includes two parts:
arithmetic part:
performs calculations
logic part:
deals with logical operations
e.g. true or false
The CPU carries out the maths and logic on the data.
The REGISTERS:
They are special types of memory inside the CPU.
They can temporarily hold a data value.
There are 5 registers but one is not listen in the J277 specification.
Program Counter(PC) - Holds the location of the next instruction to be fetched from memory. It is automatically incremented between supplying the address of the next instruction and the instruction being executed.
Memory Address Register(MAR) - Holds the address of the next piece of data/instruction to be fetched.
Memory Data Register(MDR) - Holds the piece of data that has been fetched from the memory(also known as the memory buffer register or data buffer)
Accumulator - An internal CPU register used as the default location to store any calculations performed by the ALU.
*NOT LISTED IN SPEC* Instruction Register - Holds the instruction currently being executed.
REGISTER DURING THE FETCH-DECODE-EXECUTE CYCLE:
FETCH STAGE:
During the first phase of the cycle, an instruction/data is fetched from the main memory and brought into the CPU.
The PC value is copied into the MAR.
Once the MAR is loaded, the control unit loads the address onto the address bus.
The CU also sends a signal to the main memory to read the instructions contained at that address.
The instruction is passed across the data bus and copied into the MDR.
The instruction in the MDR is copied onto the instruction register.
The PC is incremented by one location ready to begin the next fetch cycle.
DECODE STAGE:
At the start of the decode stage, the CU reads the instruction register and makes sure that it is a valid instruction that the CPU can carry out.
If the instruction is contained in the CPU’s ‘instruction set‘, then the parts of the CPU are prepared for the execute stage.
EXECUTE STAGE:
The third part of the cycle begins.
In the final stage, the instruction is executed.
The Accumulator will contain the result of the processed instruction.
The PC is made ready with the location of the next instruction.
The 'execute‘ phase of the cycle ends. Now the whole cycle starts again at the beginning.
CPU Performance:
3 common characteristics:
Cache size
CPU clock size
Number of processor cores
CACHE MEMORY:
The cache is an extremely fast type of RAM located inside the CPU chip.
It acts as a buffer between the registers and the main memory.
The basic purpose of cache memory is to store program instructions that are frequently re-referenced by software during operation.
CLOCK SPEED:
The clock is a tiny quartz crystal inside the CPU chip which ticks at a steady speed.
During each tick of the clock, a single instruction can be processed.
Processor speed is measured in Gigahertz.
Giga = billion
Hertz = times per second
A dual core processor will process double the instructions per second.
Quad core processor 4 times the instructions.
OVERCLOCKING:
It is possible to increase the clock speed which is known as overclocking.
If the CPU can perform more calculations and perform faster, it will get hotter and is dangerous without the appropriate heat management.
NUMBER OF CORES:
A processing unit within the CPU is known as a core. Each core is capable of fetching, decoding and executing its own instructions.
The more cores a CPU has, the greater the number of instructions.
Modern CPU's are dual or quad core processors. This provides vastly superior processing power.
ARE CPU CORES ALWAYS BETTER?
Not necessarily
Software needs to be optimised to take advantage of multiple cores.
Other factors like clock speed also impact performance.
EMBEDDED SYSTEMS:
A computer system made up of hardware and software which is known as firmware.
Used for very specialised tasks.
Doesn’t usually contain an OPERATING SYSTEM.
EXAMPLES ARE:
Central Heating systems
dishwashers
televisions
mobile phones
digital watches
electronic calculators
GPS systems
fitness trackers
videogame consoles
digital cameras
house thermostats
digital alarm clocks
washing machines
MP3 players
air conditioners
microwaves
ovens
refrigerators
fire alarms
kettles
toasters
prints
vacuum cleaners
Wi-Fi routers.
ADVANTAGES AND DISADVANTAGES:
Cheaper to design
Cheaper to build
Require less power
Runs from batteries
Don’t need much processing power
Can be built using cheaper and less powerful processors