Computer Architecture: RISC, Pipelining, and Parallelism

RISC: Reduced Instruction Set Computer

RISC is a processor design philosophy that emphasizes simple instructions, a uniform instruction format, and faster execution using pipelining.

Key Characteristics

  • Small, simple instruction set
  • Fixed-length instructions
  • Load/store architecture
  • Most instructions execute in 1 clock cycle
  • Large number of registers
  • Optimized for pipelining

Examples: ARM, SPARC, MIPS, PowerPC

MIPS Architecture

MIPS (Microprocessor without Interlocked Pipeline Stages) is a specific RISC architecture developed by Stanford University, widely used for teaching and research.

Key Features

  • 32-bit RISC architecture
  • 32 general-purpose registers
  • Simple instruction formats (R, I, J)
  • No complex addressing modes
  • Designed for efficient pipelining
BasisRISCMIPS
TypeDesign philosophySpecific processor architecture
Instruction setReducedReduced (RISC-based)
RegistersMany registers32 registers
Addressing modesFewVery few
UsageGeneral conceptPractical implementation
ExampleARM, SPARCMIPS32, MIPS64

Control Units

Microprogrammed Control Unit

Uses microinstructions stored in control memory to generate control signals.

  • Characteristics: Control signals from microprograms, easier to modify, slower operation, requires control memory (ROM).
  • Advantages: Flexible, easy debugging, simple design.
  • Disadvantages: Slower than hardwired, extra memory required.

Hardwired Control Unit

Control signals are generated using fixed logic circuits (gates, flip-flops).

  • Characteristics: No control memory, faster execution, complex design.
  • Advantages: High speed, efficient performance.
  • Disadvantages: Difficult to modify, complex implementation.

Performance Metrics

BasisMIPSMFLOPS
MeasuresInstruction rateFloating-point operations
Instruction typeAny instructionOnly floating-point
AccuracyLess reliableMore reliable
UsageGeneral performanceScientific computation

Pipeline Hazards

1. Data Hazards

Occurs when an instruction depends on the result of a previous instruction that has not yet completed.

  • Types: RAW (Read After Write), WAR (Write After Read), WAW (Write After Write).
  • Effects: Incorrect data used, pipeline stalls (bubbles), reduced performance.
  • Solutions: Forwarding/Bypassing, pipeline stall (NOP), instruction reordering, register renaming.

2. Control Hazards (Branch Hazards)

Occurs due to branch or jump instructions when the next instruction to execute is unknown.

  • Effects: Wrong instructions fetched, pipeline flush, performance loss.
  • Solutions: Stalling, branch prediction (static/dynamic), delayed branching, speculative execution.

3. Structural Hazards

Occurs when hardware resources are insufficient for concurrent pipeline operations.

  • Effects: Pipeline stall, reduced throughput.
  • Solutions: Duplicate hardware, multi-port memory, resource scheduling.

Advanced Processor Architectures

VLIW (Very Long Instruction Word)

Executes multiple operations using a single long instruction word containing several independent instructions.

  • Advantages: Simple hardware, high parallelism, low power consumption.
  • Disadvantages: Large code size, complex compiler, binary compatibility issues.

Superscalar Processor

Can issue multiple instructions per clock cycle using multiple execution units.

  • Advantages: High throughput, better CPU utilization, exploits ILP dynamically.
  • Disadvantages: Complex hardware, dependency checking required, high power consumption.

Superpipelining

Divides pipeline stages into smaller stages, increasing pipeline depth and clock frequency.

  • Advantages: Higher clock speed, better throughput.
  • Disadvantages: Pipeline hazards increase, branch penalty larger.

Flynn’s Classification

  • SISD: Single Instruction Single Data (Sequential execution).
  • SIMD: Single Instruction Multiple Data (Data-level parallelism, e.g., GPUs).
  • MISD: Multiple Instruction Single Data (Rare/theoretical).
  • MIMD: Multiple Instruction Multiple Data (Most common, e.g., Multicore).

Shared Memory Architecture

A multiprocessor system where multiple processors share a single main memory through a common bus.

  • Key Features: Single global memory, uniform memory access (UMA), cache coherence protocols.
  • Advantages: Simple to design, easy data sharing, faster communication.
  • Disadvantages: Bus contention, memory bottleneck, limited scalability.

Interconnection Networks

Omega Network

Multistage network using log₂N stages and 2×2 switching elements with perfect shuffle connections.

Baseline Network

Similar to Omega but uses a baseline permutation instead of shuffle.

Butterfly Network

Multistage network where paths resemble a butterfly structure; often used in FFT algorithms.

Crossbar Network

Fully connected switching network allowing every input to connect directly to every output.

Addressing Modes

  1. Register: Operand is in a CPU register.
  2. Register Indirect: Register contains the memory address of the operand.
  3. Relative: Effective address = PC + displacement.
  4. Immediate: Operand value is inside the instruction.
  5. Direct: Instruction contains the actual memory address.

Parallel Processors

  • Array Processor: Multiple processing elements performing the same operation on different data (SIMD).
  • Vector Processor: Operates on entire vectors using single vector instructions.

Instruction Level Parallelism (ILP)

Executing multiple instructions simultaneously by exploiting independence between instructions. Techniques include pipelining, superscalar execution, and out-of-order execution.