π Lecture 1 β Introduction
π Overview: This lecture introduces the course on Advanced Computer Architecture, establishing the prerequisite knowledge required and defining core concepts like architecture versus organization. It provides a detailed historical timeline of computer development from the 1940s through the microprocessor era, outlines the course focus on quantitative design principles, and explains the fundamental perspectives and design cycle of computer architecture.
ποΈ Topics Covered
The lecture begins by defining computer architecture vs. organization and then presents a comprehensive academic and commercial history of computing from ENIAC/EDVAC through modern microprocessors. It introduces the course focus on quantitative principles, the textbook, and course style. The four perspectives of computer architecture (processor design, memory hierarchy, I/O and storage, multiprocessors and networks) are explained. Finally, the computer design cycle is discussed, covering technology trends, performance measurement, cost analysis, and computer generations.
π Lecture Summary
Introduction
This course of Advanced Computer Architecture assumes students have basic knowledge of digital logic design, computer organization and design, programming model of microprocessor, memory and input/output interfacing, and fundamentals of computer architecture. The instructor, Dr. Muhammad Ashraf Chughtai, completed his Ph.D. from the University of Manchester (UMIST) UK in 1986 and spent 32 years at UET Lahore.
Computer System
A computer system is a collection of Central Processing Unit, memory system, and peripheral devices, all interconnected by groups of conductors called buses.
Computer Architecture Versus Organization
Architecture refers to those attributes of a computer visible to a programmer or compiler writer, such as instruction set, addressing techniques, and I/O mechanisms. Members of each family (e.g., Intel x86 family and IBM family) share the same basic architecture and have code compatibility. Organization refers to how the features of a computer are implemented; i.e., control signal generation as FSM or microprogramming, memory technology (SRAM, DRAM), and hardware or software-based realization of operations (multiplication by hardware or algorithmically). The organization of the same architecture may differ between different versions.
Academic History
In 1944, John von Neumann introduced the concept of the stored-program computer, referred to as Electronic Discrete Variable Automatic Computer (EDVAC). In 1945/46, the worldβs first operational electronic general-purpose computer, Electronic Numerical Integrator And Calculator (ENIAC), was built at the Moore School of the University of Pennsylvania. ENIAC used 18,000 vacuum tubes, was 80 feet long, and could perform 1900 additions per second. In 1946, the Institute for Advanced Study (IAS) at Princeton introduced the IAS machine which was roughly 10 times faster than ENIAC. In 1948, a small prototype stored-program machine, Mark-I, was built at the University of Manchester, followed by Harvard computers (Mark-II, III, IV) known as Harvard Architecture, which had separate memories for instructions and data. In 1949, Maurice Wilkes of Cambridge University built the worldβs first full-scale, operational stored program computer, Electronic Delay Storage Automatic Calculator (EDSAC).
In 1949, the Eckert-Mauchly Computer Corporation built the first machine BINAC. The company was acquired by Remington-Rand, where the first general-purpose Universal Automatic Computer UNIVAC-I was produced in 1951, sold for $1 million. In 1952, IBM produced its first stored-program computer, the IBM-701. In 1963, Seymour Cray announced the first supercomputer, CDC 6600, from Control Data Corporation (CDC). In 1964, CDC announced the System/360 series with models 40, 50, 65, and 75, varying in clock rate (1.6-5.1 MHz), memory size (32KB-1 MB), cost ($0.225M β 1.900M), and performance. In 1965, Digital Equipment Corporation (DEC) introduced the first low-cost minicomputer, the PDP-8, for under $0.02M. In 1976, Cray Research Inc. (formed by Seymour Cray when he left CDC in 1970) announced the worldβs fastest, most expensive, and best cost-versus-performance supercomputer, the Cray-I.
Microprocessors 1971 β 2006
In 1971, while Cray was creating the worldβs most expensive machines, Intel introduced the first cheap microprocessor, the 4004. In 1977, the personal computer Apple-II was introduced by Steve Jobs and Steve Wozniak. In 1981, IBM announced personal computers employing Intel's microprocessor 80x86 and running the Microsoft operating system. With the introduction of personal computers, the era of supercomputers could not last more than two decades. In 1996, Cray Research was handed over to Silicon Graphics. In 1998, more than 350 million microprocessors with different instruction set architectures were in use, and by 2006, this number had risen to more than a billion.
Course Focus: Quantitative Principles of Computer Design
The primary aim of this course is an in-depth study of computer architecture concepts relevant for professional computer scientists, engineers, and architects. Emphasis is given to exposing advances in the field through cost-performance-power trade-offs and good engineering design. The course covers: quantitative principles of computer design, instruction set architecture, datapath and control (implementation and performance), advanced pipelining concepts, memory hierarchy design (main memory, cache, hard drives), multiprocessor architecture, storage and input/output systems, and computer clusters.
The textbook is Hennessy J. L. and Patterson D. A., Computer Architecture: A Quantitative Approach, 3rd Edition, Morgan Kaufmann publishers, 2003. The course includes a "research in the small" project where students pick a topic, work full time for 3 weeks, meet with faculty/TA, give an online presentation, and submit a written report like a conference paper.
Four Perspectives of Computer Architecture
Computer Architecture can be considered from four perspectives:
- Processor Design: Instruction set architecture (addressing modes and protections), datapath designs (multiple cycles and pipelines, ILP, hazards), and L1 caches (design, blocks, and associativity).
- Memory Hierarchy: L2 caches (coherence, bandwidth, and latency), main memory (DRAM, interfacing, and protocols), and virtual memory (interfacing and protocols).
- I/O and Storage: Disks and tapes, and Redundant Array of Inexpensive Disks (RAID).
- Multiprocessor and Networks: Shared memory, interconnecting networks, network switches, and routing, bandwidth, and latency.
Computer Design Cycle
The computer design and developments have been under the influence of technology, performance, and cost. The new trends in technology are used to reduce the cost and enhance the performance. The computer design is evaluated for bottlenecks using certain benchmarks to achieve optimum performance. Time is the key measurement of performance: a desktop user defines performance in terms of response time or execution time (time between start and completion of an event), while a data processing center manager defines it in terms of throughput (number of jobs completed in a specified time). Benchmarks are programs that try to average the frequency of operation and operands of a large set of programs. Standardized benchmark tools are available from the Standard Performance Evaluation Corporation (SPEC).
Design evaluation involves hardware cost/delay/area/power estimation, simulation at different levels of abstraction (ISA, RT, Gate, Circuit), queuing theory (to calculate response time and throughput of entire I/O systems), rules of thumb, and fundamental laws/principles. New designs are simulated to evaluate performance for different levels of workloads, and simulation helps keep result verification cost minimum. The cost-performance is optimized for workloads.
1: Technology Trends: Computer Generations
The generations are identified by dominant implementation technologies:
- 1st Generation (Vacuum tube): 1946-1957
- 2nd Generation (Transistor): 1958-1964
- 3rd Generation (SSI/MSI): 1965-1971 (up to 3,000 devices/chip)
- Large Scale Integration (LSI): 1972-1977 (3,000 - 100,000 devices/chip)
- 4th Generation (VLSI): 1978 onwards (100,000 - 100,000,000 devices/chip)
- Ultra Large Scale Integration (ULSI): Over 100,000,000 devices/chip
The first generation (1950-59) used vacuum tube technology. The second generation (1960-68) used transistors. The third generation (1969-77) was the age of minicomputers using integrated circuits. The fourth generation (1978 to date) is the result of VLSI and ULSI technology. The gateway to the fifth generation is not clear as no revolutionary technology has been proclaimed. Present transistor technology integrates up to 15 million transistors on one VLSI chip for PowerPC and Pentium processors.
In 1980, supercomputer performance was 50 times that of microprocessors, 20 times that of minicomputers, and 10 times that of mainframe computers. By 1992, microprocessor performance was equivalent to that of supercomputers, and it was much higher from 1995 onwards.
3: Cost
Systems are implemented using the latest technology to obtain cost-effective high-performance solutions, with due consideration given to implementation complexities.
Price Versus Cost
The relationship between cost and price is complex. Cost is the total amount spent to produce a product, while price is the amount for which a finished good is sold. Cost passes through different stages before it becomes price, and a small change in cost may have a big impact on price.
Component Costs
- Direct Costs (add 25% to 40%): Recurring costs such as labor, purchasing, scrap, and warranty.
- Gross Margin (add 82% to 186%): Nonrecurring costs such as R&D, marketing, sales, equipment maintenance, rental, financing cost, pretax profits, and taxes.
- Average Discount to get List Price (add 33% to 66%): Volume discounts and/or retailer markup.
Summary
-
A computer system's development is viewed with reference to computer architecture and computer system organization. Architecture refers to attributes visible to a programmer (instruction set, addressing, I/O mechanisms). Organization refers to how features are implemented (FSM or microprogramming, memory technology). Architecture of processor family members is the same, while organization may differ.
-
Computer development has been discussed with academic and commercial perspectives. Academically, it started in 1944-49 with von Neumann's EDVAC and Wilkes' EDSAC. Commercially, the first machines were BINAC and UNIVAC-I ($1 million in 1951), and the Cray-I (1976) was the worldβs fastest supercomputer.
-
Decisive factors for rapid changes in computer development are performance enhancements, price reduction, and functional improvements.
-
Technological developments from vacuum tubes to VLSI circuits gave birth to four computer generations. At present, no revolutionary technology has been proclaimed for a fifth generation.
-
Computer Architecture is viewed from four perspectives: Processor Design, Memory Hierarchy, Input/Output and Storage, and Multiprocessor and Network Interconnection.
-
The course focuses on in-depth study of computer architecture concepts, exposing advances through cost-performance-power trade-offs and good engineering design.
-
The computer design cycle is influenced by technology, performance, and cost; new trends in technology enhance performance and reduce cost.
β Key Takeaways
The most critical distinction to remember is that architecture refers to the programmer-visible attributes (instruction set, addressing, I/O mechanisms) which are shared across a processor family for code compatibility, while organization refers to how those features are physically implemented (control signal generation, memory technology), which can differ between versions. The historical timeline is crucial, from von Neumann's stored-program concept (EDVAC) and the first operational machines (ENIAC, EDSAC) through the commercial era (UNIVAC-I), the first supercomputer (CDC 6600), and the microprocessor revolution (Intel 4004, 80x86). Computer performance is measured by response time (for desktop users) or throughput (for data centers), and standardized benchmarks like those from SPEC are used for evaluation. The computer design cycle is driven by technology, performance, and cost, with technology generations progressing from vacuum tubes to VLSI. Finally, the four perspectives of computer architecture (processor design, memory hierarchy, I/O and storage, multiprocessors and networks) provide the framework for analyzing and designing computer systems.
π§ Quick Revision Questions
- What is the fundamental difference between computer architecture and computer organization? Provide an example of each.
- Name the first operational stored-program computer and the institution where it was built.
- What are the three primary influences on the computer design cycle?
- What are the four perspectives from which computer architecture can be considered?
- How does the definition of "performance" differ between a desktop user and a data processing center manager?
π Lecture 2 β Quantitative Principles
π Overview: This lecture continues the discussion on the growth in processor performance and introduces the key concepts of quantitative design and analysis in computer architecture. It covers the critical relationship between cost and performance, the metrics for measuring CPU performance, and the use of benchmark suites for comparing computer systems. Understanding these principles is essential for making informed design and purchasing decisions in computing.
ποΈ Topics Covered
The lecture begins with a review of architecture vs. organization and the historical computer development timeline from von Neumann to modern microprocessors. It then delves into the price-performance design, explaining the complex relationship between manufacturing costs and list price, including the cost of integrated circuits and die yield calculations. The discussion moves to performance metrics, defining execution time, throughput, and CPU time with the fundamental CPI equation. Finally, the lecture covers CPU performance measurement using MIPS, MFLOPS, and detailed benchmark suites including the SPEC benchmarks, concluding with design trends and the importance of execution time as the real measure of performance.
π Lecture Summary
1: Architecture vs. Organization
Architecture refers to those attributes of a computer visible to a programmer or compiler writer, e.g., instruction set, addressing techniques, I/O mechanisms. Organization refers to how the features of a computer are implemented, i.e., control signals are generated using the principles of finite state machine (FSM) or microprogramming.
2: Historical Computer Development
Computer development was discussed with academic and commercial perspectives. Academically, modern computer developments have their infancy in 1944-49, when John von Neumann introduced the concept of stored-program computer, referred to as EDVAC, and Maurice Wilkes of Cambridge University built the worldβs first full-scale, operational stored program computer, EDSAC. Commercially, the first machine BINAC was built by Eckert-Mauchly Computer Corporation in 1949, and UNIVAC-I by Remington-Rand in 1951, sold for $1 million. In 1976, Cray Research Inc. announced the worldβs fastest, most expensive supercomputer Cray-I. Technological developments from vacuum tubes to VLSI circuits gave birth to four generations of computers. In 1971, Intel introduced the first cheap microprocessor 4004 and then the 80 x 86 series, which was used by IBM in personal computers. By 2006, more than a billion microprocessors were in use.
3: Perspectives of Computer Architecture
Computer Architecture was viewed from four perspectives: Processor Design, Memory Hierarchy, Input/output and storages, and Multiprocessor and Network interconnection.
4: Computer Design Cycle and Growth in Processor Performance
The computer design and development has been under the influence of technology, performance, and cost. The growth in processor performance since mid-1980s has been substantially high. Prior to the mid-1980s, microprocessor performance growth averaged about 35% per year. By 2001, the growth raised to about 1.58 per year. Supercomputers and mainframes of the 1960s were replaced with minicomputers in the 1970s, and then by low-cost microprocessor-based PCs and workstations in the 1980s.
Price-Performance Design
Technology improvements are used to lower the cost and increase performance. The cost is the total amount spent to produce a product, while the price is the amount for which a finished good is sold. A small change in cost may have a big impact on price.
Manufacturing Costs include:
- Component Cost: 40% to 50% of list price
- Recurring costs: Labor, purchasing scrap, warranty β 4% to 16% of list price
- Gross margin β Non-recurring cost: R&D, marketing, sales, equipment, rental, maintenance, financing cost, pre-tax profits, taxes
List Price includes an Average Discount of 15% to 35% for volume discounts and/or retailer markup.
Cost-effective IC Design depends on:
- Yield: Percentage of manufactured components surviving testing
- Volume: Increases manufacturing, decreases list price, improves purchasing efficiency
- Feature Size: The minimum size of a transistor or wire in either x or y direction
Reduction in feature size from 10 microns in 1971 to 0.18 in 2001 resulted in a quadratic rise in transistor count, linear increase in performance, and the evolution from 4-bit to 64-bit microprocessors.
Cost of Integrated Circuits
The Integrated circuit manufacturing passes through stages: Wafer growth and testing, Wafer chopping into dies, Packaging the dies to chips, and Testing a chip.
A die is the square area of the wafer containing the integrated circuit.
The cost of an integrated circuit is determined as: Cost of IC = (die cost + die testing cost + packaging cost + final testing cost) / final test yield
The cost of a die is: Cost of die = Cost of wafer / (dies per wafer x die yield)
The number of dies per wafer is: Dies per wafer = [ Ο (wafer diameter/2)Β² / die area ] β [ Ο (wafer diameter) / β(2 x die area) ]
π Formula: Dies per wafer = [Wafer area / Die Area] - Wafer Waist area
π Example Calculating Number of Dies: For a die of 0.7 cm on a side, find the number of dies per wafer of 30 cm diameter. Answer: [Ο (30/2)Β² / 0.49] - [Ο (30) / β(2 x 0.49)] = 1347 dies
Die yield is the fraction or percentage of good dies on a wafer. Wafer yield accounts for completely bad wafers. A good estimate for CMOS is Ξ± = 4.0.
π Formula: Die yield = Wafer yield x (1 + (defects per unit area x die area) / Ξ±)^(-Ξ±)
π Example: Calculating Die Yield The yield of a die, 0.7 cm on a side, with defect density of 0.6/cmΒ². Answer: (1 + [0.6 x 0.47] / 4.0)^(-4) = 0.75
Performance Metrics: Time and Throughput
CPU performance is measured by Execution time (response time, latency) or Throughput (bandwidth) - tasks per day, hour, week, sec, ns.
π Example: Cost-Performance Comparison (Train vs. Plane) To carry 2400 passengers from Lahore to Islamabad:
- Train: completes the task in 4:00 hours, carries 2400 passengers/trip (6.0 sec/person), cost 300 Rs/person. Cost-performance = 1,800 Rs-sec/person.
- Plane: completes the task in 6.00 hours, carries 300 passengers/trip (9.0 sec/person), cost 3000 Rs/person. Cost-performance = 27,000 Rs-sec/person.
The plane is 10 times faster but takes 50% more time to complete the job, so the throughput and performance of the train is 50% more than the airplane. The cost-performance per person by train vs. airplane is 1:15.
Metrics of Performance: CPU Time
Execution time or latency includes everything - processing, disk access, memory access, I/O, OS overheads. This is the wall-clock time, elapsed time, or response time.
CPU time is different from response time in multiprogramming. It is divided into user CPU time (time spent in the program) and system CPU time (time spent in the operating system).
Aspects of CPU Performance
π Formula: CPU time = Seconds / Program = (Instructions / Program) x (Cycles / Instruction) x (Seconds / Cycle)
All computers run at a constant rate determined by discrete time events called ticks, clock ticks, clock periods, clocks, cycles, or clock cycles.
The CPI (Cycles Per Instruction) is: CPI = CPU clock cycles for program / Instruction count
CPU Time = CPU clock cycles for program / clock rate CPU time = instruction count x clock cycle time x cycles per instruction sec. / program = (instructions/program) x (clock cycles/instructions) x (seconds/clock cycles)
Cycles Per Instruction (CPI)
CPI = CPU Clock Cycles for program / Instruction Count = (CPU Time * Clock Rate) / Instruction Count
Instruction Frequency for a given instruction mix: FICi = IC of i-th instruction / Total Instruction count
Average Cycles Per Instruction: CPI = (1/Instruction count) Ξ£i=1 to n ICi x CPIi = Ξ£i=1 to n FICi x CPIi
π Example: Calculating average CPI Base Machine (Reg/Reg):
- ALU: Freq 50%, Cycles 1, CPI(i) 0.5 (33% of time)
- Load: Freq 20%, Cycles 2, CPI(i) 0.4 (27% of time)
- Store: Freq 10%, Cycles 2, CPI(i) 0.2 (13% of time)
- Branch: Freq 20%, Cycles 2, CPI(i) 0.4 (27% of time)
- Average CPI = 1.5
Total Execution Time for n Programs
- Arithmetic mean time: (1/n) Ξ£i=1 to n Timei (each program runs once)
- Weighted arithmetic mean time: Ξ£i=1 to n wi x Timei (with weighting factor wi for unequal mix)
- Geometric mean time: βΏβ(Οi=1 to n Execution time ratioi) (normalized to a reference machine)
Instruction Execution Rate β MIPS and MFLOPS
MIPS (Millions of Instructions Per Second): MIPS = (instruction count) / (execution time x 10βΆ)
Relative MIPS (RMIPS) for a machine βMβ based on a reference machine: RMIPS = [Performance M / Performance reference] x MIPS reference = [Time reference / Time M] x MIPS reference
MFLOPS is defined for floating-point-intensive programs as millions of floating-point operations per second.
CPU Benchmark Suites
Benchmarks are programs specifically chosen to measure performance. Five levels in decreasing order of accuracy:
- Real Applications: Scientific programs like MatLab, C compiler, Photoshop - most suitable as users can select input and options.
- Modified Applications: Real applications used as building blocks with certain blocks modified to focus on desired aspects.
- Kernels: Small key pieces extracted from real programs, run to evaluate performance by isolating individual features.
- Toy benchmarks: Small codes (10-100 lines) producing known results.
- Synthetic benchmarks: Small sections of program created artificially to match average frequency of operations.
SPEC: System Performance Evaluation Cooperative
Founded in late 1980s to improve benchmarking.
- First Round (1989): SPEC89 - 10 programs yielding a single number β SPECmarks.
- Second Round (1992): SPEC92 - SPECInt92 (6 integer programs) and SPECfp92 (14 floating point programs).
- Third Round (1995): SPEC95 - new set of programs: SPECint95 (8 integer) and SPECfp95 (10 floating point). Single flag setting for all programs: SPECint_base95, SPECfp_base95.
Desktop benchmarks are divided into CPU-intensive (SPEC89, SPEC92, SPEC95, SPEC2000) and Graphic-intensive (SPECviewperf, SPECapc).
Server benchmarks include SPEC CPU2000 (throughput benchmarks for multiprocessors), SPECsfs (fileserver benchmark for I/O systems), and SPECweb (simulates multiple clients requesting static and dynamic pages).
Designing and Performance Comparison Summary
Design Trends:
- Logic: Capacity 2x in 3 years, Speed 2x in 3 years
- DRAM: Capacity 4x in 3 years, Speed 2x in 10 years
- Disk: Capacity 4x in 3 years, Speed 2x in 10 years
"X is n times faster than Y" means: ExTime(Y) / ExTime(X) = Performance(X) / Performance(Y)
CPI Law: CPU Time = (Instructions / Program) x (Cycles / Instruction) x (Seconds / Cycle)
Execution time is the REAL measure of computer performance!
Die Cost goes roughly with die areaβ΄.
β Key Takeaways
Execution time is the definitive measure of computer performance, and the CPI Law (CPU time = Instructions x CPI x Cycle time) is the fundamental equation for analyzing CPU performance. The cost-performance design involves a complex balance between manufacturing cost and price, where small changes in cost can have a big impact on price; die cost scales roughly with die area to the fourth power. Benchmark suites like SPEC are essential for comparing performance without running actual programs, using five levels from real applications to synthetic benchmarks. Finally, understanding the difference between execution time (latency) and throughput is crucial, as different users (desktop vs. server) prioritize different metrics.
π§ Quick Revision Questions
- Explain the key difference between architecture and organization in computer design.
- Write down the full CPI Law equation and define each of its three components.
- What is the difference between cost and price in the context of computer manufacturing, and what are the main components of manufacturing cost?
- Calculate the number of dies per wafer for a 30 cm diameter wafer if the die area is 0.49 cmΒ², using the provided formula.
- List the five levels of benchmarks in decreasing order of accuracy and briefly describe the SPEC organization's role in benchmarking.
π Lecture 3 β Quantitative Principles Design for Performance
π Overview: This lecture examines quantitative principles for evaluating and improving computer system performance, with a focus on I/O systems. It introduces queuing theory fundamentals via Littleβs Law and presents Amdahlβs Law as a critical tool for calculating the maximum achievable speedup when enhancing only a portion of a system.
ποΈ Topics Covered
The lecture begins with a recap and introduces I/O performance concepts, including the producer-server model for computer I/O systems. It covers I/O performance parameters like diversity, capacity, latency, and bandwidth, then explains I/O transaction time divided into entry time, system response time, and think time. The relationship between throughput versus response time is examined, followed by the derivation and application of Littleβs Law from queuing theory. The lecture concludes with Amdahlβs Law, including its formula and an example showing the speedup when floating-point instructions are improved.
π Lecture Summary
Computer I/O System
The I/O system is modeled using a Producer-Server model, where the producer is the device generating tasks to be serviced, a queue is the area where tasks accumulate waiting for service, and the server is the device performing the requested service. The Response Time is defined as the time a task takes from the moment it is placed in the buffer to the time the server finishes the task.
π‘ Why this matters: Understanding this model helps analyze bottlenecks in computer systems where I/O devices interact with the CPU.
I/O Performance Parameters
There are four key I/O performance parameters. Diversity refers to which I/O devices can connect to the CPU. Capacity refers to how many I/O devices can connect to the CPU. Latency is the overall response time to complete a task. Bandwidth is the number of tasks completed in a specified time, also known as throughput.
I/O Transaction Time
The transaction time of a computer is the sum of three distinct times. Entry Time is the time for the user to enter a command β this averages 0.25 seconds, but from a keyboard it takes 4.0 seconds. System Response Time is the time between when the user enters the command and when the system responds. Think Time is the time from reception of the command until the user enters the next command.
Littleβs Law β A Little queuing theory
If the system is in steady state, then the number of tasks entering the system must equal the number of tasks leaving the system. Littleβs Law states that the mean number of tasks in the system equals the mean response time multiplied by the arrival rate.
The mathematical derivation uses three components:
- Mean number of tasks in system = (Time accumulated) / (Time observe)
- Mean response time = (Time accumulated) / (Number tasks)
- Arrival rate Ξ» = (Number tasks) / (Time observe)
π Definition β Littleβs Law: Mean number of tasks in system = Mean response time Γ Arrival rate
π Formula: Mean number of tasks = Mean response time Γ Ξ» β The average number of tasks waiting or being processed equals how long they wait times how fast new tasks arrive
π Example: If the average response time is 2 seconds and the arrival rate is 5 tasks per second, then the mean number of tasks in the system = 2 Γ 5 = 10 tasks.
Amdahlβs Law
Amdahlβs Law provides the speedup due to an enhancement. Suppose that enhancement E accelerates a fraction F of the task by a factor S, while the remainder of the task is unaffected. The overall speedup is calculated using the execution time with and without the enhancement.
π Definition β Amdahlβs Law: The performance improvement to be gained from using a faster mode of execution is limited by the fraction of the time the faster mode can be used.
π Formula:
- Speedup (E) = Execution Time without E / Execution Time with E = Performance with E / Performance without E
- Execution Time_new = Execution Time_old Γ [(1 β Fraction_enhanced) + Fraction_enhanced / Speedup_enhanced]
- Speedup_overall = ExecutionTime_old / ExecutionTime_new = 1 / [(1 β Fraction_enhanced) + Fraction_enhanced / Speedup_enhanced]
π Example: Floating point instructions are improved to run 2 times faster, but only 10% of actual instructions are FP.
- ExecutionTime_new = ExecutionTime_old Γ (0.9 + 0.1/2) = 0.95 Γ ExecutionTime_old
- Speedup_overall = 1 / 0.95 = 1.053
This shows that even if we double the speed of the 10% of instructions that are FP, the overall speedup is only 5.3%.
β Key Takeaways
The I/O system must be analyzed using the producer-server model with queue, server, and response time concepts. The four critical I/O performance parameters are diversity, capacity, latency, and bandwidth β each addressing a different aspect of I/O capability. Littleβs Law provides a fundamental relationship in queuing theory: the mean number of tasks in a system equals the mean response time multiplied by the arrival rate, enabling performance prediction in steady-state systems. Amdahlβs Law is the most critical formula for understanding the limitations of performance enhancement β it shows that the overall speedup is severely limited by the fraction of the task that can be improved, regardless of how much that fraction is accelerated. The floating-point example demonstrates that improving only 10% of instructions by a factor of 2 yields a meager 5.3% overall speedup.
π§ Quick Revision Questions
- What are the three components of I/O transaction time, and what are the typical values for entry time?
- State Littleβs Law in words and write its mathematical formula.
- If the mean response time is 3 seconds and the arrival rate is 4 tasks per second, what is the mean number of tasks in the system?
- Write Amdahlβs Law formula for overall speedup in terms of Fraction_enhanced and Speedup_enhanced.
- If 20% of a program can be sped up by a factor of 4, what is the overall speedup?
π Lecture 4 β Instruction Set Principles
π Overview: This lecture provides a comprehensive introduction to the Instruction Set Architecture (ISA) β the critical interface between hardware and software. It categorizes different ISA types (Stack, Accumulator, GPR), explains memory addressing modes and operand types, and details the various categories of operations a processor must support. Understanding ISA is essential because it forms the foundation upon which both hardware implementation and software compilation are built.
ποΈ Topics Covered
The lecture recaps key performance and design principles from Chapters 1-3, then defines the three pillars of computer architecture and the evolving focus of the field. It introduces the ISA taxonomy with Stack, Accumulator, and General Purpose Register architectures, compares their advantages and disadvantages, and details the types and sizes of operands. Finally, it covers categories of instruction set operations and a comprehensive range of memory addressing modes, including immediate, register, direct, indirect, special, and control flow modes.
π Lecture Summary
Recap: Lec. 1-3 Chapter 1
The decisive factors for rapid changes in computer development have been performance enhancements, price reduction, and functional improvements. Processor performance is compared by the factor n, which determines how much lower the execution time one machine takes compared to another. Price-Performance Design understands the complex relationship between cost (the total amount to produce a product) and price (the amount for which a finished good is sold), which is controlled by die yield and volume. Supercomputers and mainframes have been replaced with low-cost microprocessor-based desktop machines. A benchmark is a program developed to evaluate performance; good products require proficient benchmarks and expert ways to summarize performance. An I/O system works on the producer-server model, which comprises a queue where tasks accumulate and a server that performs the requested service. The response time is the time from when a task arrives in the buffer to when the server finishes it.
Changing Definitions of Computer Architecture
The three pillars of computer architecture are: hardware, instruction set, and software. Hardware facilitates running the software, and the instruction set is the interface between them. The focus of Computer Architecture courses has changed over time: from 1950s to 1960s it was Computer Arithmetic; from 1970s to mid 1980s it was Instruction Set Design (the portion visible to the programmer and compiler writer); and from 1990s to date it is the design of CPU, memory system, I/O system, and Multiprocessors based on quantitative principles for price-performance.
Instruction Set Architecture β ISA
Instruction Set Architecture (ISA) is the interface between hardware and software. It plays a vital role in understanding computer architecture because the design of hardware and software cannot be initiated without defining it. The ISA describes the instruction word format and identifies the memory addressing for data manipulation and control operations.
π‘ Why this matters: A good interface lasts through many implementations (portability, compatibility), is used in many different ways (generality), provides convenient functionality to higher levels, and permits an efficient implementation at lower levels.
Taxonomy of Instruction Set
Major advances are typically associated with landmark instruction set designs: stack, accumulator, and general purpose register. Design decisions must take into account technology, machine organization, programming languages, compiler technology, and operating systems. The basic differentiator is the type of internal storage of the operand. The major choices of ISA are:
- Stack Architecture
- Accumulator Architecture
- General Purpose Register Architecture: Register-memory, Register-Register (load/store), and Memory-Memory (obsolete)
Stack Architecture
In a Stack Architecture, both operands are implicitly on the Top of Stack (TOS). It is also called a Zero-Address machine because instructions have no explicit address field. All operands are implicit (implied or inherited); the first operand is removed from the stack, and the second operand is replaced by the result.
π Definition β Stack Architecture: An ISA where operands are implicitly on the top of the stack, requiring no explicit operand addresses in the instruction.
π Example: To execute C = A + B:
PUSH A
PUSH B
ADD ; implicitly uses the two top-of-stack values
POP C
Accumulator Architecture
An accumulator is a special register within the CPU that serves as both the implicit source of one operand and the result destination for arithmetic and logic operations. It accumulates data and does not serve as an address register. Accumulator-based machines are called 1-address machines because the second operand is in memory.
π Definition β Accumulator: A special CPU register used as both an implicit source operand and the result destination for arithmetic/logic operations.
π Example: To execute C = A + B:
Load A ; accumulator β Mem[A]
ADD B ; accumulator β accumulator + Mem[B]
Store C ; Mem[C] β accumulator
General Purpose Register Architecture
General Purpose Register (GPR) Architecture has many CPU registers that do not have dedicated functions and can be used for variety of purposes (address, data, control). It has explicit operands either in register or memory. The three types are:
- Register-Memory: One explicit operand is in a register, one in memory, and the result goes into the register.
- Register-Register (Load/Store): Explicit operands are first loaded into registers temporarily and transferred to memory by Store instruction. Both explicit operands are not accessed from memory directly.
- Memory-Memory: This architecture is obsolete.
π Example (Register-Memory): C = A + B
Load R1, A
ADD R3, R1, B ; result goes into register R3
Store R3, C
π Example (Register-Register): C = A + B
Load R1, A
Load R2, B
ADD R3, R1, R2
Store R3, C
Comparison of three GPR Architectures
Register-Register advantages: simple, fixed-length instruction decoding; simple code generation; similar number of clock cycles per instruction. Disadvantages: higher instruction count than memory reference; lower instruction density leads to larger programs.
Register-Memory advantages: data can be accessed without separate Load first; instruction format is easy to encode. Disadvantages: operands are not equivalent since a source operand (in a register) is destroyed in operation; encoding a register number and memory address in each instruction may restrict the number of registers; CPI varies by operand location.
Memory-Memory advantages: most compact; doesn't waste registers for temporary storage. Disadvantages: large variation in instruction size; large variation in work per instruction; memory bottleneck by memory access.
Types and Size of Operands
Types of an operand include Integer, Single-precision floating point, and Character. Sizes include: Character (8-bit), Half word (16-bit), Single precision FP or Word (32-bit), Double precision FP or (64-bit), and double word.
Categories of Instruction Set Operations
All computers provide a full set of operational instructions for:
- Arithmetic and Logic: Integer add, sub, and, or, multiply, divide
- Data Transfer: Load, store, and move instructions with memory addressing
- Control: Branch, Jump, procedure call and return
Support instructions may include: System (OS call, Virtual Memory Management), Floating point (add, multiply, divide, compare), Decimal (BCD add, multiply, Decimal to Character Conversion), String (move, compare, search), and Graphics (Pixel and vertex operations, compression/decompression).
Operand Addressing Modes
An effective address is the binary bit pattern issued by the CPU to specify the location of operands in CPU (register) or memory. Addressing modes are the ways of providing access paths to CPU registers and memory locations. Commonly used addressing modes are:
π Immediate: Data for the instruction is part of the instruction itself.
π Example: ADD R4, #24H β Reg[R4] β Reg[R4] + 24H
Used to hold source operands only; cannot be used for storing results.
π Register: Operand is contained in a CPU register. No memory access needed, therefore fast.
π Example: ADD R4, R3 β Reg[R4] β Reg[R4] + Reg[R3]
π Direct (or Absolute): The address of the operand is specified as a constant, coded as part of the instruction. Limited address space (2^operand field size) locations.
π Example: ADD R1, (1000) β Reg[R1] β Reg[R1] + Mem[1000]
π Indirect: The address of the memory location where the data is to be found is stored in the instruction as the operand (operand is the address of an address). Large address space (2^memory word size) available. Two or more memory accesses are required.
Types of Indirect addressing modes:
- Register Indirect:
ADD R4, (R1)βReg[R4] β Reg[R4] + Mem[Reg[R1]] - Register Indirect Indexed:
ADD R4, (R1+R2)βReg[R4] β Reg[R4] + Mem[Reg[R1]+Reg[R2]] - Register Indirect plus displacement:
ADD R4, 100(R1)βReg[R4] β Reg[R4] + Mem[100+Reg[R1]] - Memory Indirect:
ADD R4, @(R1)βReg[R4] β Reg[R4] + Mem[Mem[Reg[R1]]]
Special Addressing Modes
Used for stepping within loops; R2 points to the start of the array; each reference increments/decrements R2 by 'd' (the size of the elements in the array).
- Auto-increment:
ADD R1, (R2)+β (i)Reg[R1] β Reg[R1] + Mem[Reg[R2]](ii)Reg[R2] β Reg[R2] + d - Auto-decrement:
ADD R1, (R2)-β (i)Reg[R2] β Reg[R2] - d(ii)Reg[R1] β Reg[R1] + Mem[Reg[R2]] - Scaled:
ADD R1, 100(R2)[R3]βReg[R1] β Reg[R1] + Mem[100 + Reg[R2] + R3 * d]
Addressing Modes of Control Flow Instructions
- Branch (conditional): A sort of displacement, in number of instructions, relative to the Program Counter (PC).
- Jump (Unconditional): Jump to an absolute address, independent of the position of PC.
- Procedure call/return: Control transfer with some state and return address saving, sometimes in a special link register or in some GPRs.
β Key Takeaways
A student must understand that the ISA is the fundamental interface between hardware and software, and its design decisions (stack, accumulator, or GPR) critically impact performance, code size, and hardware complexity. The three main ISA types differ in where operands are stored: stack (implicit on TOS), accumulator (one implicit operand), and GPR (explicit operands in registers/memory). For GPR architectures, the Register-Register (load/store) model offers simplicity and fixed instruction length at the cost of higher instruction count, while Register-Memory trades this for fewer loads but operand asymmetry. The various addressing modes (immediate, register, direct, indirect, and special modes like auto-increment) determine how the effective address of an operand is calculated, with each mode offering trade-offs between address space, speed, and flexibility.
π§ Quick Revision Questions
- What are the three major types of ISA based on internal operand storage, and what is the "address" characteristic of each (e.g., zero-address, one-address)?
- Explain the difference between Register-Register and Register-Memory architectures in terms of how operands are accessed and the resulting pros and cons.
- What is the difference between Direct and Indirect addressing modes in terms of where the operand's address is found and the address space each can access?
- How does the Auto-increment addressing mode work, and why is it useful for looping through arrays?
- List the three main categories of instruction set operations and give one example instruction for each category.