markdown
Computer Systems Fundamentalsmd b8b634f
lecture/information/systems/computer-systems-basics.lecture.n.md
Download PDF

Computer Systems Fundamentals

date2026-07-14document_iddoc_081f8ffb84ffda562468ed65e53d2fdfdescription計算機システムをCPU・メモリ・入出力の協調として捉え、命令サイクル、記憶階層、性能評価の基本を説明する。prerequisitesプログラミングの基本 / 二進表現と論理演算の初歩type講義statusactiverelateddata/lecture/information/systems/computer-systems-portal.lecture.n.md / data/lecture/information/programming/introduction-to-programming.lecture.n.md / data/lecture/information/algorithm/foundation/computational-complexity-basics.lecture.n.md / data/lecture/information/networks/computer-networks-portal.lecture.n.md
informationsystemsundergraduatelecture
data/lecture/information/systems/computer-systems-portal.lecture.n.md

1Introduction

This lecture explains how the CPUCentral Processing Unit, main memoryMain memory, and inputoutputInputoutput; IO cooperate to execute a program. By distinguishing instruction execution, data storage, and exchange with external devices, it connects program behavior to computer organization.

2Stored-Program Architecture

In a stored-program architectureStored-program architecture, both the instructions that constitute a program and the data processed by those instructions reside in main memory. The CPU retrieves instructions from main memory and performs the operations that they specify.

Main memory can be treated as a collection of storage locations identified by addressesAddress. At run time, a program variable corresponds to a location that stores a value or to a mechanism for referring to that location. Compiler optimizations may keep a value solely in a CPU register, so not every variable permanently occupies a fixed address in main memory.

3The CPU and the Instruction Cycle

A CPU includes an arithmetic and logic unitArithmetic and logic unit; ALU that performs operations, a control unitControl unit that directs instruction execution, and registersRegister that provide a small amount of high-speed storage.

Instruction processing can be organized conceptually as the following instruction cycleInstruction cycle.

  1. FetchFetch: Retrieve the next instruction from main memory.
  2. DecodeDecode: Determine the operation and operands specified by the instruction.
  3. ExecuteExecute: Perform an operation, data transfer, or branch.
  4. Write-backWrite-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 memory hierarchyMemory hierarchy consisting of registers, caches, main memory, and secondary storage.

registerscachesmainmemorysecondarystorage

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 locality of referenceLocality of reference. A memory hierarchy exploits locality by reusing frequently accessed data at levels close to the CPU.

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. DMADirect Memory Access transfers data between a device and main memory without requiring the CPU to move each word. These mechanisms help CPU execution and input/output proceed concurrently.

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.

8Next Lecture

data/lecture/information/networks/computer-networks-portal.lecture.n.md
raw .n.md をコピー
loc をコピー (filepath:line ~ line)
copy share link
copy encoded share link
path をコピー
copy share link
copy encoded share link
copy share link
copy encoded share link
タブを全て閉じる