Fetch, Decode, Execute Flashcards
Cache
Cache is a small amount of high-speed random access memory (RAM) built directly within the processor. It is used to temporarily hold data and instructions that the processor is likely to reuse. This allows for faster processing as the processor does not have to wait for the data and instructions to be fetched from the RAM.
Fast access memory.
Expensive and therefore contains little storage space.
Improves CPU performance as it provides instructions and data to the CPU at a much faster rate than any other memory in the system.
More cache = better performance.
Clock Speed
The CPU contains a clock which is used to coordinate all of the computer’s components. The clock sends out a regular electrical pulse which synchronises (keeps in time) all the components. The speed at which a processor operates is called the clock speed.
The faster the clock speed, the faster the computer is able to run the fetch-decode-execute cycle and therefore process more instructions.
The Speed of a processor is measured in Hertz (Hz). The higher the frequency, the more instructions can be performed in any given moment of time. A typical modern day home computer would have on average 2.5 GHz processor.
Buses
A bus is a high-speed internal connection. Buses are used to send control signals and data between the processor and other components.
Three types of bus are used:
Address bus - carries memory addresses from the processor to other components such as primary memory and input/output devices.
Data bus - carries the actual data between the processor and other components.
Control bus - carries control signals from the processor to other components. The control bus also carries the clock’s pulses.
Registers
Registers are small amounts of high-speed memory contained within the CPU. They are used by the processor to store small amounts of data that are needed during processing, such as:
the address of the next instruction to be executed
the current instruction being decoded
the results of calculations
Different processors have different numbers of registers for different purposes, but most have some, or all, of the following:
program counter
memory address register (MAR)
memory data register (MDR)
current instruction register (CIR)
accumulator (ACC)
Control Unit (CU)
The CU provides several functions:
it fetches, decodes and executes instructions
it issues control signals that control hardware
it moves data around the system
Arithmetic logic unit
The ALU has two main functions:
It performs arithmetic and logical operations (decisions). The ALU is where calculations are done and where decisions are made.
It acts as a gateway between primary memory and secondary storage . Data transferred between them passes through the ALU.
Cores
A processing unit within a 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 it can process in a given space of time. Many modern CPUs are dual (two) or quad (four) core processors. This provides vastly superior processing power compared to CPUs with a single core.
The fetch-execute cycle
The fetch-execute cycle (also known as fetch-decode-execute cycle) is followed by a processor to process an instruction. The cycle consists of several stages.
The memory address held in the program counter is copied into the MAR.
The address in the program counter is then incremented - increased - by one. The program counter now holds the address of the next instruction to be fetched.
The processor sends a signal along the address bus to the memory address held in the MAR.
The instruction/data held in that memory address is sent along the data bus to the MBR/MDR.
The instruction/data held in the MBR/MDR is copied into the CIR.
The instruction/data held in the CIR is decoded and then executed. Results of processing are stored in the ACC.
The cycle then returns to step one.
Von Neumann architecture elements
data and instructions are both stored as binary.
data and instructions are both stored in main memory.
instructions are fetched from memory one at a time and in order - serially.
the processor decodes and executes an instruction, before cycling around to fetch the next instruction.
the cycle continues until no more instructions are available.
A processor based on Von Neumann architecture has five special registers which it uses for processing:
Program counter (PC) - holds the memory address of the next instruction to be fetched from main memory.
Memory address register (MAR) - holds the address of the current instruction that is to be fetched from memory, or the address in memory to which data is to be transferred.
Memory buffer register (MBR) - holds the contents found at the address held in the MAR, or data which is to be transferred to main memory. It is also referred to as the memory data register (MDR).
Current instruction register (CIR) - holds the instruction that is currently being decoded and executed.
Accumulator (ACC) - holds the data being processed and the results of processing.
Prefix table
kilo k 10^3
mega M 10^6
giga G 10^9
tera T 10^12
Overclocking and underclocking
The clock speed inside the CPU can sometimes be changed. A processor can be set to run faster than its original design. By doing this however, it uses more energy and produces more heat. If this heat is not removed through cooling, the CPU can overheat, which will damage the CPU and shorten its lifespan. This is called overclocking.
Some computer systems, especially mobile devices, set the clock speed of the CPU lower than its original design. This results in less power consumption, less heat being produced and will therefore increase the battery life of the device. This is called underclocking. Some devices are able to change their own clock speed dynamically.
Reduced Instruction Set Computer (RISC)
RISC processors can process a limited number of relatively simple instructions. To carry out more complex commands the problem is broken down into a longer list of simpler instructions.
The advantage of this is that a RISC processor is able to process these simpler instructions quickly.
Processing simpler instructions also requires less circuitry to decode and execute these instructions, which in turn means less power consumption and therefore less heat being generated.
Complex Instruction Set Computer (CISC)
CISC processors can process a large number of complex instructions. This allows the processor to understand and carry out complex tasks with only a few instructions.
The advantage of this is that a CISC processor is able to process complex instructions, without having to break them down into many simpler instructions.
Processing complex instructions however requires more circuitry to decode and execute these instructions, which in turn means more power consumption and therefore more heat being generated.