본문으로 건너뛰기

Computer Abstractions and Technology

1.1 Introduction

1) Classes of Computers

Personal Computer (PC): A computer designed for use by an individual and for running general-purpose software.

Server: A computer that provides computing, storage, or network services to multiple users or computers.

Supercomputer: A highly parallel computer designed for large scientific and engineering calculations.

Embedded Computer: A computer integrated into another device to perform a specific function.

Cloud Computing: A computing model that provides processing power, storage, and applications through remote datacenters.

Warehouse-Scale Computer (WSC): A large computing system in which many servers operate together as one datacenter-scale service.

2) Data Size Units

Bit: The smallest unit of information, represented as either 0 or 1.

Byte: A group of 8 bits.

Decimal unitSizeBinary unitSize
KB10310^3 bytesKiB2102^{10} bytes
MB10610^6 bytesMiB2202^{20} bytes
GB10910^9 bytesGiB2302^{30} bytes
TB101210^{12} bytesTiB2402^{40} bytes

1.2 Eight Great Ideas in Computer Architecture

1) Design for Moore's Law

Moore's Law: The observation that the number of transistors integrated onto a chip has historically increased exponentially over time.

2) Use Abstraction to Simplify Design

Abstraction: A simplified model that hides lower-level implementation details and exposes only the information needed at a particular level.

3) Make the Common Case Fast

Make the Common Case Fast: Improve frequently executed operations because they have the greatest effect on overall performance.

4) Performance via Parallelism

Parallelism: The simultaneous execution of multiple operations to improve performance.

5) Performance via Pipelining

Pipelining: A technique that divides work into stages and overlaps different operations across those stages.

6) Performance via Prediction

Prediction: A technique that guesses a future result so execution can continue without waiting.

Branch Prediction: The prediction of whether a conditional branch will be taken and which instruction should execute next.

7) Hierarchy of Memories

Memory Hierarchy: An organization of storage into levels with different speeds, capacities, and costs.

Principle of Locality: Programs tend to access a small portion of their address space during a particular period.

Temporal Locality: Recently accessed data or instructions are likely to be accessed again soon.

Spatial Locality: Data or instructions near a recently accessed location are likely to be accessed soon.

8) Dependability via Redundancy

Redundancy: The use of additional components or information to detect errors or continue operating after a failure.

Fault Tolerance: The ability of a system to continue operating despite component failures.


1.3 Below Your Program

1) Software Layers

Application Software: Software that performs tasks directly for users.

System Software: Software that provides services and an execution environment for application programs.

Operating System (OS): System software that manages hardware resources and provides services to application programs.

Compiler: A program that translates high-level source code into assembly code, machine code, or an intermediate representation.

Assembler: A program that translates assembly-language instructions into machine instructions.

Assembly Language: A symbolic representation of machine instructions.

Machine Language: Binary instructions directly understood and executed by a processor.

2) Operating System Functions

Input/Output Management: The operating system controls communication between programs and hardware devices.

Memory Management: The operating system allocates and protects memory used by running programs.

Resource Sharing: The operating system coordinates processors, memory, storage, and devices among multiple programs.

3) From High-Level Language to Machine Language

Source Program: A program written in a high-level programming language.

Object File: A file containing machine code and related information produced during compilation or assembly.

Executable File: A complete machine-language program that can be loaded and executed.

Instruction: A command that tells the processor which operation to perform.


1.4 Under the Covers

1) Hardware Components

Five Classic Components of a Computer: Input, output, memory, datapath, and control.

Processor (CPU): The hardware component that interprets and executes program instructions.

Memory: The component that stores programs and data while they are being used.

Datapath: The processor component that performs arithmetic operations and moves data.

Control Unit: The processor component that directs the datapath, memory, and input/output devices according to program instructions.

2) Memory Technologies

Main Memory: Memory that stores programs and data currently being used by the processor.

Dynamic Random Access Memory (DRAM): Volatile memory commonly used to implement main memory.

Cache Memory: Small, fast memory near or inside the processor that stores data and instructions likely to be accessed soon.

Static Random Access Memory (SRAM): Fast volatile memory commonly used to implement processor caches.

Secondary Storage: Nonvolatile storage that retains programs and data when power is removed.

Volatile Memory: Memory that loses its contents when power is removed.

Nonvolatile Memory: Memory that retains its contents when power is removed.

3) Processor Interface

Instruction Set Architecture (ISA): The interface between hardware and low-level software, including instructions, registers, data types, addressing modes, and memory behavior.

Application Binary Interface (ABI): The binary-level rules that allow compiled programs to interact with an operating system and hardware platform.

Implementation (Microarchitecture): A particular internal hardware design that realizes an ISA.

Compatibility: The ability of different implementations to execute programs built for the same ISA and ABI.


1.5 Technologies for Building Processors and Memory

Transistor: An electrically controlled switch used as the fundamental building block of digital circuits.

Integrated Circuit (IC): A collection of transistors and electrical connections manufactured on one piece of semiconductor material.

Wafer: A thin circular piece of semiconductor material on which multiple integrated circuits are manufactured.

Die: An individual integrated circuit cut from a wafer.

Yield: The proportion of manufactured dies that operate correctly.

Yield=Working diesTotal dies\text{Yield} = \frac{\text{Working dies}}{\text{Total dies}}

Cost per Die: The approximate manufacturing cost of one die.

Cost per die=Cost per waferDies per wafer×Yield\text{Cost per die} = \frac{\text{Cost per wafer}} {\text{Dies per wafer} \times \text{Yield}}

1.6 Performance

1) Basic Performance Concepts

Response Time (Latency): The total time required to complete one task.

Throughput: The amount of work completed in a given period.

2) Comparing Performance

Performance: For a fixed task, performance is inversely proportional to execution time.

Performance=1Execution time\text{Performance} = \frac{1}{\text{Execution time}}

Relative Performance: Computer XX is nn times faster than computer YY when the following ratio equals nn.

n=Execution timeYExecution timeXn = \frac{\text{Execution time}_Y}{\text{Execution time}_X}

3) Measuring Execution Time

Elapsed Time: The total wall-clock time from the beginning to the end of a task, including processing, input/output, and waiting.

CPU Execution Time: The time the processor spends executing a particular program.

CPU execution time=User CPU time+System CPU time\text{CPU execution time} = \text{User CPU time} + \text{System CPU time}

4) Clock-Based Performance

Clock Cycle: One time interval of the processor clock.

Clock Rate: The number of clock cycles per second.

Clock rate=1Clock cycle time\text{Clock rate} = \frac{1}{\text{Clock cycle time}} CPU execution time=CPU clock cyclesClock rate\text{CPU execution time} = \frac{\text{CPU clock cycles}}{\text{Clock rate}}

5) Instruction Performance

Instruction Count: The number of machine instructions executed by a program.

Cycles Per Instruction (CPI): The average number of clock cycles required to execute one instruction.

CPI=CPU clock cyclesInstruction count\text{CPI} = \frac{\text{CPU clock cycles}}{\text{Instruction count}}

CPU Performance Equation: CPU execution time depends on instruction count, CPI, and clock cycle time.

CPU execution time=Instruction count×CPI×Clock cycle time\text{CPU execution time} = \text{Instruction count} \times \text{CPI} \times \text{Clock cycle time}

6) Factors Affecting CPU Performance

FactorMain influence
AlgorithmInstruction count and input/output operations
Programming languageInstruction count
CompilerInstruction count and CPI
ISAInstruction count, CPI, and clock rate
Processor implementationCPI and clock rate

7) Performance Measurement

Workload: A program or collection of programs used to evaluate a computer system.

Benchmark: A program used to measure and compare computer performance.

Benchmark Suite: A collection of benchmarks designed to represent a range of real workloads.


1.7 The Power Wall

1) Power and Energy

Energy: The total amount of electrical energy consumed while a system operates.

Power: The rate at which energy is consumed.

Power=EnergyTime\text{Power} = \frac{\text{Energy}}{\text{Time}}

Dynamic Power: Power consumed when transistors switch between logic states.

Dynamic powerCapacitive load×Voltage2×Switching frequency\text{Dynamic power} \propto \text{Capacitive load} \times \text{Voltage}^2 \times \text{Switching frequency}

Static Power: Power consumed by leakage current even when transistors are not switching.

Power Wall: The practical limit on increasing clock frequency because of power consumption and heat generation.

Energy Efficiency: The amount of useful computation performed per unit of energy.


1.8 The Switch from Uniprocessors to Multiprocessors

Multicore Processor: A single integrated circuit containing two or more processor cores.

Processor Core: An independent processing unit capable of executing instructions.

Parallel Program: A program designed so multiple computations can execute simultaneously.

Parallel Speedup: The performance improvement obtained by executing a program with multiple processing units.

Speedup=Sequential execution timeParallel execution time\text{Speedup} = \frac{\text{Sequential execution time}} {\text{Parallel execution time}}

Load Balancing: The distribution of work across processors so that they remain effectively utilized.

Synchronization: The coordination of parallel tasks that share data or depend on one another.

Communication Overhead: The additional time and resources required for parallel tasks to exchange data.


1.9 Benchmarking a Real Processor

Microarchitecture: The internal hardware organization used to implement an ISA.

Superscalar Processor: A processor capable of issuing multiple instructions during one clock cycle.

Out-of-Order Execution: A technique that executes instructions in a different order when dependencies permit it while preserving the program's observable result.

Simultaneous Multithreading (SMT): A technique that allows one processor core to execute instructions from multiple hardware threads during the same period.

Performance Benchmarking: The measurement of execution time using defined programs and input data.


1.10 Fallacies and Pitfalls

1) Amdahl's Law

Amdahl's Law: The overall performance improvement from enhancing one part of a system is limited by the fraction of execution time affected by that enhancement.

Speedup=1(1f)+fs\text{Speedup} = \frac{1}{(1-f)+\frac{f}{s}}

ff is the fraction of execution time that can be improved, and ss is the speedup of that fraction.

2) Misleading Performance Metrics

Clock Rate Limitation: A higher clock rate does not necessarily mean better performance because instruction count and CPI may differ.

Instruction Count Limitation: A lower instruction count does not necessarily mean better performance because the instructions may require more cycles.

CPI Limitation: A lower CPI does not necessarily mean better performance because instruction count and clock rate must also be considered.

Execution Time as a Performance Metric: For a fixed workload, execution time directly measures how long the task takes; throughput should be used when total work per unit time is the concern.


1.11 Concluding Concepts

Computer Architecture: The attributes of a computer system visible to software, especially its ISA.

Computer Organization: The internal hardware arrangement used to implement an architecture.

Hardware-Software Interface: The boundary through which software controls hardware, primarily defined by the ISA.

Performance Equation: CPU execution time depends on instruction count, CPI, and clock cycle time.

SecondsProgram=InstructionsProgram×Clock cyclesInstruction×SecondsClock cycle\frac{\text{Seconds}}{\text{Program}} = \frac{\text{Instructions}}{\text{Program}} \times \frac{\text{Clock cycles}}{\text{Instruction}} \times \frac{\text{Seconds}}{\text{Clock cycle}}

Design Trade-off: A decision that balances performance, cost, energy consumption, dependability, and scalability.