Computer Architecture

3.1 Computer Architecture

3.1.1 The Central Processing Unit (CPU)

The central processing unit (CPU), also known as a microprocessor or processor, is central to all modern computer systems, including tablets and smartphones. Typically, the CPU is installed as an integrated circuit on a single microchip. It is responsible for executing all instructions and processing data in computer applications. The CPU consists of:

  • Control Unit (CU): Orchestrates operations by managing the flow of data between the CPU and other components.

  • Arithmetic and Logic Unit (ALU): Performs all arithmetic calculations and logical operations.

  • Registers: Small, fast storage locations for holding data temporarily during processing.

  • Buses: Communication pathways that connect different components within the computer.

3.1.2 Von Neumann Architecture

In the mid-1940s, John von Neumann developed the concept of the ‘stored program computer,’ establishing the basis for modern computer architecture. The main features include:

  • Concept of a CPU: The CPU functions as the brain of the computer.

  • Direct Memory Access by the CPU: The CPU communicates directly with RAM to read and write data.

  • Capability to Store Programs and Data in Memory: Programs are stored in the same memory as data, facilitating ease of access.

  • Sequential Instruction Execution: Instructions can be executed in a pre-defined sequence, reducing the need for human input.

Diagram Representation

Diagrams illustrate von Neumann CPU architecture, typically showcasing how the CPU interacts with memory and input/output devices.

3.1.3 Components of the CPU

A. Arithmetic and Logic Unit (ALU)

  • Functionality: Performs arithmetic operations (addition, subtraction) and logic operations (AND, OR, NOT).

  • Multiple ALUs: Advanced CPUs may contain several ALUs to improve performance.

B. Control Unit (CU)

  • Functionality: Coordinates and manages all activities of the CPU and other components. It also interprets instructions via the Fetch–Decode–Execute cycle.

  • Fetch–Decode–Execute Cycle: The mechanism by which the CPU retrieves an instruction from memory, decodes it to understand what needs to be done, and executes the operation.

C. Registers

Registers are crucial components; specific-purpose registers include:

Register

Abbreviation

Function

Current Instruction Register

CIR

Stores current instruction being executed.

Accumulator

ACC

Temporarily stores data during calculations.

Memory Address Register

MAR

Stores address of memory location being accessed.

Memory Data Register

MDR

Stores recently read or to-be-written data.

Program Counter

PC

Stores address of the next instruction.

3.1.4 System Buses and Memory

  • Address Bus: Unidirectional; carries addresses from CPU to memory, preventing unwanted feedback to the CPU.

  • Data Bus: Bidirectional; allows data to flow in both directions between the CPU, memory, and peripheral devices.

  • Control Bus: Carries control signals from CU to the other components, ensuring operations occur in sync.

Memory Operations

  • Read Operation Example: The CPU reads data from memory and follows these steps:

    1. MAR stores the address of the memory location to be read.

    2. A read signal is sent to the memory.

    3. The data is placed in MDR.

  • Write Operation Example: The CPU writes data to memory:

    1. Data to be stored is located in the MDR.

    2. MAR stores the address to which the data will be written.

    3. A write signal is sent to the memory to complete the operation.

3.1.5 Fetch–Decode–Execute Cycle

  1. Fetch: The CPU fetches the next instruction using the PC and stores it in the MAR, then the MDR.

  2. Decode: The instruction is analyzed to determine what operation needs to be carried out.

  3. Execute: Control signals are sent out to other components to perform the operation indicated by the decoded instruction.

3.1.6 Performance Factors

Factors affecting CPU performance include:

  1. Clock Speed: Measured in GHz, higher speeds can lead to faster processing but can also introduce instability if exceeded.

  2. Bus Width: Wider buses allow for multiple memory locations to be accessed simultaneously, significantly impacting speed.

  3. Cache Memory: This is a smaller, faster type of volatile memory located on the CPU that stores instances of frequently used data and instructions to speed up processing.

  4. Cores: Multiple cores can process tasks simultaneously. Dual-core and quad-core CPUs provide better performance for multitasking  and complex applications but can suffer from communication bottlenecks.

3.1.7 Instruction Set

Instructions consist of operations configured as an opcode (operation code) and an operand (data or address). The instruction set is the limited number of opcodes recognized by the CPU, such as X86 in Intel and AMD processors.

3.1.8 Embedded Systems

Embedded systems are specially designed hardware/software units performing specific tasks, typically within a larger system. They may be based on:

  • Microcontrollers: Integrate a CPU, memory, and peripherals on one chip, ideal for simple tasks.

  • Microprocessors: Contain only a CPU, requiring additional components for functionality.

  • System on Chips (SoC): Include all hardware components on a single chip, combining high performance with reduced physical space.

Examples of Embedded Systems

  • Motor Vehicles: Control multiple functions such as engine management, passenger safety, and in-car entertainment systems.

  • Home Appliances: Washing machines, microwaves, and refrigerators, controlled by embedded systems to optimize efficiency and functionality.

Benefits and Drawbacks

Benefits

Drawbacks

Small size, low cost, dedicated to specific tasks.

Difficult to upgrade or troubleshoot individual units.

Low power consumption, fast response times.

Vulnerable to security risks if internet-connected.

Automation leads to increased efficiency and performance.

Replacement often necessary if the system becomes outdated.

Real-World Applications

  • Set-top Boxes: Allow for recording and monitoring of television programming remotely.

  • Lighting Systems: Intelligent control based on occupancy, natural lighting conditions, and user settings.

  • Vending Machines: Automated systems for dispensing products and monitoring inventory, enhancing user experience and operational efficiency.