Computer Systems Fundamentals
1Introduction
This lecture explains how the
2Stored-Program Architecture
In a
Main memory can be treated as a collection of storage locations identified by
3The CPU and the Instruction Cycle
A CPU includes an
Instruction processing can be organized conceptually as the following
Fetch : Retrieve the next instruction from main memory.Decode : Determine the operation and operands specified by the instruction.Execute : Perform an operation, data transfer, or branch.Write-back : Store the result in a register or main memory when required.
For example, in a computation that loads two values into registers and then adds them, an addition instruction directs the ALU to perform the operation and stores the result in a register. Whether an instruction can refer to memory directly depends on the instruction set. A conditional branch changes the address of the next instruction according to a condition.
4Memory Hierarchy
Storage technologies involve tradeoffs among capacity, speed, and cost per unit of capacity. Computers therefore generally organize storage as a
Components farther to the left are closer to the CPU, faster, and smaller. A program tends to concentrate its memory references on the same storage locations or nearby locations over a short period. This tendency is called
5Input/Output
Input/output exchanges data with displays, keyboards, secondary storage devices, network interfaces, and other devices. Because CPUs and I/O devices operate at different speeds, a design in which the CPU merely waits for each operation to finish cannot use CPU time efficiently. An interrupt notifies the CPU of a device state change or operation completion.
Network communication is also a form of input/output. The following network lectures explain how data is transferred among multiple computers.
6Distinguishing Sources of Performance
An analysis of program execution time should distinguish at least the following factors:
- time spent executing instructions on the CPU;
- time spent obtaining data from the memory hierarchy; and
- time spent waiting for input/output to complete.
Algorithmic complexity abstracts how the required number of operations or amount of storage grows with input size. Measured execution time additionally depends on the CPU, memory hierarchy, I/O devices, implementation, and other factors. Algorithmic complexity and measured time on a particular computer are therefore not identical.
7Key Points
- In a stored-program architecture, instructions and data reside in main memory, and the CPU processes instructions through an instruction cycle.
- A memory hierarchy exploits differences in speed, capacity, and cost to make data access efficient.
- Performance analysis distinguishes CPU processing, memory access, and input/output waiting time.