Basic Computer Architecture
COS2621 - Computer Organisation · Introduction to Computer Organisation
Basic Computer Architecture
Computer architecture refers to the design and organisation of a computer's components and the way they interact. It is essential to understand how the different parts of a computer work together to perform tasks. This topic covers the main components of computer architecture, including the central processing unit (CPU), memory, and input/output (I/O) devices.
Central Processing Unit (CPU)
The CPU is often referred to as the brain of the computer. It performs calculations and executes instructions. The CPU consists of several key components:
- Arithmetic Logic Unit (ALU): This part performs all arithmetic (addition, subtraction, etc.) and logical operations (comparisons, AND, OR, etc.).
- Control Unit (CU): This unit directs the operation of the processor. It sends signals to other components of the computer to execute instructions.
- Registers: These are small, fast storage locations within the CPU that hold data and instructions temporarily.
Remember: The CPU is the main component that executes instructions and processes data.
Memory
Memory in a computer is used to store data and instructions temporarily or permanently. There are two main types of memory:
- Primary Memory (RAM): Random Access Memory (RAM) is volatile memory, meaning it loses its contents when the power is turned off. RAM stores data currently in use and instructions that the CPU needs to access quickly.
- Secondary Memory: This type of memory is non-volatile and retains data even when the computer is turned off. Examples include hard drives, solid-state drives (SSDs), and USB flash drives.
Tip: Remember that RAM is fast but temporary, while secondary memory is slower but permanent.
Input/Output Devices
Input and output devices allow users to interact with the computer. Input devices send data to the computer, while output devices receive data from the computer. Common examples include:
- Input Devices: Keyboard, mouse, scanner, and microphone.
- Output Devices: Monitor, printer, and speakers.
Watch out: Be careful not to confuse input and output devices. Input devices send data to the computer, while output devices present data to the user.
System Bus
The system bus is a communication pathway that connects the CPU, memory, and I/O devices. It consists of three main types of buses:
- Data Bus: This bus carries the actual data being transferred between components.
- Address Bus: This bus carries the addresses of the data so that the CPU knows where to read or write data.
- Control Bus: This bus carries control signals from the CPU to other components, managing the operations of the computer.
Basic Operation of a Computer
The operation of a computer can be described in a series of steps known as the fetch-decode-execute cycle:
- Fetch: The CPU fetches an instruction from memory using the address bus.
- Decode: The CPU decodes the instruction to determine what action is required.
- Execute: The CPU executes the instruction, which may involve performing calculations using the ALU or reading/writing data to memory.
Remember: The fetch-decode-execute cycle is the fundamental process that allows a computer to perform tasks.
Example: Fetch-Decode-Execute Cycle
Let’s look at a simple example of the fetch-decode-execute cycle in action:
Assume the CPU needs to add two numbers stored in memory locations 1000 and 1001.
- Fetch: The CPU fetches the instruction from memory location 1000.
- Decode: The CPU decodes the instruction, which tells it to add the contents of memory locations 1000 and 1001.
- Execute: The CPU performs the addition using the ALU and stores the result in a register or memory.
Memory Hierarchy
Understanding memory hierarchy is important for optimising computer performance. The memory hierarchy is structured as follows:
- Registers: Fastest access time, located within the CPU.
- Cache Memory: Small, high-speed memory located close to the CPU. It stores frequently accessed data to speed up processing.
- Main Memory (RAM): Slower than cache, but larger in size.
- Secondary Storage: Slowest access time, includes hard drives and SSDs.
Tip: The closer the memory is to the CPU, the faster it is, but it is also more expensive.
Computer Organisation Models
Different models of computer organisation exist, but the most common are:
- Von Neumann Architecture: This model uses a single memory for both data and instructions. It follows the fetch-decode-execute cycle.
- Harvard Architecture: This model has separate memory for data and instructions, allowing simultaneous access, which can improve performance.
Watch out: Be aware of the differences between Von Neumann and Harvard architectures, especially in terms of memory usage.
Summary
- The CPU is the main part of a computer that executes instructions.
- Memory is divided into primary (RAM) and secondary storage.
- Input and output devices allow user interaction with the computer.
- The system bus connects the CPU, memory, and I/O devices.
- The fetch-decode-execute cycle is the fundamental operation of a computer.
Check your understanding
- What are the main components of the CPU?
- Explain the difference between primary and secondary memory.
- Describe the fetch-decode-execute cycle.
- What is the main difference between Von Neumann and Harvard architecture?