Module 01: Functional Units & Performance Fundamentals
Tags: #◇Computer Science #◇CSARCH2 #◇Computer Architecture #◇Hardware Modeling #◇Functional Units & Performance Fundamentals
◇Overview
Processor performance is evaluated by analyzing how efficiently hardware executes a given workload. This module formalizes the core functional units comprising digital computer systems—the Arithmetic Logic Unit (ALU), Control Unit (CU), Register File, Memory, and Input/Output subsystems—and establishes the quantitative mathematical models governing CPU execution time, Cycles Per Instruction (CPI), Amdahl's Law, and system bus throughput. Mastering these performance formulas provides the analytical tools required to evaluate microarchitectural design trade-offs.
◇Key Definitions
- Arithmetic Logic Unit (ALU): The combinational and sequential execution engine that performs arithmetic operations (addition, subtraction, multiplication, division) and bitwise logical operations (AND, OR, XOR, shifts).
- Control Unit (CU): The digital state machine that orchestrates instruction execution by decoding opcodes and emitting timed control signals to the datapath and system buses.
- Clock Cycle Time (): The duration of one complete electrical clock oscillation period, measured in seconds (typically nanoseconds, , or picoseconds, ).
- Clock Frequency / Rate (): The number of clock oscillations per second, expressed in Hertz (), where .
- Cycles Per Instruction (CPI): The average number of clock cycles required by the processor to execute a single instruction across a given program workload.
- Million Instructions Per Second (MIPS): A raw processing rate metric defined as the number of instructions executed per second divided by .
- Amdahl's Law: A fundamental law of parallel computing stating that the maximum overall speedup achieved by optimizing a system component is bounded by the fraction of execution time that utilizes that enhanced component.
- System Bus: A shared parallel electrical communication highway consisting of an Address Bus, Data Bus, and Control Bus connecting the CPU, Memory, and I/O devices.
◇Theoretical Framework / Core Concepts
1. Functional Units of a Digital Computer
A classical digital computer is structured into five primary functional blocks:
+--------------------------------------------------------------------------+
| CENTRAL PROCESSING UNIT |
| |
| +--------------------+ Internal CPU Bus +-------------------+ |
| | Control Unit | <-----------------------> | Register File | |
| | (Sequencer / ROM) | | (PC, IR, GPRs) | |
| +--------------------+ +-------------------+ |
| | | |
| v v |
| +--------------------------------------------------------------------+ |
| | Arithmetic Logic Unit (ALU) | |
| +--------------------------------------------------------------------+ |
+--------------------------------------------------------------------------+
^ ^
| Address / Control Lines | Data Lines
v v
+--------------------------------------------------------------------------+
| SYSTEM BUS TOPOLOGY |
| - Address Bus (Unidirectional from CPU: defines memory location) |
| - Data Bus (Bidirectional: carries instructions and data operands) |
| - Control Bus (Bidirectional: Read, Write, Clock, Reset, Interrupts) |
+--------------------------------------------------------------------------+
^ ^
| |
v v
+--------------------+ +--------------------+
| Primary Memory | | Input / Output |
| (SRAM / DRAM) | | (Disk, NIC, Ports) |
+--------------------+ +--------------------+
- Input Unit: Transducers and peripheral controllers that digitize external data streams into binary words for storage.
- Memory Unit: High-speed storage hierarchy that holds active machine instructions and data buffers.
- ALU: High-speed functional hardware that executes arithmetic computations and boolean evaluations.
- Output Unit: Peripherals that convert binary output from memory into external human- or machine-readable signals.
- Control Unit: Master timing supervisor that fetches instructions sequentially from memory, interprets their operational fields, and gates data through internal registers.
2. The Fundamental CPU Performance Equation
CPU execution time for a program is the product of three interdependent variables:
Since :
Architectural Dependencies of the Performance Equation:
- Instruction Count (): Determined by the software algorithm, high-level language, and compiler optimization, as well as the Instruction Set Architecture (ISA).
- Cycles Per Instruction (): Determined by the microarchitecture design (e.g., pipelining, cache hit rates, ALU latency) and instruction mix.
- Clock Cycle Time () / Frequency (): Determined by semiconductor technology, critical path circuit delay in the ALU/datapath, and transistor layout.
3. Calculating Average CPI for Multi-Class Instruction Mixes
In real-world workloads, different classes of instructions require different numbers of clock cycles to complete:
where:
- is the instruction count of instruction class .
- is the clock cycle cost of instruction class .
- is the relative execution frequency of class .
4. MIPS and MFLOPS: Definitions and Limitations
-
MIPS (Million Instructions Per Second):
Pitfall: MIPS cannot be used to compare processors with different ISAs because a complex CISC instruction may perform the equivalent work of multiple simple RISC instructions. -
MFLOPS (Million Floating-Point Operations Per Second):
Measures floating-point execution intensity in scientific computing workloads.
5. Amdahl's Law for Speedup Analysis
When a specific hardware enhancement improves a fraction of the total execution time by a speedup factor of , the new execution time and overall speedup are:
As (infinite speedup on the enhanced portion), the theoretical maximum speedup is asymptotically bounded:
Amdahl's Law Speedup Ceiling:
Speedup S
^
10 | -------------- Limit: 1 / (1 - F)
| . - -'
5 | . - -'
| . - -'
2 | . - -'
1 |-----+-----|-----|-----|-----|-----|-----> Acceleration Factor k
0 2 4 8 16 32 64
6. System Bus Bandwidth and Timing Calculations
The system bus capacity dictates how rapidly data moves between the CPU, caches, and memory.
For multi-word burst transfers involving an initial address handshake overhead of cycles followed by cycles per word:
where is the number of data words transferred in the burst.
◇Worked Examples / Calculations / Hardware Traces
Example 1: Multi-Class Workload CPI and Execution Time Analysis
Problem: A processor runs at a clock frequency of (). A benchmark program containing exhibits the following instruction distribution:
| Instruction Class | Frequency () | Cycle Cost () |
|---|---|---|
| Arithmetic & Logic | 1 | |
| Load / Store Memory | 4 | |
| Branch / Jump | 2 | |
| Floating-Point Multiply | 8 |
Calculate:
- The overall average CPI.
- The total CPU execution time.
- The MIPS rating of the processor on this benchmark.
Solution:
-
Average CPI:
-
CPU Execution Time:
-
MIPS Rating:
Example 2: Amdahl's Law Speedup Evaluation
Problem: In a rendering application, floating-point vector calculations account for of total execution time. An engineering team is considering two microarchitectural improvements:
- Proposal A: Implement a specialized SIMD vector unit that accelerates vector calculations by , increasing total manufacturing cost by .
- Proposal B: Redesign the memory pipeline, accelerating non-vector instructions by (applicable to the remaining of runtime), with no cost increase.
Evaluate which proposal yields higher overall speedup.
Solution:
-
Proposal A ():
-
Proposal B ():
Conclusion: Proposal A delivers significantly higher overall speedup ( vs ) because it targets the dominant fraction of the workload.
Example 3: System Bus Burst Transfer Calculation
Problem: A 64-bit wide system bus () operates at a clock frequency of . Reading a 64-byte cache block from main memory requires:
- 3 bus cycles to transmit the address and establish the handshake.
- 1 bus cycle per 64-bit word transferred in synchronous burst mode.
Calculate:
- The bus cycle period.
- The total time required to transfer the 64-byte block.
- The effective data transfer rate (in MB/s).
Solution:
-
Bus Cycle Period:
-
Words in 64-byte block:
-
Total Bus Cycles:
-
Total Transfer Time:
-
Effective Transfer Rate:
◇Complexity Analysis / Common Pitfalls
- MIPS as an Absolute Performance Metric: Comparing two processors solely by MIPS can be deceptive. A RISC processor executing simple instructions at 1200 MIPS may execute more instructions than a CISC processor at 800 MIPS to achieve the same task, resulting in slower wall-clock completion time.
- Neglecting the Non-Enhanced Fraction in Amdahl's Law: Engineers frequently over-optimize a sub-component with extreme speedup () without realizing that if that component only represents of total runtime (), the maximum system speedup is capped at (a mere gain).
- Ignoring Bus Overhead Cycles: When calculating bus data transfer rates, calculating raw peak throughput () ignores mandatory address transmission and arbitration cycles, leading to over-optimistic performance estimates.
◇References & Navigation
- Previous Topic: ◇Course Overview & Architecture Foundations
- Next Topic: ◇Integer Representation & Fixed-Point Arithmetic
- Related Notes: ◇Processing Unit Organization & Single-Bus Datapath, ◇Memory System Organization & Hierarchy
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
A benchmark program's execution time on a CPU is 12 seconds with an average CPI of 1.8. What is the total instruction count of the program?
If an architectural enhancement accelerates database search operations by , and search operations consume of total execution time, what is the overall system speedup according to Amdahl's Law?
Why is MFLOPS a more reliable metric than MIPS when benchmarking scientific computation engines?
A 32-bit wide memory bus operates at . What is the theoretical peak data bandwidth of this bus?
Under the CPU performance equation, which variable is primarily determined by compiler optimization and algorithm design?