💻

[Lecture 7] Fundamentals of Computer Architecture

Apr 9, 2025

Lecture Notes: Computer Architecture and Instruction Execution

Introduction

  • Lecture focuses on computer architecture, specifically on the von Neumann model.
  • Discussion on computing models, instruction set architectures (ISA), and logic levels.
  • Introduction to digital design and high-level abstraction in computing.
  • The von Neumann architecture is a key focus, leading to discussions on different components of a computer system.

Key Concepts in Computer Architecture

Von Neumann Model

  • Components:
    • Memory: Stores both program and data.
    • Processing Unit: Executes operations.
    • Input and Output: Interfaces for external communication.
    • Control Unit: Manages the execution of instructions.
  • Characteristics:
    • Stored Program Concept: Both program and data stored in the same memory.
    • Sequential Instruction Processing: Instructions are executed sequentially.

Memory

  • Memory stores instructions and data in a linear manner.
  • Address Space & Addressability:
    • Address Space: Total number of unique addresses available.
    • Addressability: Defines the size of data that can be accessed with a single address.

Processing Unit

  • ALU (Arithmetic Logic Unit): Executes arithmetic and logic operations.
  • Registers: Fast temporary storage close to the ALU, used for quick data access and storage.

Control Unit

  • Orchestrates the step-by-step execution of instructions.
  • Program Counter (PC): Keeps track of the address of the current or next instruction.
  • Instruction Register (IR): Holds the bits of the current instruction being executed.

Instruction Execution

Instruction Cycle

  • Phases of Instruction Execution:
    • Fetch: Retrieve the instruction from memory.
    • Decode: Determine what the instruction means and prepare for execution.
    • Evaluate Address: Calculate the memory address if needed.
    • Fetch Operand: Retrieve any necessary operands for the instruction.
    • Execute: Perform the operation specified by the instruction.
    • Store Result: Write the result of the operation back to the destination.

Types of Instructions

  • Operate Instructions: Perform operations in the ALU.
  • Data Movement Instructions: Load data from memory or store data to memory.
  • Control Flow Instructions: Change the sequence of execution (e.g., branches/jumps).

Instruction Formats

  • LC3 ISA: 16-bit instructions with different fields for opcodes and operands.
  • MIPS ISA: Different instruction formats (R-type, I-type, J-type) with specific fields for operation and operands.

Examples and Encoding

  • Instruction Encoding:
    • Specific bit patterns define different operations and operand specifications.
    • Example discussed: ADD and LOAD instructions in LC3 and MIPS.

Addressing Modes

  • Base + Offset: Calculate address using a base register and an offset (immediate value).
  • Immediate: Operands are specified directly within the instruction.

Practical Aspects

  • Registers and Memory Usage: How these elements are used in executing instructions efficiently.
  • Control Logic and State Machines: Finite state machines orchestrate the execution cycle by generating control signals.
  • Hardware Implementation and Instruction Cycle: Example microarchitecture (LC3B) showing practical implementation.

Conclusion

  • Understanding of the von Neumann architecture and instruction execution is foundational.
  • Application in designing computer systems, writing efficient programs, and understanding ISA specifications.

Additional Notes

  • Different ISAs (e.g., LC3, MIPS) provide varying capabilities and design choices.
  • Importance of sequential logic, multiplexers, and decoders in instruction processing.
  • Exploration of operate instructions, data movement, and control flow in future lectures.