14.1 Processor Organization

COS2621 - Computer Organisation · 14. Processor Structure and Function

Processor Organization

Basic Structure of a Processor

A processor, or central processing unit (CPU), is the main component of a computer that performs calculations and executes instructions. It consists of several key components, including the arithmetic logic unit (ALU), control unit (CU), and registers. The ALU performs arithmetic and logical operations, while the CU directs the operation of the processor and coordinates the activities of the other components.

Arithmetic Logic Unit (ALU)

The ALU is responsible for executing all arithmetic operations, such as addition and subtraction, as well as logical operations like AND, OR, and NOT. For example, if you want to add two numbers, say 5 and 3, the ALU will take these inputs and perform the addition to produce an output of 8.

Control Unit (CU)

The control unit manages the execution of instructions by directing the flow of data between the CPU, memory, and input/output devices. It interprets the instructions from the program and signals the ALU and registers to perform the necessary operations. For instance, if an instruction requires data from memory, the CU will initiate a read operation from the memory unit.

Registers

Registers are small, fast storage locations within the CPU that temporarily hold data and instructions. They are used to store operands for operations and the results of those operations. Common registers include:

  • Accumulator (ACC): Stores the result of arithmetic and logical operations.
  • Instruction Register (IR): Holds the current instruction being executed.
  • Program Counter (PC): Contains the address of the next instruction to be executed.

Processor Architecture

Processor architecture refers to the design and organization of the different components of a processor. It can be classified into two main types:

  • Complex Instruction Set Computer (CISC): This architecture supports a large set of instructions, allowing complex operations to be executed in fewer lines of assembly code. An example is the x86 architecture.
  • Reduced Instruction Set Computer (RISC): This architecture uses a smaller set of simpler instructions, which can be executed more rapidly. ARM processors are a common example of RISC architecture.

Remember: The choice between CISC and RISC affects the efficiency and performance of the processor.

Example of Processor Operation

Consider a simple operation where the processor needs to add two numbers, 10 and 20. The steps are as follows:

  1. The instruction to add the numbers is fetched from memory and placed in the Instruction Register (IR).
  2. The Program Counter (PC) is updated to point to the next instruction.
  3. The ALU performs the addition of 10 and 20.
  4. The result, 30, is stored in the Accumulator (ACC).

Watch out: Ensure that the correct data types are used in operations to avoid errors.

Summary

  • A processor consists of the ALU, CU, and registers.
  • The ALU performs arithmetic and logical operations.
  • The CU directs operations and manages instruction flow.
  • Registers temporarily hold data and instructions.
  • Processor architecture can be CISC or RISC.

Check your understanding

  • What role does the Arithmetic Logic Unit (ALU) play in a processor?
  • Explain the difference between CISC and RISC architectures.
  • What is the function of the Program Counter (PC)?
  • Describe the process of adding two numbers in a processor.

Test yourself

4 quick questions on this lesson. Pick an answer to see if you're right.

  1. 1. In which architecture does the processor use a smaller set of simpler instructions?

  2. 2. What is the primary function of the Control Unit (CU) in a processor?

  3. 3. Which component of the processor is responsible for executing arithmetic and logical operations?

  4. 4. Which of the following registers holds the current instruction being executed?