What is a CPU?

A CPU (Central Processing Unit) is the electronic circuitry within a computer that carries out the instructions of a computer program by performing the basic arithmetic, logic, controlling, and input/output (I/O) operations specified by the instructions

There are several components to the CPU. These include:

  • Control Unit – Controls the flow of data in the CPU
  • Memory Unit – Stores data
  • Buses – Wires connecting the components which enable the transfer of data, address details and control signals
  • Arithmetic Logic Unit – Does any arithmetic(add/subtract/multiply/divide) and Logic(comparing values) operations
  • Registers

Computers need to take an input, process it and then output a result. From this we know there are 4 main stages or parts :

  • Input
  • Process
  • Storage
  • Output

This is done using the fetch execute cycle.

What is the fetch-execute cycle?

The computer will fetch an instruction from memory

It will then decode it

Finally it will execute it

What are the components of a CPU?

There are 8 key components of a CPU

  1. Program counter
  2. Memory address Register
  3. Memory Data Register
  4. Current Instruction Register
  5. Arithmetic Logic Unit
  6. Accumulator
  7. Control Unit
  8. Interrupt Register

There are 3 buses

  1. Control Bus
  2. Data Bus
  3. Address Bus

How does the CPU work?

  1. The Program Counter fetches the address of the next instruction to be processed.
  2. This is passed to the memory address register to hold
  3. The memory address register will pass this on the address bus to primary memory(usually RAM)
  4. Primary memory will look for the address and collect the contents. This will be data or an instruction
  5. This will be put on the data bus to the memory data register to hold
  6. If it is data it is passed to the arithmetic logic unit to have operations applied -> Results are stored in the accumulator
  7. If it is an instruction it is passed to the current instruction register -> passed to the decode unit to be decoded

Note: The control unit controls the flow of data

Scroll to Top