Main Page About Template

Structure and function of the processor

Layout of a CPU

A CPU consists of an arithmetic logic unit (ALU), which completes arithmetic and logical operations, a control unit (CU), which decodes instructions and coordinates the activities of the CPU, as well as several registers and buses.

Instructions

Each instruction can be split into two parts. The opcode and the operand. The opcode contains the operation — for example, fetch or add, and the operand contains the data to be operated on.

The addressing mode section defines how the data bus retrieves the instruction if necessary. There are four main types of addressing modes.

Fetch Decode Execute Cycle (FDE cycle)

The FDE cycle is a sequence of operations to execute an instruction.

  1. Address from the PC is copied to the MAR (by the address bus)
  2. The data at the address is fetched and stored in the MDR (by the data bus)
  3. Simultaneously, the PC is incremented by 1
  4. The data in the MDR is copied to the CIR (by the data bus)
  1. The contents of the CIR are split into the operand and opcode
  2. The opcode is sent to the CU (by the data bus) and is decoded
  1. The CU directs the execution of the opcode e.g., signals the ALU to perform a logic operation

Factors affecting the performance of a CPU

When it comes to clock speed, the faster, the better. However, more cores and higher cache size are not always better for performance. Some programs only work on a single core, so the other cores aren't used. The number of cores affecting the performance of a CPU depends on which program is running and how the program is coded. The size of the cache is limited by the amount of space is a CPU. The larger the CPU, the further the cache is from key components, which slows down retrieval.

Pipelining

In the FDE cycle, while one instruction is being executed, another can be fetched and another can be decoded meaning three instructions are on the FDE cycle at the same time. This reduces idle time in the CPU; however, it can lead to errors — for example, the instruction being executed changes a value in memory after it has been fetched.

Different Architectures

Von Neumann architecture

Harvard architecture

Contemporary processing