3.2 Computer Function

COS2621 - Computer Organisation · 3. A Top- Level View of Computer Function and Interconnection

Computer Function

Basic Concepts

The function of a computer can be understood as the processes it performs to execute instructions. A computer takes input, processes it, stores data, and produces output. The main components involved in these functions include the Central Processing Unit (CPU), memory, and input/output (I/O) devices.

The Central Processing Unit (CPU)

The CPU is the brain of the computer. It executes instructions from programs by performing basic arithmetic, logic, control, and input/output operations specified by the instructions. The CPU consists of:

  • Arithmetic Logic Unit (ALU): Performs arithmetic and logical operations.
  • Control Unit (CU): Directs the operation of the processor and coordinates the activities of all other computer components.
  • Registers: Small, fast storage locations within the CPU used to hold data temporarily during processing.

Memory

Memory is where data and instructions are stored. There are two main types of memory:

  • Primary Memory: Also known as RAM (Random Access Memory), it is volatile and holds data temporarily while the computer is on.
  • Secondary Memory: Non-volatile storage like hard drives and SSDs, which retain data even when the computer is off.

Input/Output Devices

Input devices allow users to enter data into the computer, such as keyboards and mice. Output devices present data to users, such as monitors and printers. The interaction between these devices and the CPU is crucial for the computer's functionality.

Example of Computer Function

Consider a simple example of adding two numbers using a computer:

  1. The user inputs two numbers via the keyboard (input).
  2. The CPU retrieves the numbers from memory.
  3. The ALU performs the addition operation.
  4. The result is stored back in memory.
  5. The result is displayed on the monitor (output).

Registers and Segments

Registers are critical for the CPU's operation. The code segment register holds the base location of all executable instructions in a program. This means that the CPU can quickly access the instructions it needs to execute. A segment may be located anywhere in memory provided it starts on a paragraph boundary. This flexibility allows efficient use of memory space.

Watch out: Students often confuse the roles of different CPU components. Remember, the ALU performs calculations, while the CU manages the operations of the CPU.

Conclusion

Understanding the basic functions of a computer is essential for studying computer architecture. The CPU, memory, and I/O devices work together to perform complex tasks efficiently.

Check your understanding

  • What is the role of the Arithmetic Logic Unit (ALU)?
  • How does primary memory differ from secondary memory?
  • Give an example of an input and an output device.
  • Describe the process a computer follows to add two numbers.

Test yourself

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

  1. 1. Which of the following is an example of an output device?

  2. 2. A segment may be located ______________ in the memory provided it starts on a paragraph boundary.

  3. 3. The __________ register holds the base location of all executable instructions (code) in a program.

  4. 4. What is the primary function of the Arithmetic Logic Unit (ALU) in a computer?

  5. 5. What is the role of the Control Unit (CU) in a CPU?