Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Computer Architecture

Central processing unit (CPU)

  • The CPU is the core of any computer system. It is responsible for the execution or processing of all the instructions and data in a computer.
    • It is constructed as an integrated circuit on a single silicon microchip.
  • The CPU consists of the:
    • control unit (CU)
    • arithmetic and logic unit (ALU)
    • registers
    • buses.

Microprocessors

  • A microprocessor is a type of integrated circuit on a single chip.

Von Neumann architecture

  • This architecture introduced the concept of the “stored program computer”, which remains the foundation of modern computer design.

Features

  • A CPU or processor.
  • CPU can access memory directly.
  • Computer memory stores both programs and data together.
  • Stored programs consist of instructions executed in a sequential order.

Components of CPU

Arithmetic and logic unit (ALU)

  • Purpose: Performs arithmetic (e.g. +, -, x) and logical (e.g. AND, OR, NOT) operations while a program is running.
  • Multi-ALU systems: A computer can contain more than one ALU to process multiple tasks simultaneously.
  • Basic operations: Complex operations like multiplication and division are broken down into sequences of addition, subtraction, and left/right logical shift operations.

Control unit (CU)

  • Purpose: Manages the execution of instructions. It reads an instruction from memory using the address stored in the Program Counter (PC).
  • Functionality: It decodes and interprets instructions using the Fetch-Decode-Execute cycle.
  • Synchronization: It generates timing and control signals along the control bus to direct the flow of data and ensure everything happens in perfect sync.

System clock

  • Purpose: Generates continuous electrical timing signals (or pulses) to sync all internal computer operations.
  • Impact: Without the clock, components would become unsynchronized, which creats unstability.

Immediate access store (IAS) or RAM

  • Purpose: Holds all data and programs currently needed by CPU.
  • Why: Reading and writing data to and from RAM is significantly faster than accessing backing storage (e.g. HDD or SSD). Data is moved from backing storage to RAM temporarily while in use.

CPU Registers

  • Registers are temporary components in the CPU which can be general or specific in its use; it holds data or instructions as part of the Fetch-Decode-Execute cycle.
RegisterAbbreviationFunction
Program CounterPCStores the memory address where the next instruction to be read can be found.
Memory address registerMARStores the memory address of the location currently being read from or written to.
Memory data registerMDRStores the data that has just been read from memory, or data that is about to be written to memory.
Current instruction registerCIRStores the current instruction while it is being decoded and executed.
AccumulatorACCStores data temporarily while ALU calculations are being carried out.

Memory read and write operations

  • Computer memory is divided into distinct slots. Each partition consists of a unique address and its specific contents.

READ operation

  • We will use the binary data, 1111 0001 as an example.
  1. The target address (1111 0001) is written into the Memory Address Register (MAR).
  2. A read signal is sent across the control bus to the computer memory.
  3. The contents stored at that address are copied to the Memory Data Register (MDR).

WRITE operation

  • We will use the binary data, 1001 0101 as the specific value to be written into 1111 1101 as the target address.
  1. The data to be stored (1001 0101) is loaded into the MDR.
  2. The destination address (1111 1101) is loaded into the MAR.
  3. A write signal is sent across the control us, copying the value from the MDR into the specified memory slot.

System buses

1. Address bus

  • Data flows strictly in one direction: from CPU to memory or I/O components. This prevents memory addresses from being sent back to the CPU.
  • Function: Carries memory addresses throughout the system to pinpoint where data needs to be read or written.
  • The bus width determines the maximum number of memory locations the CPU can directly address.

2. Data bus

  • Carries data in both directions between the CPU, memory, and I/O devices.
  • Function: Transmits the actual data, instructions, or numerical values being processed.
  • The bus width determines the system’s word length (commonly 16-bit, 32-bit, or 64-bit). A wider data bus increases overall system performance.

3. Control bus

  • Carries signals between CU and other internal components.
  • Function: Transmits command, timing, and status signals (e.g. read/write signals or clock pulses) to sync system activities. Usually 8 bits wide.

Fetch-decode-execute cycle

  • The basic operational process of a computer system involves continuously fetching, decoding, and executing instructions.

Fetch

  • The address of the next instruction is copied from the PC into the MAR via the address bus.
  • The instruction stored at that memory address is copied into the MDR via the data bus.
  • The instruction in the MDR is then copied into the Current Instruction Register (CIR) so it can be handled.
  • The PC is incremented by 1, pointing to the address of the next sequential instruction.

Decode

  • The instruction currently inside the CIR is decoded and interpreted by the CU to figure out what actions need to be taken.

Execute

  • The CPU executes the decoded instruction by sending control signals along the control bus to the relevant hardware components.

Factors determining CPU performance

Clock speed

  • Measured in gigahertz (GHz), where 1 GHz representts 1 billion clock cycles per second. A higher clock speed allows more instructions to be processed per second.
  • Overclocking is altering BIOS settings to run a CPU faster than its certified speed.
    • Risk 1: Unsynchronized instructions occur when components cannot keep up with the forced clock speed, leading to system unstability.
    • Risk 2: Serious overheating which can permanently damage hardware.

Cache memory

  • A small block of high-speed memory built directtly into the CPU chip.
  • Function: Features faster access times than standard RAM. Temporarily stores the most frequently used instructions and data.
  • Impact: A larger cache size increases hit rates, reducing the time the CPU spends waiting for data from RAM, thereby boosting speed.

Number of cores

  • A “core” is an independent processing unit containing its own ALU, CU, and registers. Dual-core systems contain 2 cores; quad-core systems contain 4 cores.
  • Doubling the number of cores does not automatically double performance. This is because multiple cores must communicate with on eanother to coordinate tasks, causing software overhead.
    • A dual-core CPU uses 1 channel to communicate between its 2 cores.
    • A quad-core CPU requires 6 channels to link its 4 cores together, which reduces the potential performance gains per core.

Bus width

  • Increasing the width of the data bus increases word length, allowing more data to travel simultaneously. Increasing the bus width allows the CPU to access a larger pool of physical memory addresses.

Instruction sets

  • An instruction set is a limited collection of low-level commands that a specific CPU design can understand and decode. Every instruction is split into two parts:
    • Instruction = Opcode + Operand
  • Opcode (operation code): Specifies the exact operation the CPU needs to perform.
  • Operand: The actual data to be acted upon, or the specific memory/register address where the data is located.

Embedded systems

  • An embedded system is a dedicated combination of hardware and software designed to carry out a specific, narrow range of pre-defined functions. They are built into larger mechanical or electrical devices (e.g. motor vehicles, washing machines, cameras).