KT

Microprocessors and Datapath Concepts

Processor Components

  • Assembly Language Processors:
    • Finite State Machines (FSM)
    • Arithmetic Logic Units (ALU)
    • Devices: Flip-flops, Circuits, Gates, Transistors

Microprocessors

  • Definition: A digital device that processes input, stores values, and produces output based on internal instructions.
  • Components in Design:
    • Adders, Counters, Registers

Datapath and Control Unit

  • Datapath:
    • All data computations occur here, represented by diagrams of physical connections.
  • Control Unit:
    • Orchestrates actions in the datapath; it is a finite state machine managing various tasks.

Example Datapath Components

  • Registers: Fundaments for storing data
  • ALU: Executes arithmetic operations and contains output signals (overflow, carry, negative, zero indicators).
  • Control Signals: Direct how data flows between components (e.g., Load Reg, ALU operations).

Calculation Example: x² + 2x

  • Process:
    1. Load X into RA & RB
    2. Multiply RA by RB (store in RA)
    3. Add X to RA (store results)
    4. Repeat to get final output

Control Unit Functions

  • Acts as a FSM:
    • Responds to clock signals
    • Sends control signals to datapath
    • Determines when to execute operations

Microprocessor Components Overview

  • Arithmetic Unit (ALU)
  • Storage Unit: Register files and main memory.
  • Controller Unit: Direct operation of the microprocessor.

ALU Details

  • Performs:
    • Arithmetic operations (addition, subtraction)
    • Logical operations (AND, OR, NOT)
  • Inputs: Include select bits and carry bits for operations.
  • Outputs: Indicators such as overflow (V), carry (C), negative (N), and zero (Z).

Memory and Registers

  • Registers: Quick storage for immediate data manipulation.
  • Main Memory: Larger storage for ongoing data.
  • Analogy:
    • Registers as a desk of books (quick access)
    • Memory as a library (slower access, larger capacity)

Register File Operations

  • Reading/Writing:
    • Utilizes multiplexers for input and output selection based on addresses.
    • Write signal activates specified registers using a one-hot decoder.

Differences Between Memory and Registers

  • Usage:
    • Registers for immediate operations
    • Memory for larger data sets
  • Access Speed:
    • Registers: Immediate
    • Memory: Longer delays due to distance from the processor

Control Unit Signals in Action

  • Control signals manage operations such as:
    • Write and read operations to/from memory
    • Selecting data sources and ALU operations

Instruction Execution Flow

  1. Fetch:
    • Retrieve instruction from memory.
  2. Decode:
    • Determine the actions based on instruction type.
  3. Execute:
    • Perform computations or memory access operations.
  4. Advance:
    • Move to the next instruction based on PC update.

Program Counter (PC)

  • Tracks memory address of current instruction. Updates typically by incrementing by 4 (word-aligned).

Instruction Set Architecture (ISA)

  • Defines how instructions are laid out in bits (32-bit for MIPS architecture).
  • Instruction types include:
    • R-type: Operates on registers.
    • I-type: Contains immediate values.
    • J-type: Jump instructions.

Summary of Control Unit Signals for Operations

  • Examples for an addi instruction include:
    • Setting PC, memory read/write, and ALU operations.

Final Note on Machine Code

  • Instructions in machine code are binary sequences guiding processor operations. They can be created via compilation from higher-level languages.

Reflection Questions

  • If creating a low-level language, consider operations, naming conventions, and the instruction format.